-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
refactor(theme-classic): migrate to tsc for build #7447
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
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: -332 B (0%) Total Size: 796 kB
ℹ️ View Unchanged
|
Every time we preserve the ESM client module build output, we get a bundle size decrease! 😄 Same as the size decrease in #7437. Previously, we compiled the client modules to CJS as well, because it was really hard to do fine-grained include/exclude back then without project references. It's good to let Webpack take care of everything! |
nice 👍 thanks maybe we could run Prettier on emitted theme files if anyone complains |
We already do run Prettier; the only thing that can't be recovered is empty lines, but absence of empty lines do subtract readability. |
I see Does not look like a big deal We could write a little script that ads |
I think we can enable Gonna defer this to the future; the |
Pre-flight checklist
Motivation
This PR removes the Babel CLI used to build & watch the classic theme. There are three reasons.
paths
option to replace our custom ambient modules declaration. In order to do so, we have to let tsc emit declaration anyways—we can't only use it for type-checking.Performance is a non-issue. Again, we have to run
tsc
anyways for type-checking. Chaining more commands only decreases performance.I've verified that the output of tsc is still human-readable enough (despite missing a few line endings—Babel suffer from the same issue).
This means we no longer have
lib
andlib-next
as two build outputs—everything's in one output folder, just the same as every other package.Test Plan
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs