NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
21 Mar 2019

Pull Request for Issue # .

Summary of Changes

  • Remove the webcomponentsjs polyfills
  • Add a tweeked version of those polyfills (right now they live under my username but you're free to fork that repo under the Joomla organization)
  • Split the logic for the webcomponents polyfills and the web components loader in the core.js
  • Add another file for the webcomponents polyfills. This file is read and put as inline script (few bytes) just before the body close tag.
  • The webcomponents loader inserts scripts with type="module" for ES2015+ files or with an attribute nomodule for the old ES5 files. The sniffing is done in the browser
  • Patches media manager with all the missing polyfills. Media manager also relies on webcomponents polyfill (we use custom elements in there as well)
  • Patches the edit view for the files in the media manager component. Again webcomponents is the base here as well.

The interesting part

With this PR Joomla gets a proper way to serve ES2015+ code. Also, that code IS expected to be a module. The biggest change tho is that these files are lazily loaded, following the well established best practices. The way this is done is totally B/C.
If this in principal get's the green light, eg Production team decides that J4 should do things according to the well established best practices then I would suggest that most scripts should follow this pattern (now you might understand why I was always screaming to convert everything to Custom Elements). Let's move forward, ES6 is already 4 years old...

Testing Instructions

npm i and check the backend and the media manager (especially with IE11)

Screenshot 2019-03-21 at 13 18 05

Screenshot 2019-03-21 at 14 39 34

All Custom elements (the ES2015+ version) are modules now:
Screenshot 2019-03-21 at 15 32 47

Documentation Changes Required

Enjoy!

f0722f4 21 Mar 2019 avatar dgrammatiko init
avatar dgrammatiko dgrammatiko - open - 21 Mar 2019
avatar dgrammatiko dgrammatiko - change - 21 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Mar 2019
Category JavaScript Administration com_media NPM Change Repository Libraries
avatar dgrammatiko dgrammatiko - change - 21 Mar 2019
Title
[4.0] Polyfills, Media manager on IE
[4.0][RFC] Polyfills, Media manager on IE
avatar dgrammatiko dgrammatiko - edited - 21 Mar 2019
avatar dgrammatiko dgrammatiko - change - 21 Mar 2019
The description was changed
avatar dgrammatiko dgrammatiko - edited - 21 Mar 2019
avatar rdeutz rdeutz - change - 22 Mar 2019
Labels Added: NPM Resource Changed ? ?
avatar dgrammatiko dgrammatiko - change - 2 Apr 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-04-02 11:07:40
Closed_By dgrammatiko
avatar dgrammatiko dgrammatiko - close - 2 Apr 2019

Add a Comment

Login with GitHub to post a comment