flyntwp / flynt-starter-theme

The starter theme for building Flynt projects.
MIT License
69 stars 4 forks source link

Keep deprecation of current custom elements definition in mind #297

Closed bdbch closed 5 years ago

bdbch commented 5 years ago

Currently FlyntWP uses window.customElements.define which will be deprecated next year. (See the chrome console on any of the latest Flynt projects right now).

document-register-element.js:2 [Deprecation] document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.

I think it's important to keep this issue in mind

domtra commented 5 years ago

@bdbch, thanks for your feedback.

We do have this in mind. This issue is, that in order to get rid of this message we would have to generate two different javascript bundles. One with native es20* code (esp. classes), and one transpiled to ES5.

However, this message will not have any impact to sites using the document-register-element polyfill. Even if document.registerElement is removed from the browser, the polyfill we use will create this method. You can test this by deleting document.registerElement in the head of your document.