-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fix #17610, Add fixtures to metro blacklist #17672
Conversation
Generated by 🚫 dangerJS |
local-cli/util/Config.js
Outdated
@@ -19,6 +19,8 @@ const path = require('path'); | |||
|
|||
const {Config: MetroConfig} = require('metro'); | |||
|
|||
const blacklist = require('metro/src/blacklist') |
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.
semi: Missing semicolon.
local-cli/util/Config.js
Outdated
@@ -56,6 +58,10 @@ const getProjectRoots = () => { | |||
return resolveSymlinksForRoots([getProjectPath()]); | |||
}; | |||
|
|||
const getBlacklistRE = () => { | |||
return blacklist([/.*\/__fixtures__\/.*/]) |
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.
semi: Missing semicolon.
2f6a461
to
2586bd9
Compare
@@ -56,6 +58,10 @@ const getProjectRoots = () => { | |||
return resolveSymlinksForRoots([getProjectPath()]); | |||
}; | |||
|
|||
const getBlacklistRE = () => { |
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.
semi: Missing semicolon.
@@ -56,6 +58,10 @@ const getProjectRoots = () => { | |||
return resolveSymlinksForRoots([getProjectPath()]); | |||
}; | |||
|
|||
const getBlacklistRE = () => { |
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.
prettier/prettier: Insert ;
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.
fixed!
@@ -56,6 +58,10 @@ const getProjectRoots = () => { | |||
return resolveSymlinksForRoots([getProjectPath()]); | |||
}; | |||
|
|||
const getBlacklistRE = () => { |
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.
semi: Missing semicolon.
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.
fixed
2586bd9
to
c7d09b6
Compare
local-cli/util/Config.js
Outdated
@@ -19,6 +19,8 @@ const path = require('path'); | |||
|
|||
const {Config: MetroConfig} = require('metro'); | |||
|
|||
const blacklist = require('metro/src/blacklist'); |
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.
metro/src/blacklist Required module not found
@t4deu Thank you for solution. One question, will it correctly work with custom |
Hi @vovkasm, yes it works well, react already handles the default and custom settings merging 😃 |
cc @rafeca |
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.
Nice work
Please merge it asap, it breaks react-native-vector-icons |
C:\Users\Admin\Desktop\Rawster>react-native run-android SyntaxError: C:/Users/Admin/Desktop/Rawster/node_modules/react-native/local-cli/util/Config.js: Unexpected token (132:0)
I get this error while trying this method |
@tiresomefanatic you shoud look in #17610 comments for the temporary fix |
c7d09b6
to
d2ae4bb
Compare
Include a default blacklist in the build settings to prevent processing of incorrect fixture files by Metro.
d2ae4bb
to
e9f7883
Compare
Just rebased, please @hramos is there anything that need to be done so it can be merged? |
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.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Include a default blacklist into the build settings to prevent processing of incorrect fixture files by Metro. <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Fix facebook#17610 issue, preventing metro from processing fixture files 1. Have a working demo 2. Install https://github.com/oblador/react-native-vector-icons 3. Use in a component 4. Start the app 5. The app starts successfully and display the icons [ GENERAL ] [ BUGFIX ] [local-cli/util/Config.js] - Add default file blacklist Closes facebook#17672 Differential Revision: D7014627 Pulled By: hramos fbshipit-source-id: 20974e6fdd0977eeeb1048c29c9d621c803c26e9
No, pretty sure this will not get merged. I'm looking for a more long-term solution to prevent that problem. EDIT: though we could change the logic to merge regexes. But I think not publishing This task is related to facebook/metro#139 I think. |
Summary: Include a default blacklist into the build settings to prevent processing of incorrect fixture files by Metro. <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Fix #17610 issue, preventing metro from processing fixture files 1. Have a working demo 2. Install https://github.com/oblador/react-native-vector-icons 3. Use in a component 4. Start the app 5. The app starts successfully and display the icons [ GENERAL ] [ BUGFIX ] [local-cli/util/Config.js] - Add default file blacklist Closes #17672 Differential Revision: D7014627 Pulled By: hramos fbshipit-source-id: 20974e6fdd0977eeeb1048c29c9d621c803c26e9
Summary: Include a default blacklist into the build settings to prevent processing of incorrect fixture files by Metro. <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Fix #17610 issue, preventing metro from processing fixture files 1. Have a working demo 2. Install https://github.com/oblador/react-native-vector-icons 3. Use in a component 4. Start the app 5. The app starts successfully and display the icons [ GENERAL ] [ BUGFIX ] [local-cli/util/Config.js] - Add default file blacklist Closes #17672 Differential Revision: D7014627 Pulled By: hramos fbshipit-source-id: 20974e6fdd0977eeeb1048c29c9d621c803c26e9
Summary: This try to address #17672 and facebook/metro#139. We should probably not include these folders in the released version of React Native, as they are used only for testing—am I incorrect? cc MoOx, t4deu. I ran: ``` npm pack tar -t -f react-native-1000.0.0.tgz | less ``` Then verified that `__fixture__` was not part of the package. #17672 [GENERAL] [BUGFIX] [.npmignore] - Do not publish test-specific files Closes #18019 Differential Revision: D7098211 Pulled By: jeanlauliac fbshipit-source-id: 0748ad8c064450bd2a9f4d6f49675a7f74fb300f
Summary: Include a default blacklist into the build settings to prevent processing of incorrect fixture files by Metro. <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Fix facebook#17610 issue, preventing metro from processing fixture files 1. Have a working demo 2. Install https://github.com/oblador/react-native-vector-icons 3. Use in a component 4. Start the app 5. The app starts successfully and display the icons [ GENERAL ] [ BUGFIX ] [local-cli/util/Config.js] - Add default file blacklist Closes facebook#17672 Differential Revision: D7014627 Pulled By: hramos fbshipit-source-id: 20974e6fdd0977eeeb1048c29c9d621c803c26e9
Summary: Include a default blacklist into the build settings to prevent processing of incorrect fixture files by Metro. <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Fix #17610 issue, preventing metro from processing fixture files 1. Have a working demo 2. Install https://github.com/oblador/react-native-vector-icons 3. Use in a component 4. Start the app 5. The app starts successfully and display the icons [ GENERAL ] [ BUGFIX ] [local-cli/util/Config.js] - Add default file blacklist Closes facebook/react-native#17672 Differential Revision: D7014627 Pulled By: hramos fbshipit-source-id: 20974e6fdd0977eeeb1048c29c9d621c803c26e9
Summary: This try to address #17672 and facebook/metro#139. We should probably not include these folders in the released version of React Native, as they are used only for testing—am I incorrect? cc MoOx, t4deu. I ran: ``` npm pack tar -t -f react-native-1000.0.0.tgz | less ``` Then verified that `__fixture__` was not part of the package. facebook/react-native#17672 [GENERAL] [BUGFIX] [.npmignore] - Do not publish test-specific files Closes facebook/react-native#18019 Differential Revision: D7098211 Pulled By: jeanlauliac fbshipit-source-id: 0748ad8c064450bd2a9f4d6f49675a7f74fb300f
Include a default blacklist into the build settings to prevent
processing of incorrect fixture files by Metro.
Motivation
Fix #17610 issue, preventing metro from processing fixture files
Test Plan
Related PRs
Release Notes
[ GENERAL ] [ BUGFIX ] [local-cli/util/Config.js] - Add default file blacklist