Comments (5)
Hey @necolas. Thanks for the input. I'm definitely open to it. I actually did some research into react-native-web early on, but ended up deciding to just use React at first because it felt like a more trodden path and just a more basic place to start. Not exactly a super deep technical analysis.
My main concerns with react-native-web are related to support and ecosystem. Will we have access to the same features that come out on standard React? Also, I'm still not super clear on the exact problems it solves assuming we don't care about rendering on mobile. So yeah, I guess I'm interested, but to justify using something other than the mainstream React I need a really clear understanding of the benefits. The deterministic CSS stuff is interesting but seems solvable on its own. Maybe I should take a deeper look. Maybe you can help me understand your view of the trade-offs as well.
from xray.
Thanks, I've tried to answer some points below. Will close this as it was just a "have you looked at..." issue.
My main concerns with react-native-web are related to support and ecosystem
So far it's been supported for over 2 years with over 160 releases. The ecosystem is tied to the large React Native ecosystem. RNW is currently used in production by Twitter, Flipkart, Uber. Twitter is using it for desktop and mobile web UX in the upcoming replacement of twitter.com with mobile.twitter.com.
Will we have access to the same features that come out on standard React?
By "standard React" do you mean React DOM? The DOM APIs change very slowly so React DOM is pretty stable. RNW is actually built over React DOM which means you can use 'react-dom' directly if ever needed. This is how Twitter can incrementally concert components to use RNW too.
I'm still not super clear on the exact problems it solves assuming we don't care about rendering on mobile.
As mentioned above, it's not just for mobile. Other problems it solves are deterministic styles with minimal footprint, prefixed styles, built-in RTL layout support, subscribing to element layout, built-in layout measurement, accessible interactions via kb, mouse, or touch inputs (eg Surface laptop support all 3 at once). And it provides higher level abstractions for building UI than you get from the DOM. All of this is built into the framework and the component props.
to justify using something other than the mainstream React I need a really clear understanding of the benefits
Sure. Think of it more like a component library for React DOM. Your requirements are not met by React DOM, that's just a React API for the DOM. Whereas Facebook designed React Native for app developers and a lot of tools we need to build web apps are built into it. The styling alone provides guarantees, performance, and dev tools integration which most web css-in-js libraries do not.
The deterministic CSS stuff is interesting but seems solvable on its own
It's not unless you want to design and build your own library, but React Native has already done the work https://github.com/necolas/react-native-web/blob/master/website/guides/style.md#how-styles-are-resolved
In contrast, libraries like styletron have determinism issues that can be difficult to debug when components and styles are composed.
Maybe you can help me understand your view of the trade-offs as well.
IMO what you lose is relatively limited because you can use one of several escape hatches whenever needed, including using it alongside any vanilla JS or react DOM code. You buy into a stricter contract with more powerful primitives in the places you benefit from that. Most notable is no support for state in CSS - media queries, hover. In reality I think non-trivial apps benefit from this as you need to replace or update components in response to layout changes anywhere in the tree, rather than only change styles when the viewport changes.
from xray.
Thanks very much for the thoughtful reply. I will give it a closer look. The benefits you mention to indeed sound compelling to me.
from xray.
And FWIW, I understand that trying new react tools isn't the priority for xray. But as someone who understands the specific requirements of xray, I would be interested in hearing any further thoughts you have, or any issues you might identify, even if it's just exploring in your own time and not for xray. Thanks!
from xray.
This might be interesting alternative too.
It's a GPU-based (webrender) and there is absolutely no DOM or CSS involved. It's currently a subset of react-native with aim to be react-friendly cross-platform UI for desktop applications (not there yet at all).
Footprint is 50M including npx ts-node
so it should be around 30M with react if precompiled.
from xray.
Related Issues (20)
- Electron version HOT 1
- IMHO, if you call it experimental, you had better not call it "next-generation".
- memo_core filesystem sync status? HOT 3
- Memo: include `path` in Entry
- [Memo] Adding a file to a subdirectory works, but reading it fails HOT 2
- [Memo] There is no API to undelete a file. HOT 3
- [Memo] Adding a `Changed` file status. HOT 3
- [Memo] `parentId` could be hidden from the user-facing API HOT 3
- [Memo] Change notifications? HOT 2
- Xray panics when scrolling too fast while editing README.md HOT 7
- [Memo] There isn't an API call to verify a path's existence
- [memo] There is no way to stop listening to buffer changes
- [memo] Extra methods for Buffers
- [Memo] Confusing error message about ReplicaId HOT 1
- panic at index out of bounds HOT 1
- Question: Can we potentially use x-ray on a thin-client while the x-ray core server could be installed remotely? (Hackable Cloud IDE?) HOT 1
- Is it dead? HOT 12
- Missing XRAY_SERVER_PATH environment variable HOT 4
- 此项目停了吗? HOT 2
- Future plans for xray? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xray.