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

[Suggestion] Consider using react-native-web #51

Open
immortalx opened this issue Feb 1, 2019 · 11 comments
Open

[Suggestion] Consider using react-native-web #51

immortalx opened this issue Feb 1, 2019 · 11 comments

Comments

@immortalx
Copy link

I believe its a good fit for the project and react-native-web would benefit from the production ready example.

@Urigo
Copy link
Owner

Urigo commented Feb 1, 2019

I love it!
The idea for those tutorials is that we can compare different tools and stacks on a full scale app.

Maybe you can help start a version of this, link it here and we can start iterating on it?

Also, I want to add tools that measure things so we could provide more clear picture comparing tools.

What would you say would be things we should highlight when comparing the current implementation with react-native-web?
Then let's see if we can also add them to the CI to track them over time!
From the top of my head:

  • Compare bundle size
  • Lighthouse stuff
  • Number of lines of code - I don't think number of lines of code is a good measurement, but we will provide a code diff between versions of the tutorial and give people a clear picture of the differences in the implementation
  • Add a chapter about creating a native mobile app and compare the effort
  • What are other things you would highlight if someone asked you about this library?

To be honest, I never tried react-native-web myself, so it might be a good place to start.

Some questions I have (please don't kill me if those are really dumb questions):

  • I see that react-native-web is currently compatible with React Native 0.55 where the latest stable version is 0.58. As I understand, Hooks will probably land in React Native not earlier then 0.60. I don't mind having a version of the tutorial without hooks, that can be one of the tradeoffs people would choose from.
  • How does it compare to react-native-dom? should we talk about it here or create a separate issue for it? are there things we could track to compare those as well?

By the way, if anyone wants to participate in that effort, you can write here or email me directly

@alanpog
Copy link

alanpog commented Feb 2, 2019

@Urigo, RN can be made to work with hooks now, see this issue: facebook/react-native#21967

@immortalx
Copy link
Author

The main features and benefits are well defined by the author on the project page, personally i really find it easier to work within react native design constraints. The library was designed for the twitter lite project https://blog.twitter.com/engineering/en_us/topics/open-source/2017/how-we-built-twitter-lite.html , http://mobile.twitter.com and is in the process to become the main twitter site. It powers the PWA android app as well.

The version twitter uses is heavily customized and has some solutions that are not in the open sourced version, i don't know if they plan to PR those optimizations and new features in the future.

  • Number of lines of code should be the same or a little bit less lines.
  • Since we are recreating WhatsApp UI, it's a good thing that we can share components between native and web.
  • The only pain point that i can remember is dealing with nested scrolls or just scrolling in general, but for WhatsApp UI i don't think it's an issue.
  • react-native-dom is still experimental but I'm very excited about it, i would consider it when it reaches beta. I believe it will be faster and even easier to share components because of the way it's designed.

@immortalx
Copy link
Author

@alanpog i don't think we can use hooks with react-native-web yet, it's still on 0.55 and next release will be compatible with 0.57. I can see a lot of people requesting hooks once it lands so support should be coming soon.

@ankibalyan
Copy link

[email protected] will be compatible with hooks. 😄

@alanpog
Copy link

alanpog commented Feb 14, 2019

A RC of RN with hooks was released today: https://github.com/facebook/react-native/releases/tag/v0.59.0-rc.1
We still need react-native-web to support it though.

@Urigo
Copy link
Owner

Urigo commented Jun 12, 2019

What do you think about other libraries like https://react-native-training.github.io/react-native-elements/ ?
maybe maintainers from those libraries would like to take on the challenge of show it's possible to create a real cross platform app using their tools?

@veerjainATgmail
Copy link

would react-native-web version be easy to convert it into a react-native mobile app ?

@Urigo
Copy link
Owner

Urigo commented Jun 30, 2019

@veerjainATgmail yes that is the point of the transition.

I would really love someone to try to clone the master and try those things out and give us feedback on that.
That is the next most important feature I want to focus on

@cybercoder
Copy link

cybercoder commented Oct 5, 2019

Main challenge is creating global subscription to update all active conversations, not only which conversation we are in at time. ( don't use subscribeTomore in the room ).
updating cache and creating cached item if there is not is another problem. I'm working on it but i have no idea how i can handle and control app when using persist-cache to keep data offline like telegram messaging and others. Another challenge is writing chek-mark and double check-mark on sent messages and seen messages, because i'm working with cache directly.

@cybercoder
Copy link

I found a solution can be turning Apollo cache entirely off and using realm as offline database to save conversations & messages in phone store, update it on subscriptions and in conversation screen mount time (useMemo) fetch messages of conversation which they are greater than last seen message of that conversation by user and save it in realm store. Also we can find differences in realmand server database.
It seems react-navigationis not a goof choice (may i am wrong) for creating navigation because control of upper pages is difficult. ( A drawer will re-render every thing on it when you swipe it!). So i found react-native-navigation is a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants