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
Create a flow.start()
method to start a Flow app from the client-side
#6133
Comments
vlukashov
changed the title
Flow
Create a Jul 31, 2019
start
method implementationflow.start()
method to start a Flow app from the client-side
project-bot
bot
added this to Inbox - needs triage
in OLD Vaadin Flow ongoing work (Vaadin 10+)
Jul 31, 2019
project-bot
bot
moved this from Inbox - needs triage
to In progress
in OLD Vaadin Flow ongoing work (Vaadin 10+)
Aug 1, 2019
manolo
added a commit
that referenced
this issue
Aug 8, 2019
This fixes #6133 by: - Adding a `FlowBootstrap.js` to be distributed in the `flow-client.jar`. It is based in `BootstrapHandler.js` but with small modifications to be an ES module. - Copying the gwt flow-client file as `FlowClient.js` in order to be distributed in the client jar file. It is wrapped in a function so as it can be lazily executed. - Adding definition files for `FlowBootstrap.js` and `FlowClient.js` files so as they can be used in typescript. - Implemented the `Flow.start()` method with the following steps - Sends a XHR request to flow `JavaScriptBoostrapHandler` in order to get create session and get the application configuration - Loads `FlowBootstrap.js` chunk and initialize it with the response from the previous step - Loads `FlowClient.js` chunk and run it. - Added tasks to maven and npm to correctly build the Flow client library and test it.
manolo
added a commit
that referenced
this issue
Aug 12, 2019
Fixes #6133 by: - It Makes possible to append flow UI to browser without requiring an exported web component. - After flow-client configures the bootstrap, is it possible to attach UI to any slot in the browser. - This PR does not resolve client side navigation because server side is not implemented yet (#6221), instead it attaches a static view to the outlet from server - Fixes a couple of errors in the generated client javascript when importing the file as an ES6 module: - There was a JSNI block with non declared variable in a for statement - There was a weird function where a variable was not declared when the method was inlined by gwt compiler - Adding `eslint` rules to early detect whether the produced javascript has declaration errors
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When bootstrapping a Vaadin 15+ app from client-side code, I want a client-side API to start the Flow app in the context of the current page, so that I can create V14-like apps where Flow has full control of the page, but start them from the client-side code.
The snippet below should start a Flow app in the
<body>
element:The following does the same but having flow imports in the main bundle:
imports
propertystart
method that bootstraps Flow in the same way as the regular bootstrap today, i.e. embedding itself inside and listening to router-link clicks and popstate events. Internally uses the new server-side request handler to initialize the session and the UI.It should configure client side with errors, stats, push and any other thing that happens in current bootstrapThe text was updated successfully, but these errors were encountered: