-
Notifications
You must be signed in to change notification settings - Fork 599
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
Typescript constructor parameter properties is not working. #258
Comments
Hi! Thanks for reporting the issue! Metro does not do anything with TypeScript files: it just relies on the Thanks! |
@rafeca maybe plugin order issue in src/configs/main.js .
|
uhhh, that's interesting... Do you want to send a PR to fix this? This is where the TypeScript plugin is defined: metro/packages/metro-react-native-babel-preset/src/configs/main.js Lines 143 to 148 in 4b4f97f
And the class plugin is defined in: metro/packages/metro-react-native-babel-preset/src/configs/main.js Lines 95 to 97 in 4b4f97f
In order to verify that the behaviour is correct, you can modify the TypeScript file in our end to end tests to include a class. The end to end tests build a bundle and execute it so it should give good signal about whether the solution works fine. |
Summary: <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. --> **Summary** <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> issue #258. metro-react-native-babel-preset don't recognize typescript constructor parameter properties, currently. **Test plan** <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. --> not yet. Pull Request resolved: #262 Reviewed By: mjesun Differential Revision: D10009176 Pulled By: rafeca fbshipit-source-id: 62f6279658464df127033aa322c76f77c9694aed
Closing the issue, the PR got included in v0.48.0 🎉 |
Summary: <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. --> **Summary** <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> issue facebook#258. metro-react-native-babel-preset don't recognize typescript constructor parameter properties, currently. **Test plan** <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. --> not yet. Pull Request resolved: facebook#262 Reviewed By: mjesun Differential Revision: D10009176 Pulled By: rafeca fbshipit-source-id: 62f6279658464df127033aa322c76f77c9694aed
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Currently, don't work typescript constructor parameter properties correctly.
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.repo here
yarn test
change this typescript file to this.What is the expected behavior?
Employee like this
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
metro: 0.45.4
node: v10.10.0
yarn: 1.9.4
macOS: 10.13.6
The text was updated successfully, but these errors were encountered: