Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

HTML Imports is deprecated and will be removed in M73 #422

Open
BenjaminHoegh opened this issue Apr 29, 2019 · 10 comments
Open

HTML Imports is deprecated and will be removed in M73 #422

BenjaminHoegh opened this issue Apr 29, 2019 · 10 comments

Comments

@BenjaminHoegh
Copy link

[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.

@proton1k
Copy link

@BenjaminHoegh do you have an example how to use ES modules instead of soon deprecated HTML imports with <link rel="import" ... > ?

@hak33m16
Copy link

hak33m16 commented Jul 3, 2019

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.

@codebytere
Copy link
Member

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.

@proton1k
Copy link

proton1k commented Jul 4, 2019

@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.

@baash05
Copy link

baash05 commented Oct 25, 2019

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) );
    }
  });

@Dahkenangnon
Copy link

How about using w3-include-html attribute ? from
https://www.w3schools.com/howto/howto_html_include.asp

@enricovittorini
Copy link

Any update on this issue? Is there a plan?

@audioscavenger
Copy link

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

@saquibshaikh14
Copy link

V>10 doesnot import anything at all.

@gabcvit
Copy link

gabcvit commented Apr 29, 2021

Currently using electron ^12.0.2, the solution from @baash05 still works very well over here.
Thanks a lot 👍🏼

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants