Skip to content

Conversation

@johanneslumpe
Copy link
Contributor

With this new options users can specify their own transformer file.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels May 30, 2015
@ide ide added the packager label May 30, 2015
@ide
Copy link
Contributor

ide commented May 30, 2015

cc @amasad. did you want .babelrc though?

@johanneslumpe
Copy link
Contributor Author

@ide I thought this might be interesting in addition to .babelrc - in case someone wants to use a different transpiler or do other stuff during transpilation (who knows?)

@ide
Copy link
Contributor

ide commented May 30, 2015

That makes sense. Maybe let the path be relative to cwd?

@johanneslumpe
Copy link
Contributor Author

Yeah that would be possible. I didn't do that yet because I wanted to keep the default value from the options. If we make the path relative to the cwd and the user would use ./transformer as path, then that would be the same as the default, even though the user would want to use their own file. I guess the default path would then have to be relative to cwd too, so that we can use the same codepath. So instead of ./transformer.js the default would be ./node_modules/react-native/packager/transformer.js. Does that make sense to anybody else than me?

@brentvatne brentvatne changed the title Allow user to specify a custom transformer file [Packager] Allow user to specify a custom transformer file May 30, 2015
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just add the require.resolve('./transformer') here

@amasad
Copy link
Contributor

amasad commented Jun 2, 2015

@ide looks like we get .babelrc for free (thanks @sebmck!)
@johanneslumpe: this looks good, but as @ide mentioned let's make sure this does what the user expects it to do. I left inline comments.

@johanneslumpe
Copy link
Contributor Author

@amasad Your suggestion did not quite work as it didn't allow the user to use a cwd-relative path after all. I've added a check now whether we are being given an absolute path as option. That works quite well. Unfortunately I deleted my fork, while cleaning up my account... I tried to restore everything to be able to push to this branch again, but it didn't work properly. That's why I had to open up a new PR over at #1497. Sorry for the mess :/

/cc @ide @amasad

@amasad amasad closed this Jun 3, 2015
a2 pushed a commit to a2/react-native that referenced this pull request Jul 1, 2015
Summary:
This is an edited re-submission of facebook#1458 because I'm stupid.
Closes facebook#1497
Github Author: Johannes Lumpe <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants