-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.0] Drop es5 js files #39618
[5.0] Drop es5 js files #39618
Conversation
@dgrammatiko could you please rebase this? |
@HLeithner done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously agree with the concept. Largely lgtm only final comment do we still not want to use rollup in most cases against the code so that we can use modern js syntax like async/await or similar if we want
can we split this pr please, one "simple" pr that only removes es5 no other changes? is this possible? |
The extra parts are the removal of the focus-visible or there are more? Can do |
you removed chosen too, also I don't know the impact of changing template.js from defer:true to type:module |
chosen is dead. It was dead back in 2015 when Joomla v4 was started so at some point this needs to be removed. That said I can revert this change (although I don't quite agree with the notion of distributing dead code) |
about chosen, we use it on our own site https://developer.joomla.org/joomlacode-archive/tracker-32.html with joomla 4 and the promise is that this should continue without issues. That brings me to 2 questions.
|
Both were reverted but I have no clue how can PHP influence some static assets
NO. All the methods (HTMLHelper, WAM) will only include assets (js,css) only if the files exist |
Not sure if its relevant but dont forget the debug plugin uses jquery |
Back in 2018 I was about to offer converting it to vanilla js but the author wasn't really interested: maximebf/php-debugbar#368
The CSRF on that jQuery script has the same exact issue (leaking) as the Joomla.response. But there are other issues with the Joomla.request that are also valid for $.ajax() (this is not a good place for this discussion). BTW moving the jQuery to WAM is a B/C break (unless you have a dummy HTMLHelper::jquery that calls the WAM. For anyone following the jQuery discussion I would like to mention that the maintainers have a plan for jQuery v4 with a bunch of B/C breaks all due to security: |
not planning to remove jquery from joomla, only want to reduce HTMLHelpers because they are not the way to go (if possible). but completely irrelevant to this pr at the moment. I plan to do multiple Pr for the b/c plugin, if you are interested you can look at my repo.
HTMLHelper::jquery already already calls the WAM, so no b/c on this, and as sad I would move the jquery htmlhelper to the plugin (not removing it in 5.0). will be an one pr.
if it comes in time I would add it to joomla 5.0 not sure in which form yet. |
# Conflicts: # package-lock.json # package.json
In case when people worries about b.c. break due to removed assets. We can keep the asset definations, but empty, with flag "deprecated". And remove all es5 js files. Example for bootstrap,
After:
This dummies will save the site when some template use it in unknown reasons. |
I was thinking about that as well, so maybe I should update the PR to eliminate any B/C considerations @Fedik could you review this? I added the deprecated attribute and nullified the src on the es5 scripts |
Looks good. You reverted your original changes or? Because I see that es5 assets used as dependencies joomla-cms/build/build-modules-js/settings.json Lines 126 to 128 in d0a1029
This can be trashed. |
I tested this with one of my customer sites with my own template using joomla bootstrap and works as expected, I merge this for now and hope for more real world testing for alpha2 |
Pull Request for Issue # .
Summary of Changes
chosen
andfocus-visible
(never used in v4, the first was rolled with v4 for b/c the second was removed in some beta but the dependency was left behind)Testing Instructions
Joomla still works
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
@nibra @HLeithner this is my take on what the deliverables should be but there was also a discussion prior to v4 release on the same subject:
These conversations actually led to shipping type=module/nomodule on the first place but I guess now it's time to skip the es5 altogether.