Skip to content

[4.0] Keep Script/Style Declarations as an array instead of merge to one string#25357

Merged
wilsonge merged 3 commits intojoomla:4.0-devfrom
Fedik:script-declaration-to-array
Aug 4, 2019
Merged

[4.0] Keep Script/Style Declarations as an array instead of merge to one string#25357
wilsonge merged 3 commits intojoomla:4.0-devfrom
Fedik:script-declaration-to-array

Conversation

@Fedik
Copy link
Copy Markdown
Member

@Fedik Fedik commented Jun 28, 2019

Summary of Changes

Keep Script/Style Declarations as an array instead of merge to one string.
For long time JDocument merge all Script/Styles declarations to a single string, which not allow to use it for stuff like type="module" (which has import statement), or micro-data type="application/ld+json", and for other types that get broken when they merged.

This patch introduce a little B.C. (for extensions which use $doc->_script directly) but I think it not very critical, and better we do it now than never.

Additionally after little changes in #25301 this patch will allow to remove specific Script/Styles declarations without parsing whole $doc->_script/_style.

Testing Instructions

Apply the patch and make sure all still works as before.

Documentation Changes Required

This is potential B.C. and need to be described https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4

The Document::_script, Document::_style store Script/Styles declarations as an array, instead of string.

@wilsonge wilsonge merged commit 86a0d88 into joomla:4.0-dev Aug 4, 2019
@wilsonge
Copy link
Copy Markdown
Contributor

wilsonge commented Aug 4, 2019

Thanks!

@wilsonge wilsonge added this to the Joomla 4.0 milestone Aug 4, 2019
@Fedik Fedik deleted the script-declaration-to-array branch August 5, 2019 06:35
@brianteeman
Copy link
Copy Markdown
Contributor

See #25788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants