Comments (10)
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.
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.
yup, agreed
from web-components.
also current @webcomponents cannot be minified with webpack and uglify when es5 adapter is used :-|
webcomponents/custom-elements#100
from web-components.
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.
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
- this is how it looks like from payload size needed to download for polyfills
https://github.com/Hotell/skate-starter/tree/master/src/%40skatejs/web-components
- load polyfills https://github.com/Hotell/skate-starter/blob/master/src/polyfills.ts
- wait for WC to be ready and boot app https://github.com/Hotell/skate-starter/blob/master/src/main.ts#L7
https://github.com/Hotell/skate-starter#bundlepolyfill-sizes
check this out pls @treshugart
from web-components.
@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.
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.
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.
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)
- Implement fix for safari 10 style recalc bug HOT 4
- Something wrong with minification in firefox? HOT 2
- Errors in FF and Safari using UglifyJS HOT 7
- Pull in the browser version of document-register-element
- Spike using all the new webcomponents/* polyfills HOT 1
- upload to a cdn? HOT 5
- jspm install fails HOT 4
- Where is the native-shim.js file in this repo? HOT 2
- Skate + ShadyCSS <custom-style>issue - native ShadowDom Browsers HOT 8
- ShadyCSS doesn't work in IE11 HOT 5
- npm install skatejs-web-components is broken HOT 8
- missing/broken scope on shadydom callbacks HOT 10
- build issue with sed command HOT 3
- update native-shim? HOT 3
- current published version relies on non-existent `cloudydom/src/env` path in newer versions of cloudydom HOT 2
- Safari UA sniffing breaks in mobile chrome HOT 1
- native-shim has to be ES6 HOT 5
- How performant are these polyfills (esp. in IE11)? HOT 11
- Issue with polyfills HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-components.