-
-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(facade): separated to plugins to be composable (#3730)
Co-authored-by: 白熱 <sonne@asaki.me> Co-authored-by: lumixraku <lumixraku@gmail.com>
- Loading branch information
1 parent
31e58f0
commit bc6a7bb
Showing
329 changed files
with
5,888 additions
and
3,830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Building Isomorphic Univer | ||
|
||
Univer is an isomorphic (full-stack) framework for building productivity tools, which means **support of Node.js is | ||
at the same priority as browsers**. | ||
|
||
To make your code aligned with the isomorphic architecture, please pay | ||
attention to the following points: | ||
|
||
## Separate Plugins | ||
|
||
If the feature your are developing both needs to run on the server and the client, you should separate the feature into | ||
at least two plugins. One for the underlying logic and the other for the UI. | ||
|
||
The underlying logic often includes: models, commands and mutations to modify the data, and services to manage the data. | ||
|
||
The UI includes menus, shortcuts, React components, Canvas elements, or other modules that depend on the browser environment. | ||
|
||
For example, the filter feature is split into two plugins: `sheets-filter` and `sheets-filter-ui`. | ||
|
||
Some modules rely on Node.js-only API such as `fs`, `path`, `child_process`, etc. These modules should be | ||
implemented in another server-only plugin. | ||
|
||
## Separate Facade API | ||
|
||
**The Facade API is designed to be used by both the server and the client**. It should be implemented in each plugins and | ||
composed by users (or the `@univerjs/presets` package) to provide a unified | ||
API for the SDK. | ||
|
||
You should implement the Facade API that can run on Node.js and the browser in the underlying logic plugins. | ||
|
||
## Consider Implementing Commands in the Underlying Logic | ||
|
||
Commands and especially those of type `MUTATION` should be implemented in the underlying logic plugins, and should not | ||
read UI status directly to ensure that they can run on both Node.js and browsers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+298 KB
(580%)
...s-visual-comparison.spec.ts-snapshots/default-sheet-fullpage-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.