Closed JoelEinbinder closed 4 years ago
Metro support, or at least good way to plug in any bundler, would be nice
Metro support, or at least good way to plug in any bundler, would be nice
I hadn't heard of metro. Looking into it, it looks like it is for react-native. Do you want to run your react-native tests in a browser? I would expect people would run a separate jest project with their react-native tests alongside their playwright tests.
I got a proof-of-concept of this working. The performance story is not good, but I hope that can be fixed with some intelligent caching. Otherwise it works well enough to make this the main behavior. I think I can drop the current hacks around dynamically resolving and redirecting modules.
At Airbnb, we ran into scaling issues with webpack so we've been switching to metro for bundling on web.
Interesting! I’ll look into it.
I got a proof-of-concept of this working. The performance story is not good, but I hope that can be fixed with some intelligent caching. Otherwise it works well enough to make this the main behavior. I think I can drop the current hacks around dynamically resolving and redirecting modules.
I'd be interested in taking a look at the proof of concept.
Modern web dev has a lot of code generated at build time. Instead of trying to parse every combination of commonjs/typescript/scss, people should be able to pass us their webpack config which we will use to compile their unit tests.
Overriding the entry points to contain the test files to be run should provide some native web code we can run.
It would be nice to reuse/cache some shared modules. I'm worried about the performance penalty of compiling a new copy of react into every test file. Maybe webpack already will do this for us?
As a follow up, we can do the same for rollup/browserify/whatever people use.