-
Notifications
You must be signed in to change notification settings - Fork 98
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
Perform TypeScript type checking while bundle-serving #173
Comments
As this is meant to be a long-running process, it should use tsserver to benefit from caching. This means it will have a substantially different internal architecture than the code in #113. Initial idea is to use a new experimental hook in the metro config: experimentalSerializerHook. It is supposed to be called anytime the graph changes. That's where I'll start. Then I'll move on to seeing how I can output to the metro log console, and how I can fail the bundle generation process. |
Additional use-case to consider: when a metro server is running, it should react to changes in any dependent package in the repo, not just the app package. If it doesn't make that work because we need it. Once Metro is watching all in-repo dependencies, make sure that typescript validation is happening on these dependencies -- specifically, on the source .ts[x] files. |
Made a successful prototype using Metro's |
Another step -- I updated Metro so that calls to https://github.com/afoxman/metro/tree/add-platform-to-serializer-hook Using Verdaccio as a local npm registry, I was able to publish this build (and consumers: react-native, @react-native-community/cli, @rnx-kit) and verify that the entire pipeline is working end-to-end. |
This is related to #113. The difference being that I want typescript validation while running a metro bundle server. As source code is updated, metro detects the changes, transpiles, and publishes delta-bundles through fast-refresh. I want any added/modified files to be transpiled (removed files will be ignored).
The output should show up in the metro bundle-server log console.
Type errors should cause the fast-refresh bundle generation to fail, if possible, leaving the running app unchanged.
The text was updated successfully, but these errors were encountered: