Polymer HTML Imports Deprecated - html

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

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

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

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

Related

Nuxt js/Babel `SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.`

I have a web application that I create on Nuxt.js, But I have noticed that there are compiling bugs in some of the browsers (Like Safari, IE), I think this is the fault of the Babel configuration, then i run npm run build ES6 is not compiled, and I have errors in my console
for cross-browsing testing, I am using Browserstack
I have following errors in the console:
Unexpected token '...'. Expected a property name
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
How can i configure Babel to compile ES6?
Apparently, your code is not working on Safari v10 and below. Looking at some stats here:
https://gs.statcounter.com/browser-version-partially-combined-market-share#monthly-202007-202107
https://www.w3schools.com/browsers/browsers_safari.asp
https://caniuse.com/?search=flex
https://en.wikipedia.org/wiki/Safari_version_history#Safari_10_2
It looks like Safari is used with a minority of versions but those are mostly v13 and v14. Those are far more modern then then one you do not support.
Safari v10 is actually from 2007, so I can think that it's safe to say that you can ditch this version totally.
Even if Safari is not an evergreen browser (meaning updating-itself like Firefox or Chrome), people still using it are not on that old of a version.
You need to remember that if you want to support a version that old, you will heavily impact the overall performance of the whole website for every user. Okay, 0.5% of people will have a better experience (those stuck in 2007) but everybody else will need to carry the weight of that old babel-transpiled version.
You could make 2 bundles (one modern and for super old legacy browsers) and serve either one or the other depending if they do support ES modules. I cannot find the Google/HTTP 203 talking about this one.
But IMO, this is a lot of work (not that trivial) for a super tiny population, I'd rather pass on this and focus on more important things to handle.
Even a11y is reaching more people. Even tho, it's probably on a lower priority than Safari v10.
Here are my 2cts. If I find the video, I may update my answer.

native browser plugins alternatives to NPAPI

Hello as you might now NPAPI is deprecated.
What are the alternatives to this? I see skype released now the web version where you need to install a web plugin to make voice and video calls. Looking over what I installed I arrived to the conclusion that on chrome they are using Google Native Client: https://developer.chrome.com/native-client
But this one is not supported on firefox/safari (only chrome).
On Firefox/Safary I'm not sure what they are using.
So what are now the best alternatives for this kind of job where using c++ is mandatory (to extend an existing app and make it available as web plugin)
Silviu
After Chrome drop the NPAPI support, there is no-common technology support by Firefox/Chrome/Safari. You can consider about Firebreath 2.0. It allow you use one C++ implement to support different browser.
It's not released yet... If you like to try version 2.0, you can get source code from https://github.org/firebreath/firebreath (the "refactor" branch)
Note: version 2.0 make huge change, because the call between plugin and javascript are asynchronous! Upgrade from older version required lots of javascript change.

do manifest version 2.0 extensions work with older versions of chrome?

I can't seem to find a clear answer on this anywhere.
How far back is it backwards compatible? Do I have to be concerned about creating multiple versions of the extension?
Thanks
"manifest_version": 2 itself does not cause any incompatibility issues.
But you can easily make a mistake and create an extension which is backwards-incompatible, by using features/APIs which are introduced in Chrome 18 or later (manifest v2 came with Chrome 18).
I suggest to not worry about the old manifest version any more, because only Chrome 17- is affected. As of writing, the current stable version is 23. Hardly anyone is using Chrome 17 any more.
See also
How to upgrade extension to manifest v2 and remain backwards compatible? (Stack Overflow answer)
Tutorial: Migrate to Manifest V2 (Official documentation, apply the tips in the reverse order)
Manifest version 2 extensions have to use "background" instead of "background_page" (and the manifest cannot contain it or Chrome refuses to load the extension), but "background" is not supported in older versions of Chrome. This is the main problem.
The only work around I can think of is to publish multiple versions of your extensions and ask users to download and install the correct version.

Mozilla Plugins, will I have to recompile each time the Gecko SDK is updated?

I am about to start work on a Mozilla plugin for my company's main product line. I was under the impression that I could build using the Gecko SDK, say two major revisions ago, and that would cover any browser a person would reasonably be using. I am also assuming that this will also cover Chrome and Opera (fact check someone?).
However, I was just reading the documentation and I found this:
For Gecko versions before 2.0, you should choose the Gecko SDK version for the earliest version of Mozilla you wish to target. For Gecko versions 2.0 and higher, you must recompile your component for each release as cross-version compatibility is no longer supported.
Someone please tell me this doesn't mean what I think it means. Does this mean that I am going to have to recompile my plugin for each version of Gecko indefinitely--even after deployment? That doesn't seem like something that the great team over at Mozilla would inflict upon us.
The Gecko SDK has at least two very different purposes. To quote the documentation:
The Gecko SDK, also known as the XULRunner SDK, is a set of XPIDL files, headers and tools to develop XPCOM components which can then in turn e.g. be accessed from XUL using JavaScript.
...
The Gecko SDK contains all of the necessary tools and headers for making scriptable NPAPI plugins including the xpidl compiler/linker and the latest npapi.h.
The sentence you quote from this page applies to the main purpose of the SDK: build native XPCOM components that can be used by Firefox extensions. These XPCOM components have access to browser's internal interfaces which brings up the question of interface stability. Starting with Gecko 2.0 (Firefox 4) this issue is solved in such a way that an XPCOM component can work with one Firefox version only. To work with a different Firefox version it needs to be recompiled with a newer version of the Gecko SDK.
The documentation doesn't really make it clear but all this doesn't apply to NPAPI plugins which communicate with the browser via fixed interfaces only. I'm not sure how much of the Gecko SDK is still needed to compile NPAPI plugins, it seems that it's only npapi.h and a few other header files. This file don't exactly change often, the changes are mostly limited to constants. So there are no problems compiling your plugin against an older SDK version - only side-effect is that you might not be able to use the new NPAPI features.
That said, you should be able to use NPAPI SDK instead of the Gecko SDK. It is a much smaller download and is dedicated explicitly to creating NPAPI plugins. The files in the Gecko SDK are essentially copied from the NPAPI SDK anyway (note the "Sync to npapi-sdk rNN" changes in the file history).

How to set Chrome's user script version number

Edit: The bug that caused this problem has been fixed. The #version tag now works in the stable release. See Issue 30760
Hey.
I've been wondering how I might set the version number displayed for user-scripts in Chrome's extension tab
(source: advefir.com)
So far the obvious methods have failed:
// ==UserScript==
// #version 1.1.5
// #uso:version 1.1.5
// ==/UserScript==
I know Greasemonkey for Firefox doesn't use a version value, but since Chrome actually displays a version number, I thought it might.
Perhaps this is a feature that has not been implemented?
Or maybe it was never intended to be there, but it is there because extensions have version numbers, and user-scripts are currently installed as extensions?
(I'm using the Linux beta, version: 4.0.249.43, by the way)
Thanks.
Ok, this appears to be a confirmed bug now. (Issue 30760)
Seems the standard #version meta-data is the correct usage, but it has not yet been implemented.
Edit: The #version tag now works in the stable release of Chromium (and, therefore, Chrome).
Or maybe it was never intended to be there, but it is there because extensions have version numbers, and user-scripts are currently installed as extensions?
I think so.
Version number used for updating extensions. User scripts currently can not update. "Update extensions now" button doesn't work for them.
Fixed, but apparently not yet released:
http://code.google.com/p/chromium/issues/detail?id=30760#c16