You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the Github Issues for similar issues, but did not find anything.
Problem
According to the Univer documentation, it should be possible to use Univer on a Node server. However, in the current setup, we are forced to install react for server-side usage of @univerjs/core, which is inefficient and unnecessary for a server environment.
Inside the @univerjs/core package, there is an export statement referencing React bindings:
export*from'@wendellhu/redi/react-bindings';
Since @wendellhu/redi/react-bindings depends on react, this enforces a React dependency in @univerjs/core. It would be more efficient if @univerjs/core only declared @wendellhu/redi (without the react-bindings), and then @univerjs/ui (or a similar UI-focused package) could include @wendellhu/redi/react-bindings. That way, developers who only need server-side functionality wouldn’t be forced to install react in their Node environments.
Proposed Solution:
Remove the react-bindings export from @univerjs/core.
Declare and use @wendellhu/redi/react-bindings within @univerjs/ui (or a dedicated UI/module package) so that only UI/React-related features depend on react.
This separation would allow @univerjs/core to be used in Node/server projects without requiring a React installation, improving efficiency for back-end use cases.
Thank you for your consideration, and please let me know if you need further details or clarifications.
The text was updated successfully, but these errors were encountered:
We have recently become aware of this issue, and your suggestion aligns perfectly with one of the solutions we are currently considering. Implementing this change could introduce some breaking changes, so we are actively evaluating the potential impact. Once the plan is finalized, we will move forward with its implementation promptly. Thank you for your valuable suggestion!
Initial checklist
Problem
According to the Univer documentation, it should be possible to use Univer on a Node server. However, in the current setup, we are forced to install react for server-side usage of @univerjs/core, which is inefficient and unnecessary for a server environment.
Inside the @univerjs/core package, there is an export statement referencing React bindings:
Since @wendellhu/redi/react-bindings depends on react, this enforces a React dependency in @univerjs/core. It would be more efficient if @univerjs/core only declared @wendellhu/redi (without the react-bindings), and then @univerjs/ui (or a similar UI-focused package) could include @wendellhu/redi/react-bindings. That way, developers who only need server-side functionality wouldn’t be forced to install react in their Node environments.
Proposed Solution:
Remove the react-bindings export from @univerjs/core.
Declare and use @wendellhu/redi/react-bindings within @univerjs/ui (or a dedicated UI/module package) so that only UI/React-related features depend on react.
This separation would allow @univerjs/core to be used in Node/server projects without requiring a React installation, improving efficiency for back-end use cases.
Thank you for your consideration, and please let me know if you need further details or clarifications.
The text was updated successfully, but these errors were encountered: