Skip to content

Commit

Permalink
Remove absolute path parameter from transformers
Browse files Browse the repository at this point in the history
Summary:
Up until now, transformers in Metro received the absolute path of a file, the relative path of a file and the projectRoot.

This diff gets rid of the absolute path sent to the worker, since by having the projectRoot and the relative path, the absolute path can be easily calculated.

This has been done to avoid having absolute paths as transform options, since we need to have custom logic to filter them out from the cache key generation, which is dangerous.

Reviewed By: mjesun

Differential Revision: D9195147

fbshipit-source-id: e95c5c29272eec7f1a48af7cede4c6d6b4a8ffb7
  • Loading branch information
rafeca authored and facebook-github-bot committed Sep 24, 2018
1 parent 4af4da9 commit 2e0d5c8
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ module.exports = {

const {ast} = transformer.transform({
filename: file,
localPath: file,
options: {
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
dev: true,
Expand Down

0 comments on commit 2e0d5c8

Please sign in to comment.