Closed mayank99 closed 1 year ago
yarn dev
crashes if code has type errors.
I think that is the unfortunate side effect of running tsc
without --watch
. To avoid this problem I have removed yarn build:types
.
Have you compared swc to esbuild? Seems at least swc core has stable v1 version. It also uses chokidar for watching files and I think then it would recompile only the file changed rather than everything, which might be useful in this case. Of course, the only issue is with type files...
Have you compared swc to esbuild? Seems at least swc core has stable v1 version. It also uses chokidar for watching files and I think then it would recompile only the file changed rather than everything, which might be useful in this case.
I did try manually with chokidar
but it was a lot of code and still not working perfectly.
Just tried with swc
and it seems to work great! Thanks for the suggestion.
https://user-images.githubusercontent.com/9084735/206235754-73472202-9450-48cb-9125-48669892ad9c.mov
Of course, the only issue is with type files...
I will use tsc
to generate types only. I think that should be fine.
Have you compared swc to esbuild? Seems at least swc core has stable v1 version. It also uses chokidar for watching files and I think then it would recompile only the file changed rather than everything, which might be useful in this case.
I did try manually with
chokidar
but it was a lot of code and still not working perfectly.Just tried with
swc
and it seems to work great! Thanks for the suggestion.Untitled.mov
Of course, the only issue is with type files...
I will use
tsc
to generate types only. I think that should be fine.
Nice!! I am jealous now, cause I could not figure out why Vite app is refreshing the page even though it sees that only single file from the dependency has changed (writes in console hmr, not page reload like in other cases).
This is the second of my three proposed monorepo improvements (first one being #951, third one being storybook improvements).
Previously: Every
dev
script was bottlenecked byyarn build
in itwinui-react, which takes ~10 seconds becausetsc
is slow.Now:
yarn dev
no longer requiresyarn build
in itwinui-react (it has been removed inturbo.json
). Runningyarn dev
does two things:swc
in watch mode to transpile TS source to JS.tsc
compiler in watch mode to generate types only.This means most of our dev servers start instantly and are usable without waiting for
tsc
. Storybook still takes over a minute to start (because it uses webpack) and it is the only noticeably slow part of our DX. But the hot refresh is still instant.