-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Move metro-config package into monorepo build, enable TS generation #41836
Move metro-config package into monorepo build, enable TS generation #41836
Conversation
7033c9f
to
1907ea8
Compare
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.
Great! I reckoned Expo was providing its own default config package — but perfectly happy to add TypeScript ergonomics :).
I'm just going to make sure this runs in RNTester — believe we may need to add the wrapping .js
/.flow.js
pattern to have run-from-source behaviour in this repo / internally at Meta.
We are! But, there are fixes inside this React Native config that aren't backported inside the We keep this "semi-fork" of the default config in |
Also, I think the |
Base commit: a8ca9b0 |
1907ea8
to
f6c8fd4
Compare
@react-native/metro-config
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.
Thanks!
@huntie has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Ah, just spotted this question. The reasoning here is that only
|
@@ -4,13 +4,14 @@ | |||
* This source code is licensed under the MIT license found in the | |||
* LICENSE file in the root directory of this source tree. | |||
* | |||
* @flow | |||
* @noformat | |||
* @flow strict-local |
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.
Ah my bad, let's loosen this to @flow
so that CI passes.
Summary:
This adds
@react-native/metro-config
to the monorepo build tool and emits the missing typescript declarations.Right now, we do have typescript declarations on
metro-config
, but not@react-native/metro-config
. Which makes everything a bit harder extend from "the default React Native metro config" in Expo.One open question here is, why aren't we exporting all helper functions from
metro-config
? To me, its a bit weird that we need bothmetro-config
and@react-native/metro-config
asloadConfig
isn't exported.Changelog:
[INTERNAL] [FIXED] - Emit typescript declaration files for
@react-native/metro-config
Test Plan:
Run the build tool, and check if the typescript declarations are emitted for
@react-native/metro-config
.