Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Support react-native-web #83

Closed
wants to merge 1 commit into from
Closed

Support react-native-web #83

wants to merge 1 commit into from

Conversation

TobiasBales
Copy link

@TobiasBales TobiasBales commented Jun 9, 2017

by additionally resolving .web.{ts,tsx,js,jsx} files

React native web adds the low level building blocks of react-native to web applications
Combined with this change you can now use one codebase to build a react-native and web application sharing all/most/a lot of code
since you can now import MyComponent from './MyComponent and have MyComponent.ios.tsx MyComponent.android.tsx and MyComponent.web.tsx

by additionally resolving .web.{ts,tsx,js,jsx} files

React native web adds the low level building blocks of react-native to web applications
Combined with this change you can now use one codebase to build a react-native and web application sharing all/most/a lot of code
since you can now `import MyComponent from './MyComponent' and have `MyComponent.ios.tsx` `MyComponent.android.tsx` and `MyComponent.web.tsx`
@wmonk
Copy link
Owner

wmonk commented Jun 13, 2017

Hey @TobiasBales thanks for this! Just been thinking, and i'm not 100% sure this belong in react-scripts-ts. My reasoning is that if react-scripts doesn't support it then we shouldn't either. As this is a change specifically geared for a single library, then it doesn't make this full agnostic of whatever tech you use on top.

I will have a bit more of a think.

@wmonk wmonk added the question label Jun 13, 2017
@TobiasBales
Copy link
Author

@wmonk that is a good reason.
I think I will see if I can get the changes merged into react-scripts too.
It is "just one library" but at the same time that one library enables you to write one application that runs natively on ios/android and in the browser which I think is a pretty huge deal.

Anyways, I will open a PR for react-scripts and we can see what happens from there on?

@wmonk
Copy link
Owner

wmonk commented Jul 11, 2017

@TobiasBales I think this is now in react-scripts - facebook/create-react-app#2511 is that correct? In that case I will close this and then merge the latest react-script from facebook.

@wmonk wmonk closed this Jul 11, 2017
@TobiasBales
Copy link
Author

But you will need to adjust the extensions webpack resolves in cra-ts too, right?
So we can add .web.ts and .web.tsx or is that somehow magically covered?
Same goes for the jest config

@wmonk
Copy link
Owner

wmonk commented Jul 12, 2017

Oh yes sorry that's what I meant. If you check the latest opened PR I am updating there.

@TobiasBales TobiasBales deleted the support-react-native-web branch July 12, 2017 06:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants