New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Introduce esbuild for project build #209
Conversation
overrides: [ | ||
{ | ||
files: ["*.ts", "*.tsx"], | ||
extends: ["@guardian/eslint-config-typescript"], | ||
rules: { | ||
"@typescript-eslint/unbound-method": 0, | ||
"@typescript-eslint/explicit-module-boundary-types": 0, | ||
"@typescript-eslint/no-unused-vars": 2 | ||
"@typescript-eslint/no-unused-vars": 2, | ||
"react/display-name": 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice to have, but makes it difficult to define private class methods that represent elements, so I've turned it off for now.
in watch mode, does this run tsc watch in parallel with the rebuilds, if not you might want to do that part manually? |
@twrichards IIUC that's the job of > runs in parallel with the main build and does not block module output in watch mode. |
(Incidentally AFAICS pinboard is not using esbuild for the client, but if you were and found a neat solution to |
Closing in favour of an eventual PR to use |
What does this change?
Adds esbuild to the repo, speeding up build startup and watch times considerably.
To ensure typechecking continues, we use
tork-ts-checker-webpack-plugin
, which runs in parallel with the main build and does not block module output in watch mode.Unfortunately, esbuild doesn't support the new jsx runtime yet, which means we need to explicitly import
React
when using jsx. (We were inconsistent before.) I've added a linting rule via thereact/recommended
plugin to ensure this is the case, and fixed a couple of other things that this new linting config spotted, too.How to test
Run
yarn watch
andyarn build
. (Don't forget to runyarn
in the project root beforehand, to install the new dependencies!) The build should work as before, and the tests should pass.Both operations should be noticeably faster.
How can we measure success?
Faster watch and build operations.