Giter VIP home page Giter VIP logo

Comments (10)

Hotell avatar Hotell commented on May 25, 2024 1

Don't get confused, that's just webpack, which uses nowadays import() for lazy loading, but since Typescript doesn't support import as function I have to stick with System.import alias.

from web-components.

treshugart avatar treshugart commented on May 25, 2024

I'm happy to have a breaking change here if it makes sense. Would be good to just import '@skatejs/web-components'; if it's easier. No imperative code then.

from web-components.

Hotell avatar Hotell commented on May 25, 2024

yup, agreed

from web-components.

Hotell avatar Hotell commented on May 25, 2024

also current @webcomponents cannot be minified with webpack and uglify when es5 adapter is used :-|

webcomponents/custom-elements#100

from web-components.

Hotell avatar Hotell commented on May 25, 2024

I'm happy to have a breaking change here if it makes sense. Would be good to just import '@skatejs/web-components'; if it's easier. No imperative code then.

so I didn't read your comment right :D there has to be imperative code if you wanna lazy load polyfills only in browsers which need them, as you can see in my example/PR

from web-components.

Hotell avatar Hotell commented on May 25, 2024

so final solution is implemented here:

  • complete data payload savings in worst case scenario ( IE 11 ) -> 35 kb in comparison with "official" wc lazy loader from google

https://github.com/Hotell/skate-starter#bundlepolyfill-sizes

check this out pls @treshugart

from web-components.

charandas avatar charandas commented on May 25, 2024

@Hotell curious where SystemJS comes from for https://github.com/Hotell/skate-starter/blob/master/src/main.ts#L7, looked in package.json but couldn't find it.

from web-components.

treshugart avatar treshugart commented on May 25, 2024

Typescript doesn't support import as function

That's quite unfortunate because that's where it seems specs are moving. Is there a way that we can leverage import and still have consumers use TypeScript?

from web-components.

treshugart avatar treshugart commented on May 25, 2024

I generally don't do default exports but I think it would be nice here because then it's a little bit simpler for the consumer and they can call it whatever they want.

import fills from '@skatejs/web-components';
import app from './app';

fills().then(app);

I like this idea. It's unfortunate that it has to be imperative, but I don't see any way around it, either. Thanks for working on this! :)

from web-components.

deini avatar deini commented on May 25, 2024

Sorry to revive this but damn just found this, and looks 💯.

Since this project is now marked as deprecated do you guys have any suggestions of how to sanely use @webcomponents's polyfills with webpack?

from web-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.