-
Notifications
You must be signed in to change notification settings - Fork 39
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
replace tsc
with swc
for compiling TS source
#2100
Merged
Merged
Conversation
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
Merged
mayank99
requested review from
r100-stack and
Ben-Pusey-Bentley
and removed request for
a team
June 12, 2024 19:40
r100-stack
reviewed
Jun 12, 2024
Ben-Pusey-Bentley
approved these changes
Jun 13, 2024
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.
Looks good. Tested this out with a rudimentary create react app project, and it seems to work. screenshot:
App.js file:
import { Button, ThemeProvider } from '@itwin/itwinui-react';
import './App.css';
function App() {
return (
<ThemeProvider>
<Button>Hello world</Button>
</ThemeProvider>
);
}
export default App;
r100-stack
approved these changes
Jun 13, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Previously, only
tsc
(TypeScript compiler) was being used to compile the.tsx
/.ts
source into.js
and.d.ts
files. This works, but is not very flexible and is super slow.This PR changes the build process so that swc is used for generating the actual code (
.js
), andtsc
is only used for generating types (.d.ts
). This is faster, but more importantly, it allows much greater control over the build output.In this PR, I've used
swc
to strip all code comments (something thattsc
cannot do). In future PRs, I plan to make other changes to the output.While verifying the build output, I also noticed that the
prettier
script (added in #1389) wasn't working, so I fixed it by changing theignore-path
.Testing
Manually verified that the build output looks fine. CI is also passing, which means that dependent workspaces (
react-workshop
/e2e
/a11y
tests and all playgrounds) are happy with the output.Further testing pending (at minimum I would like to test in webpack/CRA).
Docs
Added changesets, since this is a user-facing change.