Externalize EventEmitter3 dependency#688
Conversation
4c8f162 to
25a4b23
Compare
0a20c86 to
74bfef6
Compare
25a4b23 to
a7a08a2
Compare
74bfef6 to
5884325
Compare
|
FYI I'm headed out on vacation for a week but I'm cool with this and the other PR getting merged while I'm gone if they're good to go. |
- Remove browserify/uglify in favor of Vite in library mode. - Replace grunt-jsdoc with an npm script - Replace grunt-eslint with vite-plugin-checker - Replace invocations of `tsc` with vite-plugin-checker - Use dynamic imports for browser/node.js environment differences - Remove various Grunt plugins
a7a08a2 to
69ee2bb
Compare
5884325 to
05dea17
Compare
|
Maybe before we merge this we should add an integration test for a typical pure-frontend workflow that includes the library via a script tag. |
|
I think this PR is working (if I manually look at the bundled output) but I'm having trouble making a unit test verifying that EventEmitter isn't bundled, because the UMD bundle is automagically pulling in |
|
@EzraBrooks Is there maybe a way to check the contents of the bundle as unit test? |
|
I could maybe write a test that opens the JS file as a text file and checks for some text we would know to exist if EventEmitter is present, like |
|
Sounds good to me |
83d052d to
6f52736
Compare
|
looks like this is finally good to go: I added two tests, one to prove that the ROSLIB global exists, and one to verify EventEmitter is not in the bundle, and I'm now able to run the examples locally after adding the EventEmitter3 CDN reference to them |
Public API Changes
Removes EventEmitter3 from the browser bundle. Browser users not using a bundler will need to globally include their own copy of EventEmitter3.
Description
Supersedes #344.
UMD bundle size before removal: 77.51kB.
UMD bundle size after removal: 74.88kB.