Comments (9)
that's already the case:
https://github.com/WebReflection/event-target/blob/master/esm/index.js#L5-L7
the EventTarget is tested if it can be used as constructor. If not, it's polyfilled.
from event-target.
Sorry, didn't notice. Great to see that
from event-target.
I was blind for that, probably because then I expected it to be separate modules.
At least in CJS world, you may require a ponyfill conditionally as e.g. here
Still that's obviously not doable with ESM
from event-target.
this is a polyfll ... the real use case for polyflls is to be used ... as polyfill, so that you can remove the script without bothering dependencies once the time is right.
All you need to really do here is:
<script src="https://unpkg.com/event-target"></script>
that's it, modules are there only for convenience.
from event-target.
It's one of hundreds of modules to be used by app. Do you recommend listing hundreds of script elements in main HTML file?
Also I tend to not prepare different script/html per each browser. Therefore it's good to have logic that loads polyfill conditionally directly in a code.
from event-target.
Do you recommend listing hundreds of script elements in main HTML file?
I've never used hundreds polyflls, maximum 4 or 5, not a big deal
it's good to have logic that loads polyfill conditionally directly in a code.
your suggestion doesn't make this polyfill conditional
I am really without time for this. This is 100% code covered polyfill for any env. You have options, you can also send PR.
I don't have time for any of these requests, this module is nearly perfect to me already.
from event-target.
I've never used hundreds polyflls, maximum 4 or 5, not a big deal
I want to use it as ponyfil, so as a regular module and not something that's loaded externally with side effect of changing global environment.
from event-target.
there are no side effects here because the global is unusable in any other way
feel free to look elsewhere, I'm closing this conversation.
from event-target.
also:
https://github.com/WebReflection/event-target/blob/master/cjs/index.js#L4-L9
this is a pony fill for CommonJS and ESM
there are no side effects at all
from event-target.
Related Issues (7)
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 event-target.