Closed frank-dspeed closed 4 years ago
I have now worked with this a bit and spotted that all tests use individual projects
This is kinda deliberate. If something is testing code splitting, it's ok to use commonjs for browserify but esm for the other tools. If we made it all esm, then you have to add stuff to the browserify example that isn't relevant to the thing being tested. If we make it all commonjs, then you have to add stuff to the Rollup example that isn't relevant to the thing being tested.
I guess at some point we could look at avoid the duplication for cases where it doesn't differ.
@jakearchibald then at last lets reduce to make eacht test as es6 and es5 version and show in the examples what to do with es6 and what to do with es5.
so that each test runs both an es6 version and an es5 version the user will have mixed module formats most time anyway even with browserify.
so not 1 test project for each bundler we go for 2 test projects for every test
I don't think it makes sense to have an es6 version and an es5 version for every test, unless that's what's being tested.
@jakearchibald maybe your right and I overengineer it I tend to such failures. Sorry about that.
I think there's merit in joining the source files together in cases where they are the same, but I'm kinda happy right now that each test is sandboxed. There might be a way to achieve both.
I have now worked with this a bit and spotted that all tests use individual projects. When this would get refactored to use only one version of the project for the test we can reduce maintenance and ease of adding new bundlers and tests.
i found out that there are always es6 tests which use import and es5 node require tests for browserify
so i propose to use this with browserify and then only use the es6 src of the test. It transpils ES6 to ES5 for browserify.
This will allow us to change the structure to /tests/test-name/subtests/sub-name/src /tests/test-name/subtests/sub-name/bundler-name /tests/test-name/subtests/sub-name/other-bundler-name
then all bundlers can use the same src.