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 UI optional in the PageConfigurator interface (deprecate and create another interface) #6939

Closed
vlukashov opened this issue Nov 14, 2019 · 0 comments
Assignees
Labels
hilla Issues related to Hilla
Milestone

Comments

@vlukashov
Copy link

vlukashov commented Nov 14, 2019

The V14 PageConfigurator interface should be deprecated and replaced by a new AppShellConfigurator interface. The difference between the two interfaces is that PageConfigurator receives a stateful InitialPageSetting parameter, whereas AppShellConfigurator receives a stateless-by-default AppShellSettings parameter.

Statefulness of InitialPageSettings means that it assumes existence of a server-side session: a UI instance, a server-side navigation event, and UI-bound push config, loading indicator config, and error message config.

Stetelessness-by-defualt of AppShellSettings means that it does not assume existence of any server-side session, but optionally allows it. The methods that involve the server-side state are all wrapped with an Optional<> (e.g. public Optional<UI> getUi()).

The new AppShellConfigurator interface would be either implemented by the MainLayout class (if the app has a server-side main layout) or by the AppShell class (if the app has a client-side main layout).

An instance of the app shell class is created during the VaadinService initialization, and the configureAppShell() method is called every time when IndexHtmlRequestHandler generates an index.html page.

AppShellConfigurator may be implemented by an AppShell instance (one per Vaadin Service), and also by a MainLayout (one per UI). What should happen in this case?

  • shell-level runs first
  • ui-level runs after that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hilla Issues related to Hilla
Projects
None yet
Development

No branches or pull requests

2 participants