-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Allow rn-cli.config.js to specify the default transformer #7961
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
Conversation
|
By analyzing the blame information on this pull request, we identified @sam-swarr and @martinbigio to be potential reviewers. |
local-cli/bundle/buildBundle.js
Outdated
| getTransformOptionsModulePath: config.getTransformOptionsModulePath, | ||
| transformModulePath: path.resolve(args.transformer), | ||
| transformModulePath: path.resolve(args.transformer) || | ||
| config.getTransformModulePath(), |
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.
this never gets hit
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.
This is what I get for last minute refactoring.
|
path.resolve(null) crashes -- see the tests |
29fd85d to
7266a5b
Compare
|
@philikon updated the pull request. |
7266a5b to
1939e98
Compare
|
@philikon updated the pull request. |
1 similar comment
|
@philikon updated the pull request. |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to Phabricator to review. |
|
@ide <3 thanks! |
|
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
|
@mkonicek some help please? |
|
Hey folks, can I just get a stack trace or some other hint for why it's failing on the FB side? |
1939e98 to
c44e449
Compare
This will allow consumers to supply their own transformer to all `react-native` cli commands by simply implementing `rn-cli.config.js` and overriding `getTransformModulePath()`. That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a `--transformer` command line argument.
|
@philikon I pinged the RN oncall. For some reason it throws when used from the internal CLI: |
|
Assigning to @foghina so it shows up in the internal diff queue, if you're swamped can you assign it to Andrei who's the next oncall? |
|
@philikon Is it a breaking change? Does the stack trace make sense? Should we fix our internal code to work with this? |
|
Thanks @mkonicek! It shouldn't be a breaking change because I'm providing a fallback in It'd be great if the default config in |
|
@foghina let me know if I can help in any way besides my comment above. Either way, I'll buy you many beers next time I'm in London :) |
|
@philikon I think I fixed it internally. It's landing now, let's see what happens... |
|
<3 <3 <3 @foghina |
Summary: This will allow consumers to supply their own transformer to all `react-native` cli commands by simply implementing `rn-cli.config.js` and overriding `getTransformModulePath()`. That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a `--transformer` command line argument. **Test plan:** Applied this patch to the React Native version in my app, implemented `getTransformModulePath()` in my `rn-cli.config.js`, and verified that my custom transformer is invoked. Closes facebook#7961 Differential Revision: D3404201 Pulled By: foghina fbshipit-source-id: c7eaa85de84d485d06d23a2ffea899821b2cf71c
Summary: This will allow consumers to supply their own transformer to all `react-native` cli commands by simply implementing `rn-cli.config.js` and overriding `getTransformModulePath()`. That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a `--transformer` command line argument. **Test plan:** Applied this patch to the React Native version in my app, implemented `getTransformModulePath()` in my `rn-cli.config.js`, and verified that my custom transformer is invoked. Closes facebook#7961 Differential Revision: D3404201 Pulled By: foghina fbshipit-source-id: c7eaa85de84d485d06d23a2ffea899821b2cf71c
Summary: This is an initial step of rewriting the CLI interface to use `rnpm` one (commander, plugins etc.). It's scope is to move all existing commands to use rnpm CLI interface, so that we get plugins, flags and our existing ecosystem working out of the box. <s>This is still WIP and some of the commands are left commented out.</s> For the `config` of `rnpm` (functions get info about project and dependency), <s>I am thinking we can merge them with</s> we decided to merge it with [`default.config.js`](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e70adb69675786/local-cli/default.config.js#L33), so they are available on the `new Config()` [instance](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e70adb69675786/local-cli/cliEntry.js#L59) (which means we don't have to change anything and current plugins, like runIOS and runAndroid can just start using it [w/o depending on any extra argument](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e Closes #7899 Differential Revision: D3613193 Pulled By: bestander fbshipit-source-id: 09a072f3b21e5239dfcd8da88a205bd28dc5d037
Restores feature introduced in facebook#7961 after it's been paved partially by facebook#7899
Restores feature introduced in facebook#7961 after it's been paved partially by facebook#7899
Summary: Restores feature introduced in #7961 after it's been paved partially by #7899 **Test Plan:** ran example in https://github.com/philikon/ReactNativify against a React Native with and without this patch Closes #9799 Differential Revision: D3852601 Pulled By: mkonicek fbshipit-source-id: fc3c80bdb254145fefa870eea1828b4ef33f9297
Summary: Restores feature introduced in facebook#7961 after it's been paved partially by facebook#7899 **Test Plan:** ran example in https://github.com/philikon/ReactNativify against a React Native with and without this patch Closes facebook#9799 Differential Revision: D3852601 Pulled By: mkonicek fbshipit-source-id: fc3c80bdb254145fefa870eea1828b4ef33f9297
|
@philikon What is the use case of this? Is it something that would be useful for us developing React Native with ClojureScript? (Where the Clojurescript compiler already outputs ES3 compliant code). |
Summary: This will allow consumers to supply their own transformer to all `react-native` cli commands by simply implementing `rn-cli.config.js` and overriding `getTransformModulePath()`. That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a `--transformer` command line argument. **Test plan:** Applied this patch to the React Native version in my app, implemented `getTransformModulePath()` in my `rn-cli.config.js`, and verified that my custom transformer is invoked. Closes facebook/react-native#7961 Differential Revision: D3404201 Pulled By: foghina fbshipit-source-id: c7eaa85de84d485d06d23a2ffea899821b2cf71c
Summary: This will allow consumers to supply their own transformer to all `react-native` cli commands by simply implementing `rn-cli.config.js` and overriding `getTransformModulePath()`. That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a `--transformer` command line argument. **Test plan:** Applied this patch to the React Native version in my app, implemented `getTransformModulePath()` in my `rn-cli.config.js`, and verified that my custom transformer is invoked. Closes facebook/react-native#7961 Differential Revision: D3404201 Pulled By: foghina fbshipit-source-id: c7eaa85de84d485d06d23a2ffea899821b2cf71c
This will allow consumers to supply their own transformer to all
react-nativecli commands by simply implementingrn-cli.config.jsand overridinggetTransformModulePath(). That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a--transformercommand line argument.Test plan: Applied this patch to the React Native version in my app, implemented
getTransformModulePath()in myrn-cli.config.js, and verified that my custom transformer is invoked.