-
Notifications
You must be signed in to change notification settings - Fork 102
IE Support #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @ChristianMurphy !! First of all I really appreciate your effort to bring vue web component into IE11. Thanks for that. Did you success to solve this issue? I have notice that the problem of the IE11 Support is that vue web components requires ES2015 classes and IE11 not supporte it. I also notice that the pollyfills that you listed in this issue solve the custom element problem but not bring ES2015 classes into IE11. Kind regards. |
@pablocattaneo I use So @ChristianMurphy comment is definitely valid |
@karol-f @ChristianMurphy Can we get that PR merged soon? We'd love to start using this solution. |
what polyfills are needed to get the web components working on ie9? |
not sure where to put this issue, should i create a new issue here? installed as dev dependencies went to added it as such
went to added as such
add polyfill to page rendering custom component
not transpiling custom-web-component from es6 to es5 get this error in console
this is part of the @vue/custom-web-component dependency. javascript is not being transformed from es6 to es5. any ideas? |
@addijhaq the vue web component wrapper is injected in a seperate webpack from the transpiler. Nota Bene: |
@ChristianMurphy okay so i'm also getting this problem with vue-style-loader where addStyleShadow.js is not being transpiled either. per your
and it fixed the issue, however, this is tedious and will most likely be some kind of issue on a case per case basis dependent upon which vue-* modules are being used to compile the web-component. any reason why this one script is being ignored too? |
Good to know.
Not sure, I haven't run into this. |
@ChristianMurphy what is the order the polyfills should be in the header of the client? |
I've been using <script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/regenerator-runtime/runtime.js"></script>
<script src="https://unpkg.com/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="https://unpkg.com/vue"></script> Or put more generically polyfill the language first, polyfill the platform second, add libraries last. |
@ChristianMurphy
|
@addijhaq you'll need to write code in ES5 or use a transiler (E.G. Babel and Bublé) |
@ChristianMurphy great! added two babel-plugins to my babel.config.js
fixes the es2015 functions and also any template literals using however pulling script into ie11 throws no errors, but also loads nothing :( ... i have security to allow loading of local files as i'm not hosting/serving the .js file i'm using virtualbox to run version of win7 with ie11.... would this be the issue? .. don't have access to a full windows computer. if you do would you mind if i sent you my js to see if it will run? fyi, i'm working for a large enterprise and we desperately need ie9-11 compatibility... i might have to jump ship on the cli and use @karol-f's... but i'm uncertain how to use his properly with nested components/css.. ie9-11 is such a headache... also if it makes any difference i will document how to achieve functionality by updating docs to provide clearer approach to tackling this issue. i'm more than 110% willing to give back and share what i find to help others in this similar situation. |
I'd drop in some
Maybe?
That is a bit outside the scope of this issue, that'd be a good question to ask at https://github.com/karol-f/vue-custom-element |
Has anyone got this to work? |
yes, check #32 |
Closing this out, #32 has been declined. |
Im still having this issue |
@Rahmo I think you can easily assume that this project won't support IE (and I totally understand that). If you want IE support use |
I hope it will help for someone. Build system - webpack without vue cli. list of plugins for transpiling and polyfilling:
babel.config.js
polifills.ts file should be the first entry point
inside webpack js/ts loader exclude all node_modules except
Kind regards. |
Hope this can help others. There is an issue even if you transpile this repo to es5, with slots and shadyDOM, where slots changes does not trigger a Vue render on the wrapped component. This fork addresses those issues: https://github.com/TeliaSweden/vue-web-component-wrapper-ie11
^ See last point above. |
@wbern How would I use your fork in combination with vue-cli, can you give me a pointer on the best way how to implement this? |
I will get back to you tomorrow. We identified a bug with it so it needs to be addressed at the same time. |
Thanks in advance @wbern :) |
https://gist.github.com/wbern/1a85b42bfee4550fdd0011d5b2902de7 I copied the important files from a playground project we made. We basically omitted the wc option in vue cli, then called the wrap() method ourselves instead. The difference is minimal. Also need to enable shadowMode in vue.config.js. |
@wbern Thanks, I‘ll give it a try :) |
@thomasaull I made some enhancements to it.
const CustomElement = wrap(Vue, () => import(`MyComponent.vue`), {
globalStyles: true,
}) tell me what you think. |
There are now babel plugins and polyfills that can run web components on IE.
https://github.com/github/babel-plugin-transform-custom-element-classes
https://github.com/webcomponents/custom-elements
If an IE compatible version is generated and included in the distribution, it would open the door for Vue CLI to support something like modern mode for target web component.
The text was updated successfully, but these errors were encountered: