slorber / gatsby-plugin-react-native-web

react-native-web plugin for Gatsby
https://sebastienlorber.com/using-expo-in-gatsby
MIT License
276 stars 30 forks source link

Added unimodule support #14

Closed EvanBacon closed 4 years ago

EvanBacon commented 4 years ago
slorber commented 4 years ago

Thanks a lot for this PR :)

This project does not get enough of my time to be sustainable currently, so it's really great you work on it.

I've added you as a contributor on github and npm, totally trust you to do the right thing ;) For demos if you want we could create a separate netlify account, currently it's on my personal account

Will probably try to make some blog post soon using it, as I want to embed RNW/Expo demos inside MDX in some blog posts I'm going to write.

The PR looks nice. If you're confident feel free to merge and publish.

Not sure to understand why to remove uikittens, they have claimed support for RNW since 4.1 according to https://github.com/akveo/react-native-ui-kitten/issues/44#issuecomment-520350001

EvanBacon commented 4 years ago

I'll work on adding UI Kittens back without shimming to Android

slorber commented 4 years ago

Removed kittens support - I think we shouldn't resolve .android.ts files in web.

Ah yeah, remember something like that in UIKittens, like it was using android as a fallback platform or something. I guess they fixed it?

About the readme, if you want to rewrite it full don't hesitate, or I'll do it. The screenshot is outdated, and I think most people are on Gatsby 2 now anyway.

Can't wait to put some Expo code into a MDX blog post :D

EvanBacon commented 4 years ago

Ok, this should be good to merge now on my side.

rickiesmooth commented 4 years ago

tested this and it works great, thank you!

slorber commented 4 years ago

great!

@EvanBacon you should have permission to merge yourself and publish if you think you are done. Tell me if it's not the case.

The PR looks good to me

slorber commented 4 years ago

Thanks @EvanBacon

Unless you want to change something or merge/publish yourself, I'm going to merge/publish it this week, and try to write a blog post as well to thank you and also on why you might want to consider using Gatsby for RNW in the first place (as I think people might not figure this out themselves)

EvanBacon commented 4 years ago

@slorber sorry I was out of town. I don't have write access to this repo so I get:

This branch has no conflicts with the base branch
Only those with write access to this repository can merge pull requests.
slorber commented 4 years ago

np, nice talk btw ;)

I've sent you an invite but I think you didn't accept it You'll likely find it here: https://github.com/slorber/gatsby-plugin-react-native-web/invitations

slorber commented 4 years ago

Great. Will write a blog post this weekend (including some expo in MDX) Thanks

slorber commented 4 years ago

Hi @EvanBacon

I've tried to see why the UIKits example didn't build on Netlify and it seems I can't either build it locally.

For weird reasons, I get transpilation errors. It works with yarn start, but it fails with yarn build. Were you successful running yarn build on this example UIKit?

I get errors such as:

image

The Netlify log is: https://gist.github.com/slorber/444338633cd7e0eb9105423436099063

Any idea what could be the reason? Didn't look yet into the webpack plugin but maybe its config is not suited for node SSR? Don't really understand why but any idea what could be the reason some files transpile correctly with yarn start and not yarn build?

Noticed a new "babel.config.js" at the root, is this actually used?

slorber commented 4 years ago

Hi @EvanBacon I'm still trying to investigate the issues but not sure what's happening.

It looks like in dev mode Gatsby is able to transpile the node modules libraries, while it's not in prod mode (the input webpack config is not the same in dev/prod).

gatsby build works for regular RNW, but as soon as I add a lib (like ui kittens or paper) it stops working

here's the before/after webpack config https://gist.github.com/slorber/5a34f2b85f13d87c19a2691a7060e5af

will try to compare it to the dev config soon, but if you have any idea what's going on i'd be interested to know ;)