electron-api-demos
electron-api-demos copied to clipboard
HTML Imports is deprecated and will be removed in M73
[Deprecation] HTML Imports is deprecated and will be removed in M73, around March 2019. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 for more details.
@BenjaminHoegh do you have an example how to use ES modules instead of soon deprecated HTML imports with <link rel="import" ... > ?
Does anyone have a solution to this huge issue? Every single Electron example that utilizes more than a single page is entirely dependent on this functionality. Are we stuck having to learn how to incorporate external UI frameworks into Electron instead? If that's the case, it would be nice if there were at least some examples for it from the Electron devs themselves.
The above is somewhat inaccurate per the link
HTML Imports are deprecated at M70, and will be removed in M80.
We're on M76 in master at present, so consumer apps won't be affected until perhaps ~april 2020 when Electron will likely. with M80.
@codebytere em... actually for me the text by the link you provided says "HTML Imports are deprecated at M70, and will be removed in M75, around Jun 2019. For more info: https://groups.google.com/a/chromium.org/d/msg/blink-dev/h-JwMiPUnuU/sl79aLoLBQAJ"... 🤔 From their group summary:
2018Q2 (done) Reach out Chrome internal users (e.g. WebUI) Analyze log data (UKM etc.) to identify non-polyfilled users 2018Q3 Start showing deprecation message on dev channel (M70) Proactively drive the usage down 2018Q4 Start showing deprecation message on stable channel (M70) Continue driving the usage down 2019Q1 Disable the feature in M73 (branch Jan. 2019) 2019Q2 Feature disabled in stable, start reverse origin trials for remaining users 2020Q1 Stop accepting origin trials 2020Q2 Remove the code from the code base
But it also seems they're delaying the removal so there's a mismatch. But it will break soon anyway.
I just dropped this code into the bottom of my body. I still get the warning, but it does the job..
Array.from(document.getElementsByTagName('link')).forEach(item => {
if(item.rel === 'import'){
fetch(item.href).
then(response => { if(!response.ok) throw Error(response.statusText); return response.text() }).
then(text => {
const div = document.createElement('replaced')
item.parentNode.replaceChild(div, item);
div.innerHTML = text
}).
catch(error => console.log(error) );
}
});
How about using w3-include-html attribute ? from https://www.w3schools.com/howto/howto_html_include.asp
Any update on this issue? Is there a plan?
October 2020, still no reply no plan just a pesky warning from electron-7.2.4 and refusal to import anything when you upgrade to electron-10.1.3 not very serious
V>10 doesnot import anything at all.
Currently using electron ^12.0.2, the solution from @baash05 still works very well over here. Thanks a lot 👍🏼