Commit Graph

8 Commits

Author SHA1 Message Date
David Aurelio f12e4ae8a7 Stronger typing for transformers
Reviewed By: jeanlauliac

Differential Revision: D5006679

fbshipit-source-id: 795c60db363fb53bc74697e4befe50995e9b97a7
2017-05-09 08:06:22 -07:00
Kevin Old 5905385997 Properly handle babel ignored files, returning only the contents
Summary:
- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

I have a need to bundle a pre-optimized external lib with my RN application. Until RN 0.42 I had been using a .babelignore to prevent the packager from trying to optimize this file and choke.

It seems in 0.42 and higher I'm no longer allowed to ignore the file.

This issue has also been reported as #12071

Details on the reasoning for this patch can be found in the issue I originally filed: https://github.com/facebook/react-native/issues/13168

What existing problem does the pull request solve?

This PR restores the functionality with babel ignoring files that existed in 0.41 before this patch:

0849f84df2 (diff-4676ea0b3c55c65c3929aa993144f07f)

Here's a screenshot of this patch properly ignoring the file I referenced in https://github.com/facebook/react-native/issues/13168 to be ignored.

![screen shot 2017-04-27 at 12 48 32 am](https://cloud.githubusercontent.com/assets/21967/25469653/524dbc0c-2ae3-11e7-81a6-faca2f4d21fe.png)

The patch relies on the `ignored` value of the call to `babel.transform` and if true returns the src in a object per instruction from loganfsmyth from BabelJS core team.

To test, add a file to the `ignore` array of a `.babelrc` file in a React Native project with this fork.

I was unable to locate a test file for the transformer.js

Fixes #12071, #13168
Closes https://github.com/facebook/react-native/pull/13681

Differential Revision: D5017565

Pulled By: davidaurelio

fbshipit-source-id: 421f57b5ce192eedd46fae4285d8a741cb5f8e71
2017-05-06 05:00:38 -07:00
Karol Kuczmarski 054b5aa4ce Add getCacheKey() to the open source transformer
Reviewed By: davidaurelio

Differential Revision: D4965737

fbshipit-source-id: a343d0cd2e8832567e4e2eed1e2ac0b1657d91a0
2017-04-28 16:55:35 -07:00
Karol Kuczmarski ff3f15b9ad Pass only the first projectRoot to transform options
Reviewed By: davidaurelio

Differential Revision: D4955013

fbshipit-source-id: c07254f54a61ad71bf4cf153c97c8e4149fd4809
2017-04-28 11:06:34 -07:00
Christoph Pojer 77d8cbc68a Fix lint errors 2/2
Reviewed By: jeanlauliac

Differential Revision: D4628330

fbshipit-source-id: 94fad1294e22fa0073e15843f94241ae778112a0
2017-03-01 08:08:55 -08:00
Christoph Pojer 2517d18535 Remove baseTransformer
Reviewed By: jeanlauliac

Differential Revision: D4506124

fbshipit-source-id: 642f06dffe4ea710113e8e8426915bf1b40d4611
2017-02-09 04:06:08 -08:00
Christoph Pojer 09797f281b Remove `react-packager` indirection.
Summary:
This moves the `src` directory one level up and removes the `react-packager` folder. Personally, I always disliked this indirection. I'm reorganizing some things in RNP, so this seems to make sense.

Not sure if I forgot to update any paths. Can anyone advice if there are more places that need change?

Reviewed By: jeanlauliac

Differential Revision: D4487867

fbshipit-source-id: d63f9c79d6238300df9632d2e6a4e6a4196d5ccb
2017-02-02 05:34:12 -08:00
cpojer 3f0b26916e Move 2017-01-26 13:31:04 +00:00