Polymer HTML Imports Deprecated

萝らか妹 提交于 2019-12-04 23:09:26

问题


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


回答1:


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 :)




回答2:


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




回答3:


If you are using Google Polymer it's worth remembering that webcomponents.js is actually a polyfill. We currently run Polymer version 0.5 and this can actually be tested by starting your current Chrome with those features disabled. On Mac you can do this quitting Chrome and then run from command line:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-blink-features=ShadowDOMV0,CustomElementsV0,HTMLImports

Polymer 0.5 applies the Polyfill when these features are disabled.

Here is the documentation on running Chrome in debug mode Chromium debug flags



来源:https://stackoverflow.com/questions/46632987/polymer-html-imports-deprecated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!