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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better React Native Web support #2511

Merged
merged 2 commits into from Jun 28, 2017

Conversation

Projects
None yet
3 participants
@mini-eggs
Copy link
Contributor

commented Jun 10, 2017

This PR will be fixing a pain point I've been experiencing in code reuse of React Native projects with Create React App projects. The React Native bundler will allow Android specific code to resolve with a prefixed .android on the default .js/.jsx extension. This PR is allowing that same functionality but with web specific code.

While React Native Web support has been added in in the past, the addition did not follow
https://github.com/necolas/react-native-web/blob/master/docs/guides/getting-started.md exactly, missing the added extensions options to the webpack config.

Something I may have missed in the PR is making any additional changes to the file /create-react-app/packages/react-scripts/scripts/utils/createJestConfig.js. Will there need to be any additional extension resolving here? I'm not too familiar with Jest setups but would be happy to add anything in if I could be pointed in the right direction.

Thanks for looking this PR over, lemme know if there's any problems with the changes here. Excited to contribute. 馃槃

@gaearon

This comment has been minimized.

Copy link
Member

commented Jun 27, 2017

Did you verify if this works with Jest? I'm not sure how to do it there, but at least checking would be great!

@mini-eggs

This comment has been minimized.

Copy link
Contributor Author

commented Jun 28, 2017

@gaearon

Verified this works with Jest (required an additional commit). You can see Jest testing working with the commits made in this PR here.

@gaearon gaearon added this to the 1.0.8 milestone Jun 28, 2017

@gaearon gaearon merged commit 6ab0ec0 into facebook:master Jun 28, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gaearon

This comment has been minimized.

Copy link
Member

commented Jun 28, 2017

Seems fine to me. Thanks!

kellyrmilligan added a commit to kellyrmilligan/create-react-app that referenced this pull request Jun 28, 2017

Merge branch 'master' into serve-app-under
* master: (59 commits)
  Better React Native Web support (facebook#2511)
  Bump dependencies (facebook#2658)
  Minor code style edits to user guide (facebook#2660)
  Don't ask to install webpack for using Styleguidist (facebook#2656)
  Put react-scripts in dependencies, not devDependencies (facebook#2657)
  Razzle added to the alternatives (facebook#2517)
  Warn about large bundle sizes (facebook#2648)
  Add instructions to use source-map-explorer (facebook#1641)
  Ignore "Skipping static resource" message from SW precache (facebook#2645)
  Add React Styleguidist (facebook#2044)
  Update ISSUE_TEMPLATE.md (facebook#2643)
  Add Brackets to launchEditor.js (facebook#2637)
  Updated README (facebook#1931)
  Less passive-aggressive issue template
  Added instruction on how to install Prettier (facebook#2006)
  Fix CLI grammar (facebook#1945)
  Update README.md (facebook#1813)
  Add more info about OOM build failiure [docs] (facebook#2060)
  Update docs with WebSocket proxy information (facebook#2305)
  Add yarn example under "Installing a Dependency" (facebook#2362)
  ...

@gaearon gaearon referenced this pull request Jun 28, 2017

Merged

Changelog for 1.0.8 #2664

@gaearon

This comment has been minimized.

Copy link
Member

commented Jun 28, 2017

@mini-eggs

This comment has been minimized.

Copy link
Contributor Author

commented Jun 28, 2017

Working great! Glad this is in master. Can finally delete my fork. 馃憤

Tested with npm run test, npm run build, and npm start here. Extensions resolving working in all.

zangrafx added a commit to absolvent/create-react-app that referenced this pull request Jun 29, 2017

Merge remote-tracking branch 'upstream/master'
* upstream/master: (55 commits)
  Fix minor typo (facebook#2679)
  Bootstrap with Yarn when available (facebook#2673)
  Add more info about apache client side routing (facebook#2666)
  Test Node 8 on Travis (facebook#2659)
  Add json and css to lint-staged in template README (facebook#2671)
  Add a note about fixed vulnerability in 1.0.8
  Publish
  Changelog for 1.0.8 (facebook#2664)
  Reformat source code with Prettier 1.5.2
  Update Prettier to v1 (facebook#2465)
  Update ISSUE_TEMPLATE.md
  Local testing docker links (facebook#2662)
  Better React Native Web support (facebook#2511)
  Bump dependencies (facebook#2658)
  Minor code style edits to user guide (facebook#2660)
  Don't ask to install webpack for using Styleguidist (facebook#2656)
  Put react-scripts in dependencies, not devDependencies (facebook#2657)
  Razzle added to the alternatives (facebook#2517)
  Warn about large bundle sizes (facebook#2648)
  Add instructions to use source-map-explorer (facebook#1641)
  ...

# Conflicts:
#	packages/react-dev-utils/package.json
#	packages/react-scripts/config/webpack.config.dev.js
#	packages/react-scripts/config/webpack.config.prod.js
#	packages/react-scripts/package.json

romaindso added a commit to romaindso/create-react-app that referenced this pull request Jul 10, 2017

Better React Native Web support (facebook#2511)
* Better React Native Web support

* Adding better react-native-web support for jest testing

@wmonk wmonk referenced this pull request Jul 11, 2017

Closed

Support react-native-web #83

wmonk referenced this pull request in wmonk/create-react-app-typescript Aug 7, 2017

Better React Native Web support (#2511)
* Better React Native Web support

* Adding better react-native-web support for jest testing

morgs32 added a commit to BrickworkSoftware/create-react-app that referenced this pull request Sep 1, 2017

Better React Native Web support (facebook#2511)
* Better React Native Web support

* Adding better react-native-web support for jest testing

@Timer Timer referenced this pull request Oct 5, 2017

Merged

Add `.mjs` support #3239

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can鈥檛 perform that action at this time.