-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: streamline build pipeline (#2325)
Our build pipeline contained some quirks and the remains of previous setups. It was time to clean it up :) The main changes are: **No rollup.** Previously our build pipeline was implemented in rollup. To simplify things up, we now just run a couple of processes in parallel: tsc to build our normal distribution and type declarations, esbuild to build bundles, and a shell script to include assets in the distribution. For development, just `tsc --watch` is enough. **No babel.** Previously our rollup config included babel transpilation with babel-preset-env. That means we included babel-runtime in our distribution, and transpiled async functions into generators with the notorious `regenerator-runtime`. Babel is now excluded from the build process (but still used as a parser for JS files in eslint). Targeting ES2020 in tsc and esbuild should be enough. And we finally have regular async functions in our distribution :) **Esbuild for bundles.** We now use esbuild instead of rollup for creating a CJS bundles. And we no longer create UDM browser bundles. **TS5.** I used this opportunity to bump TypeScript version as well :) Also, removed webpack and postcss dependencies - they were not used at all. 1. Bump prettier, eslint and eslint plugin versions. Will result in *a lot* of warnings, but good for future-proofing. 2. Review our eslintrc, it's currently a bit of a mess. 3. Remove babel completely, use typescript-eslint instead. 4. Switch to `"module": "NodeNext"` in tsconfig. This is the new recommended option for libraries, but will require us to add extensions to all of our import statements, to make them fully qualified. 5. (breaking change) With `"module": "NodeNext"` we will be ready to add `"type": "module"` in our package.json. We can't do that now, because fully specified import statements are expected from module packages. 6. (breaking change) Drop all bundles. CJS bundle is kinda weird anyway. Browser bundle can be replaced by `<script type="module">`. --------- Co-authored-by: Anton Arnautov <[email protected]>
- Loading branch information
1 parent
ed53d67
commit e866edb
Showing
29 changed files
with
8,621 additions
and
10,685 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: E2E | ||
|
||
on: [push] | ||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
e2e: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable no-undef */ | ||
module.exports = { | ||
env: { | ||
production: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.