Skip to content

React Native needs to be treated like a node environment - #8982

Closed
brandonlehmann wants to merge 1 commit into
emscripten-core:masterfrom
brandonlehmann:patch-1
Closed

React Native needs to be treated like a node environment#8982
brandonlehmann wants to merge 1 commit into
emscripten-core:masterfrom
brandonlehmann:patch-1

Conversation

@brandonlehmann

Copy link
Copy Markdown

We consistently see issues whereby React Native is not detected properly and thus generated JS does not load. React Native needs to be treated as if it is Node for modules to initialize correctly.

@kripken

kripken commented Jul 17, 2019

Copy link
Copy Markdown
Member

Thanks @brandonlehmann!

I think this can use the ENVIRONMENT_HAS_NODE feature from line 76 a little above? @ericmandel added that and may have more thoughts.

Also @brandonlehmann please add yourself to AUTHORS.

@ericmandel

Copy link
Copy Markdown
Contributor

@brandonlehmann @kripken I'm not very familiar with React Native, but if it is meant to be treated as a full-up Node environment, then ENVIRONMENT_IS_NODE is indeed wanted, not ENVIRONMENT_HAS_NODE, which is used, for example, by Web environments like Electron.js that can have Node integrated into it.

But ... while resetting ENVIRONMENT_IS_NODE, you might need to set ENVIRONMENT_HAS_NODE as well, since the former is used explicitly in some checks ... unless React Native has already passed the ENVIRONMENT_HAS_NODE check at line 76?

@jkbbwr

jkbbwr commented Jul 22, 2019

Copy link
Copy Markdown

Side note, unless React Native has changed the bundler they are using (Metro last time I checked) It does static analysis and freaks out if modules like fs are required even if that is dead code.

@sbc100 sbc100 closed this Jan 30, 2020
@sbc100

sbc100 commented Jan 30, 2020

Copy link
Copy Markdown
Collaborator

The deletion of the incoming branch triggered the automatic closing of this branch. My apologies. This was an unexpected side effect.

Re-opening and re-targeting to master.

@sbc100 sbc100 reopened this Jan 30, 2020
@sbc100
sbc100 changed the base branch from incoming to master January 30, 2020 20:46
@stale

stale Bot commented Jan 30, 2021

Copy link
Copy Markdown

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale Bot added the wontfix label Jan 30, 2021
@brandonlehmann
brandonlehmann deleted the patch-1 branch January 30, 2021 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants