-
Notifications
You must be signed in to change notification settings - Fork 69
Description
This is an umbrella task for all things related to reducing task times in modular projects.
As modular projects grow (as they should), because we do centralised tasks for build/start/test/etc, we will hit bottlenecks in being able to develop and deploy quickly. While this shouldn't affect daily development per se, it'll start affecting productivity as a whole. Some examples:
- a one line change in one package, could take a very long time to get to production because it's triggered a whole test/build cycle in CI/whatever build infrastructure you're using.
- a simple bugfix will have a very long turnaround time to get to production.
- local development will run only some tests, but in CI it might take a very long time to run all tests, meaning a developer will have to wait for a long time to verify whether their code has broken anything.
modular start
might take a long time to warm up, which isn't nice.- and so on.
(note: We should make a comprehensive list of pain points; the solutions won't be super general, so we should make sure we've looked at every possible pain point.)
(note: this issue is not about runtime performance of react applications, though we should probably make an umbrella task for that too)
Possible solutions and strategies:
-
caching third party dependencies, so it doesn't have to be pulled down on every build (existing work: https://circleci.com/docs/2.0/caching/, https://github.com/actions/cache)
-
webpack 5's module federation for builds https://webpack.js.org/concepts/module-federation/ We can split the build into pieces (and stitch them up manually, if at all) with this feature; it'll be key that we do this automatically, and without exposing the internals to consumers, or else it'll be hell to unwind later. Things to consider: deduplicating dependencies, verifying module graphs, etc.
-
webpack 5's persistent caching https://github.com/webpack/changelog-v5/blob/master/guides/persistent-caching.md Again, it'll be key to do this without exposing any internals to the user.
-
configure jest to only run affected tests on builds (https://jestjs.io/docs/en/cli#--changedsince, https://jestjs.io/docs/en/cli#--findrelatedtests-spaceseparatedlistofsourcefiles) A thing to note here is that we should be able to generate complete coverage reports even if we only run a few of them during. (another precedent in java land - https://github.com/jpmorganchase/sandboni-core)
-
Use feature flags for rapid release cycles: we should be able to build and ship features rapidly, and be able to turn them on/off as we desire. (https://martinfowler.com/articles/feature-toggles.html, and my own writeup https://gist.github.com/threepointone/2c2fae0622681284410ec9edcc6acf9e)
-
lint/prettier only on changed files (copy react's yarn linc, basically): In the modular repo, we've setup linting only for changed files when we do commits, but not as a standalone command. We can copy react's linc command. We should also ship the commit behaviour and commands in generated repositories.
-
Incremental builds: This is fairly nascent in production world for the javascript ecosystem; usually because solutions are tightly bound to serving infrastructure and so on. 'Big' companies like fb/google have in-house solutions for the same. There's an opportunity here to start work on a project that's designed for things like from the start. (I hear whispers of parcel 2 also working on similar goals)
Please feel free to add more to this list in the replies, and/or feedback. I'll keep updating this list based on so. If you'd like to start work on any of these, please file a separate issue and link it back here.