-
Notifications
You must be signed in to change notification settings - Fork 168
Community Feedback Request - Release a 2.0 if React removes the patents clause? #302
Comments
I think this would be a really great thing! It would save @sccolbert a ton of work and open up the project to a lot more contributors from the React community. It would also allow bundled extensions to make use of open source React components. It could also make it more straight-forward to provide and consume JupyterLab UI components (e.g. dropdown, right-click menu, toolbar, etc.). |
I agree completely with grant. Should it happen it makes total sense to
switch over.
On Mon, Jul 17, 2017 at 12:23 AM Grant Nestor ***@***.***> wrote:
I think this would be a really great thing! It would save @sccolbert
<https://github.com/sccolbert> a ton of work and open up the project to a
lot more contributors from the React community. It would also allow bundled
extensions to make use of open source React components. It could also make
it more straight-forward to provide and consume JupyterLab UI components
(e.g. dropdown, right-click menu, toolbar, etc.).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#302 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKcARroqpR6j3IiqEucyvvWfz8icWay7ks5sOu_PgaJpZM4OZb_a>
.
--
Have a wonderful day,
John J. Detlefs
|
I also concur with Grant. |
I agree with @gnestor as well Even without the benefit broader community uptake or support, these gains are themselves nontrivial:
|
What components use a VDOM implementation right now? The menu bar, the tab bar, and the command palette? One thing not addressed in the above notes: of all the VDOM implementations out there, why React specifically? For one, it clearly has the largest community adoption, and presumably the greatest momentum. It does seem like we can't make the vdom implementation swappable because of the hard dependency. Thinking of embedding one of these phosphor components in another page: Are there any problems with having React as a dependency that interfere with other uses of React on a page? Does React require being a singleton, so there would need to be some sort of deduping and possible version conflicts if React is used elsewhere on the page? |
For all the reasons you mention.
React would just need to be importable through whatever bundler you choose. We wouldn't be shipping our own copy. |
Oh right, I forgot you aren't distributing a webpack bundle. |
Yes, having more than 1 version of React loaded on a page can definitely cause issues. However, seeing as though we are using webpack to bundle everything together (including 3rd party extensions.), we should be able to dedupe and control which version of React is provided. |
I would be in favor of using React if the license change follows.
…On Mon, Jul 17, 2017 at 7:30 AM, Grant Nestor ***@***.***> wrote:
Are there any problems with having React as a dependency that interfere
with other uses of React on a page? Does React require being a singleton,
so there would need to be some sort of deduping and possible version
conflicts if React is used elsewhere on the page?
Yes, having more than 1 version of React loaded on a page can definitely
cause issues. However, seeing as though we are using webpack to bundle
everything together (including 3rd party extensions.), we should be able to
dedupe and control which version of React is provided.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#302 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0E00_m9jFnNyCSRUwolnL6LvIh09ks5sO2_7gaJpZM4OZb_a>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
Anything that deduplicates effort seems like a good thing. We have been building up a collection of ui elements that we call ui-kit that all rely on |
It appears that Facebook has reached a no-op decision: https://code.facebook.com/posts/112130496157735/explaining-react-s-license I am very disheartened by this. The most painful part is that the post appears to clarify Facebook's intent to use the patent clause as a weapon in their overall patent strategy. I would summarize their position in this way, "if you are feeling uncomfortable with the react.js patent retaliation clause, then good, cause that is why it is there." I will be working with NumFOCUS folks this week to figure out a path forward. |
Yep. Saw that last night :( It seems the wider community is also realizing they weren't paying close enough attention to the clause. https://news.ycombinator.com/item?id=15050841 |
In light of this, I think the safest way forward right now is to not adopt React in Phosphor. |
Reopening in light of the license change. |
For me the best things about PhosphorJS are TypeScript and that it doesn't bring in junk like lodash, jQuery, React and dozens of totally useless and incompetent left-pad style packages. How much extra work would it be to design so that React is the "official" vdom implementation, but 3rd parties could replace it? Then there's Vue, Mithril and Moon or other bloated alternatives like Angular or Aurelia. Hopefully PhosphorJS could be impartial to such choices. Dojo 2 will use maquette which is also all TypeScript and with a codebase about the size of the current |
What would it take to have phosphor widgets that are compatible with react, while still maintaining widgets that are compatible with the phosphor vdom? |
@jdetle not worth the effort. |
@jjrv, an API compatible virtual DOM implementation (like |
@blink1073 in that case it would be nice if a subset of React API not much larger than the current vdom API was used. Any necessary shim could then be kept small. I'm sure PhosphorJS would also work great in some Angular projects and it would be silly for them to also include React. |
To be clear, we're only talking about |
@jjrv It's also silly for me to maintain a separate vdom library at this point, given that React is more complete, has a large community, several useful third part components, and now an MIT license. |
Is it suppose to work with react dom now or still using a separate vdom? |
In JupyterLab we have begun to use react for all virtual DOM rendering.
Phosphor is still shipping its own vdom library that is used internally for
rendering some elements. The two approaches play together just fine. The
only caveat is that JSX/TSX can only be pointed to a single implementation
in a given build. We have talked about a couple different ways of handling
this in phosphor - but haven't finalized the approach. The main questions
are if we want to try to keep backwards compatibility or release a phosphor
2.0 that break the existing vdom APIs. I will let @sccolbert comment more
on that aspect.
In terms of which virtual DOM library you should use in your own code,
react is a great baseline, but you could also consider others based on your
needs (features, API, performance, react compatibility, etc.)
…On Mon, Jan 15, 2018 at 8:21 AM, veeramarni ***@***.***> wrote:
Is it suppose to work with react dom now or still using a separate vdom?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#302 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0BRJZ7Xgj-Z51Epz0MBh0Atx9pytks5tK3rvgaJpZM4OZb_a>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
Ok, do you see any problem implementing this way?
|
We have a helper class in jupyterlab that manages this:
https://github.com/jupyterlab/jupyterlab/blob/master/packages/apputils/src/vdom.ts#L29
The main ideas needed are there and you can modify based on your needs
(like remove our model stuff if not relevant). But yes, you are on the
right track! Because we have some of that code over in jupyterlab, and we
are working on react stuff there, you might want to post that code snippet
on this issue:
jupyterlab/jupyterlab#3493
Cheers, Brian
…On Mon, Jan 15, 2018 at 1:42 PM, veeramarni ***@***.***> wrote:
Ok, do you see any problem implementing this way?
export default class ReactWidget<TProps = {}> extends Widget {
private _cssClass = style({
backgroundColor: appBackgroundColor,
display: 'flex',
flexDirection: 'column',
minHeight: '50px',
minWidth: '50px',
padding: '4px'
});
constructor(private component: React.ComponentClass<TProps>, private props?: TProps) {
super();
this.addClass(this._cssClass);
}
protected onAfterAttach(_: Message): void {
this.update();
}
protected onBeforeDetach(_: Message): void {
ReactDOM.unmountComponentAtNode(this.node);
}
protected onUpdateRequest(_: Message): void {
ReactDOM.render(
React.createElement(AppContainer, {}, React.createElement(this.component, this.props)),
this.node
);
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#302 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0JuTMt3z9d8ZJIzXhqGCfRH0_Q2Uks5tK8ZEgaJpZM4OZb_a>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
Why not use Inferno instead? Its it is smaller and much faster than React, and in particular its virtual DOM diff implementation is much faster than React's. |
Hi, How can we make a react-phosphor / react-jupyterlab type thing so we can embed JupyterLab in our React app and share state? Typescript noob but studying it now |
@saulshanabrook's response on Gitter:
|
like then inside jupyterlab component we could just render the lab one time, and watch for changes to the graph data, and dispatch updates to react state |
This all sounds possible but I can't say for sure without seeing some example code.
I'm not familiar with
You can create a labextension that hooks into kernels and respond to kernel events, messages, etc. and communicate with the parent React app from there. |
here's a repo where i've attempted to create a react app for jupyterlab https://github.com/bionicles/lab-component I added index.js of examples/app to a "useEffect" hook inside a boilerplate create-react-app "yarn start" and it tries to work but cannot find a kernel server and has some bugs: next I tried adding main.py also from examples/app -- but python main.py fails as there is no template.html how do you make the main.py function play nice with react app instead of html template? EDIT: added index.html and webpack.config.js however when python main.py launches index.html it seeks bundle.js, which does not exist because create-react-app has conflicting build settings |
For reference, @bionicles created jupyterlab/jupyterlab#6380 to continue the conversation about embedding in React. |
@jasongrout recently brought up the point that by depending on React in I think instead we should make it easier to use React with Phosphor.
|
One of the big reasons that Phosphor includes its own virtual DOM implementation, is because of React's patents clause. In the wake of the Apache foundation forbidding the "react+patents" license in dependencies, Facebook relicensed RocksDB as dual Apache/GPL. It's reasonable to assume that React will follow suit:
facebook/react#10191
Should that happen, what is the communities feedback on releasing a Phosphor 2.0 which does not include
@phosphor/virtualdom
and replaces all internal uses of that package with React?If we do this, it will be the first external runtime dependency for Phosphor.
cc @ellisonbg @jasongrout @birdsarah @bollwyvl @jdetle @blink1073 @afshin @ian-r-rose @gnestor
The text was updated successfully, but these errors were encountered: