Comments (10)
I would not publish custom elements as ES5. Since custom elements extend HTMLElement and must do a proper super()
constructor call, they can't actually easily be compiled to ES5 class patterns. If you do, you'll need to include something like the custom-elements-es5-adapter from the web components polyfills, which can slow down all custom elements on the page.
It's much better to let consumers compile to old JS if they need to for their browser support requirements.
from lite-youtube-embed.
could this not be handled by babel if required?
from lite-youtube-embed.
It could, yeah, but we shouldn't make things more complex :)
I mean, if we can do without babel, it'd be better.
from lite-youtube-embed.
it's been a while since i've published web-facing JS... are there any tools I can use to validate my npm package is es5-compliant?
from lite-youtube-embed.
There was an ESLint plugin, but I didn't have the best experience when I used it a long time ago. So maybe now it's been improved https://www.npmjs.com/package/stylelint-no-unsupported-browser-features
That being said, since the code isn't much, I can help if you need me. The .browserslistrc approach is the safest one, though, so that we have autoprefixer also if needed later. Although, from a quick look, the CSS is quite simple, so maybe only the JS part needs some love :)
from lite-youtube-embed.
Err, I meant https://github.com/amilajack/eslint-plugin-compat
from lite-youtube-embed.
Actually, scratch that. I don't think ES5 is needed https://caniuse.com/#feat=custom-elementsv1, right?
In that case, maybe there should be some feature checking?
from lite-youtube-embed.
Yea, ES6 is required to properly publish Web Components. Distributing something older hinders the integration and performance.
Why did you initially request ES5 compatibility? What was the driving context that deemed ES5 a necessity?
from lite-youtube-embed.
I hadn't actually read the code :)
from lite-youtube-embed.
it's been a while since i've published web-facing JS
Welcome back @paulirish 😄
from lite-youtube-embed.
Related Issues (20)
- Types: Property 'ready' does not exist on type 'typeof YT'. HOT 1
- Failed to execute 'postMessage' HOT 2
- Type declarations
- On mobile, double click is neccesary HOT 8
- Display a title on the video thumbnail HOT 2
- Graceful degradation if YT API breaks
- NPM version is outdated HOT 1
- Custom Width and Height for Youtube shorts HOT 6
- Will it be counted as views on YouTube? HOT 2
- sometime no image loaded HOT 1
- does not work on mobile HOT 2
- Early click on Progressively Enhanced version directs user to youtube.com HOT 1
- A11Y: Why `a.lty-playbtn` instead of `button`? HOT 2
- Start and end params not working when using js-api
- I am using lite youtube embed and I want to get onStateChange player.getPlayerState():
- How can we keep the lower quality preview?
- Could we get a more noob friendly guide for Pro-usage? 😇
- Deprecated navigator.vendor HOT 1
- v0.3.2 Release HOT 1
- Yield on LiteYTEmbed click listener to reduce INP impact HOT 3
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 lite-youtube-embed.