-
Notifications
You must be signed in to change notification settings - Fork 273
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
Refactor to use ES Modules + Rollup (CJS, ESM, UMD) + Babel + ESLint/Prettier #118
base: master
Are you sure you want to change the base?
Conversation
…Prettier and ditch Grunt/Closure Compiler
Nice freaking work, dude! Saving my life right now, since my project compiles with webpack and rollup. Of course it was freaking out about the commonjs export. |
It would be wonderful if this was published as es modules. |
* 'master' of https://github.com/bramstein/fontfaceobserver: 2.1.0 Add dist files. Fix calling phantomjs. Upgrade Grunt and Mocha. Reject promises with Error objects Adds an example of dynamically creating observers, closes bramstein#121 # Conflicts: # Gruntfile.js # fontfaceobserver.js # fontfaceobserver.standalone.js # package-lock.json # package.json # src/observer.js # test/observer-test.js
Updated with latest commits and fixes: https://unpkg.com/[email protected]/dist/fontfaceobserver.esm.js Fixed all the tests Available to test from at: |
thanks! |
Can I help anyway to make this PR merged? I think this is very important, Currently many projects use webpack or rollup, and having this library not being tree shakable is a big down for those. In our case, we detected that our bundle size incremented > 40% due to just use this library, and we are investigating to move away from it for this very reason. |
Thanks for the package |
Love to see this merged, please? |
This change adds `fontobserver-es` npm module monitor when a webfont is loaded and notify. Please note that it is different from `fontfaceobserver` module, we choose `fontobserver-es` because it's an es module. ref: - bramstein/fontfaceobserver#118 - https://github.com/dmnsgn/fontfaceobserver
This change adds `fontobserver-es` npm module monitor when a webfont is loaded and notify. Please note that it is different from `fontfaceobserver` module, we choose `fontobserver-es` because it's an es module. ref: - bramstein/fontfaceobserver#118 - https://github.com/dmnsgn/fontfaceobserver
I can also confirm fontfaceobserver-es works when using the following import: |
This is a big one: it includes a lot of changes and some stylistic ones so I'd understand if you don't like some of them and you might also not have the time to review it but I figured I tried. Also I have seen you were interested in switching to ES modules (#102) so here it is:
All tests are the same and passing in Node 4 to 8: https://travis-ci.org/dmnsgn/fontfaceobserver
You can see the output bundles keep a small size gzipped:
I published it on npm to have a play: https://www.npmjs.com/package/fontfaceobserver-es
Thanks