? Pending

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
30 Dec 2017

Pull Request for Issue #19218 .

Summary of Changes

Web Components and custom Elements are ES6 by definition, forcing to ES5 will fail on all ES6 capable browsers (eg 96% of them), unless there is also a patch for allowing ES5 class to act as ES6. We are using Babel to transpile from ES6 to ES5 and there is a missing part that patches Classes for custom Elements to act as native ES6 code. This is what you'll get:
screen shot 2017-12-30 at 21 23 45

Or open the codpen in chrome or safari: https://codepen.io/dgt41/pen/BJRrJN and check the console for errors!

BUT, because something went terribly wrong on the server we shouldn't deliver a crap experience. So let's load the CE the right way:
This is what we sent:
screen shot 2017-12-30 at 21 12 50

and this is how it becomes once page loaded:
screen shot 2017-12-30 at 21 13 17

Testing Instructions

Try creating some errors back end and front end. Observe that the alert custom element (the script) is correctly loaded

Expected result

Actual result

Documentation Changes Required

No

@wilsonge this one is for you

avatar dgt41 dgt41 - open - 30 Dec 2017
avatar dgt41 dgt41 - change - 30 Dec 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Dec 2017
Category Administration Templates (admin) Front End Templates (site) JavaScript
avatar dgt41 dgt41 - change - 30 Dec 2017
Labels Added: ?
avatar C-Lodder
C-Lodder - comment - 30 Dec 2017

You can't use the alert custom element in the tag for obvious reasons :)
That needs to be left as a div with the standard BS styling

avatar dgt41
dgt41 - comment - 30 Dec 2017

@C-Lodder nope, I can use it pretty nicely, all it needs is the inline style to override the opacity and display ;) I've tested it, custom elements are nothing more than spans if you don't define them...

avatar C-Lodder
C-Lodder - comment - 30 Dec 2017

@dgt41 ah fair enough then

avatar dgt41
dgt41 - comment - 31 Dec 2017

@C-Lodder this way of loading the custom elements was on my todo list for some time: https://github.com/joomla/joomla-cms/pull/17868/files#diff-a404964c9e0cca2cfd95296f205c3006R56

avatar wilsonge wilsonge - change - 2 Jan 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-01-02 22:13:07
Closed_By wilsonge
avatar wilsonge wilsonge - close - 2 Jan 2018
avatar wilsonge wilsonge - merge - 2 Jan 2018

Add a Comment

Login with GitHub to post a comment