Skip to content
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

Make the module the sub-application #417

Open
MrWindlike opened this issue May 25, 2022 · 1 comment
Open

Make the module the sub-application #417

MrWindlike opened this issue May 25, 2022 · 1 comment
Assignees
Labels
runtime about meta-ui runtime

Comments

@MrWindlike
Copy link
Contributor

What problem does this feature solve?
Currently, we use the $moduleId in the module to split the main application and the other modules, but it needs to evaluate the whole module template in the ModuleRenderer with the evalScope. This would lead to if some sub expressions evaluate wrong it would break the whole template's evaluation.

What does the proposed change?
Maybe we should make the module the sub-application, it could have its own StateManager and ApiService instance, then we don't need the $moduleId anymore and could evaluate the expression as the main application do.

@MrWindlike MrWindlike added the runtime about meta-ui runtime label May 25, 2022
@tanbowensg
Copy link
Collaborator

tanbowensg commented Jun 13, 2022

I think it could be a good idea. This could be the base of developing multiple page app by sunmao.

Module is vert similar to an application. The design $moduleId aims to isolate module's scope from application scope. If we use different sunmao instance, the problem will not exist anymore.
The problems are:

  1. Allow different sunmao instances communicate will each other(expose state and events, just like what moduleRenderer do).
  2. Fix the potential problems when multiple nested sunmao instances show in one screen, like dialog container problem.

We can keep the ModuleRenderer now ,and create a new ApplicationRenderer. We'd better not create a new spec. We can keep use the module spec.

@tanbowensg tanbowensg added this to the v0.8 milestone Jun 13, 2022
@MrWindlike MrWindlike self-assigned this Jun 14, 2022
@tanbowensg tanbowensg removed this from the v0.8 milestone Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime about meta-ui runtime
Projects
None yet
Development

No branches or pull requests

2 participants