Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer HTML Imports Deprecated

Tags:

html

polymer

So I've just got started with polymer and got this message:

[Deprecation] Styling master document from stylesheets defined in HTML Imports 
is deprecated, and is planned to be removed in M65, around March 2018. Please 
refer to ....... for possible migration paths.

After doing some reading it seems to be that

<link rel="import" href="/SOR/bower_components/paper-input/paper-input.html">

Was causing the issue and rel=import for html was being deprecated. Is this right? If so what is the fix, how should I be doing this?

Cheers

like image 847
Fraser Benjamin Avatar asked Oct 08 '17 15:10

Fraser Benjamin


People also ask

What happened to HTML imports?

HTML imports were abandoned by browser vendors, so even though they're still working with a polyfill, it's not recommended to use them in new applications.

What can I use instead of HTML imports?

Native implementation of HTML Imports will be removed from Chrome 73 so it is now recommended to use native fetch() , or third-party libraries.

Can I use HTML imports?

Browser support HTML Imports are a very new technology and as of the time of writing, are only supported in Chrome 31 and later. Even then, you're required to activate the feature. To do so you must go to _chrome://flags_ and enable “Enable HTML Imports” then restart chrome and you are ready to go.


2 Answers

So, according to the new version of chrome (61.xx.x). Google has made a decision that Styling master document from stylesheets defined in HTML Imports is not a good approach and so it will be unable to do in future chrome versions.

Because of this, we have to upgrade to version 2.x

Well, nothing much interesting except that Google has made a decision that HTML imports will be removed in future. This is much more frustrating. Everyone who is using Polymer 1.x or 2.x will have to update their projects to newer version of polymer (at least 3.x). Unfortunately version 3.x has no support in all major browsers (except Chrome, but not fully). So we can only hope that the remove of HTML imports will not be soon.

For me this is really piece of s**t. I have many projects written in Polymer and I am not able to upgrade them. (there is no time for this) even i had time, I don't have trust in Google Polymer... Their support is 0. They don't even answer to bugs. Old versions are already stopped from updating. No long-term support versions.

official discussion: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/VZraFwqnp9Y/discussion

like image 168
Kuba Šimonovský Avatar answered Nov 01 '22 11:11

Kuba Šimonovský


The issue has actually been solved by the polymer team, as described on their blog

So versions 1.10.1 or newer for 1.x and 2.1.1 or newer for 2.x are ok, however the warning doesn't go away (see blog entry for more details).

I also tested a polymer 2.6 app on Chromium 65 and on chrome 67 beta and it works fine everywhere :)

like image 27
space borg Avatar answered Nov 01 '22 11:11

space borg