Skip to content
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

[standards] Disable Haste in the Jest preset outside of Facebook #24772

Closed
ide opened this issue May 8, 2019 · 1 comment
Closed

[standards] Disable Haste in the Jest preset outside of Facebook #24772

ide opened this issue May 8, 2019 · 1 comment
Labels
p: Expo Partner: Expo Partner Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.

Comments

@ide
Copy link
Contributor

ide commented May 8, 2019

The Jest preset defines Haste options and the Jest setup script currently sets the hasteImpl option. After entirely migrating the open-source version of React Native off of Haste, we can remove these for OSS.

Facebook doesn’t use the Jest config internally so we’ll go ahead and make OSS-only changes to the Jest setup scripts.

@ide ide added the Type: Discussion Long running discussion. label May 8, 2019
facebook-github-bot pushed a commit that referenced this issue May 31, 2019
)

Summary:
This commit more clearly defines the mocks RN sets up and uses paths instead of Haste names to define the mocks. The Jest setup script defined mocks for native modules (Obj-C, Java) and mocks for JS modules in the same data structure. This meant that some non-native modules (that is, JS modules) were in the `mockNativeModules` map -- this commit splits them out and mocks them in typical `jest.mock` fashion.

Additionally, the setup script used to mock the modules using the Haste names. As one of the steps toward migrating to standard path-based imports, the setup script now mocks JS modules using paths (native modules don't need a Haste name nor path since they are just entries in `NativeModules`). This gets us closer to being able to remove `hasteImpl`. (Tracking in #24772.)

Also, this commit removes mocks that are not referenced anywhere in the RN and React repositories (grepped for the names and found no entries outside of the Jest setup scripts).

## Changelog

[General] [Changed] - Explicitly separate mocked native modules from mocked JS modules
Pull Request resolved: #24809

Differential Revision: D15316882

Pulled By: cpojer

fbshipit-source-id: 039e4e320121bea9580196fe0a091b8b1e8b41bf
@ide
Copy link
Contributor Author

ide commented Jun 5, 2019

This is done.

@ide ide closed this as completed Jun 5, 2019
vovkasm pushed a commit to vovkasm/react-native that referenced this issue Aug 7, 2019
…ebook#24809)

Summary:
This commit more clearly defines the mocks RN sets up and uses paths instead of Haste names to define the mocks. The Jest setup script defined mocks for native modules (Obj-C, Java) and mocks for JS modules in the same data structure. This meant that some non-native modules (that is, JS modules) were in the `mockNativeModules` map -- this commit splits them out and mocks them in typical `jest.mock` fashion.

Additionally, the setup script used to mock the modules using the Haste names. As one of the steps toward migrating to standard path-based imports, the setup script now mocks JS modules using paths (native modules don't need a Haste name nor path since they are just entries in `NativeModules`). This gets us closer to being able to remove `hasteImpl`. (Tracking in facebook#24772.)

Also, this commit removes mocks that are not referenced anywhere in the RN and React repositories (grepped for the names and found no entries outside of the Jest setup scripts).

[General] [Changed] - Explicitly separate mocked native modules from mocked JS modules
Pull Request resolved: facebook#24809

Differential Revision: D15316882

Pulled By: cpojer

fbshipit-source-id: 039e4e320121bea9580196fe0a091b8b1e8b41bf
(cherry picked from commit 1ed3525)
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this issue Mar 10, 2020
…ebook#24809)

Summary:
This commit more clearly defines the mocks RN sets up and uses paths instead of Haste names to define the mocks. The Jest setup script defined mocks for native modules (Obj-C, Java) and mocks for JS modules in the same data structure. This meant that some non-native modules (that is, JS modules) were in the `mockNativeModules` map -- this commit splits them out and mocks them in typical `jest.mock` fashion.

Additionally, the setup script used to mock the modules using the Haste names. As one of the steps toward migrating to standard path-based imports, the setup script now mocks JS modules using paths (native modules don't need a Haste name nor path since they are just entries in `NativeModules`). This gets us closer to being able to remove `hasteImpl`. (Tracking in facebook#24772.)

Also, this commit removes mocks that are not referenced anywhere in the RN and React repositories (grepped for the names and found no entries outside of the Jest setup scripts).

## Changelog

[General] [Changed] - Explicitly separate mocked native modules from mocked JS modules
Pull Request resolved: facebook#24809

Differential Revision: D15316882

Pulled By: cpojer

fbshipit-source-id: 039e4e320121bea9580196fe0a091b8b1e8b41bf
@facebook facebook locked as resolved and limited conversation to collaborators Jun 5, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: Expo Partner: Expo Partner Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.
Projects
None yet
Development

No branches or pull requests

3 participants