-
Notifications
You must be signed in to change notification settings - Fork 71
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
Integrating react. #94
Conversation
Hmm, that's annoying. We really want to use web components. Any idea how to work around that?
I don't think this is a problem.
Right. We can work around that. |
Has anyone tried virtual-dom? Has it the same limitation? (It seems, no.) I avoided React so far, because it messes with Web Components. |
Well so far I just implemented react component instead of Web Component, I don't think web component buys us that much at least at this point. You can actually define your own tags, but non "data-" attributes can't be extended as far as I can tell. I have submitted this issue facebook/react#2746 (comment) That being said you can always wrap web component into react component and take care of all updates manually. It's not terrible but you end up throwing out a lot of benefits that reacts gives though. |
Yes I've used vtree and vdom that are main building blocks for virtual-dom quite successfully. I have building a todo-mvc that runs all of the app in a web worker. You can find code here https://github.com/Gozala/reflex/tree/workers/examples I have also prototyped clone of react's API on top of vtree and vdom here I do also want to prototype component API on top of vtree and vdom that defines web components under the hood. That being said while I think vtree and vdom are good building blocks I'd rather start with react and then maybe swap it out something based off vtree / vdom.
I don't think it messes with WebComponents it just does not supports them & they the main reason is they won't be able to perform all the optimizations they can currently do because of virtual dom. |
Removed all the obsolete modules to make what's there more clear. Which made me realize I still need to port dark-theme and side tabs to use react components. |
I'll review these changes and let you know. |
Removed all the obsolete modules to make what's there more clear. Which made me realize I still need to port:
|
@@ -0,0 +1,79 @@ | |||
define((require, exports, module) => { | |||
"use stict"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here, r
missing in strict
.
Ok support for sidetabs is inn now as well. I have also removed all the unused code (with except of css to make it easy merge changes in master). Also source should be full of semicolons now as well. |
P.S.: Diffstat says +19,653 −1,483 but that's misleading since react adds +18,095 is + so if we ignore that it would be more like +1,558 −1,483 & then if also remove legacy css I think we might come out even. |
@paulrouget what should I do with this pull request ? |
Moved this here browserhtml/browserhtml#34 |
This pull request is not ready to be merged yet, but I wanted to share it sooner to let you know I'm working on this & explain why. For one I believe use of react (or other similar style library) provide enough benefits to justify the switch. I'm going to list pros and cons as I see them below:
Pros
Cons
Frame
component. I imagine this limitation will be fixed over time, as I imagine that with a an adoption of web components this problem will be far more relevant.