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

CCDM: implement Flow.start() API #6194

Merged
merged 5 commits into from Aug 8, 2019
Merged

CCDM: implement Flow.start() API #6194

merged 5 commits into from Aug 8, 2019

Conversation

manolo
Copy link
Member

@manolo manolo commented Aug 7, 2019

This fixes #6133

  • Adding the FlowBootstrap.js file that is distributed in flow-client.jar. It is based in BootstrapHandler.js but with small modifications to be an ES module.
  • Copying the flow-client file as FlowClient.js to be distributed in the client jar file. It needs to be 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 from typescript.
  • Implemented the Flow.start() method with the following steps
    • Send a XHR request to flow JavaScriptBoostrapHandler in order to get create session
      and get the application configuration
    • Load FlowBootstrap.js chunk and initialize it with the response from the previous step
    • Load FlowClient.js chunk and run it.
  • Added tasks to maven and npm to correctly build the Flow client library and test it.

This change is Reviewable

@manolo manolo added the hilla Issues related to Hilla label Aug 7, 2019
@manolo manolo requested review from platosha and qtdzz August 7, 2019 09:04
@manolo manolo self-assigned this Aug 7, 2019
@project-bot project-bot bot added this to Review in progress in OLD Vaadin Flow ongoing work (Vaadin 10+) Aug 7, 2019
Copy link
Contributor

@platosha platosha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 10 of 10 files at r1.
Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @manolo and @qtdzz)


flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts, line 60 at r1 (raw file):

    }

    async __initFlowClient(clientMod: any): Promise<void> {

How about using a private modifier from TypeScript instead of __memberName prefixes?


flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts, line 85 at r1 (raw file):

                    resolve(JSON.parse(httpRequest.responseText));
                } else {
                    reject(httpRequest);

Nit: typically a Promise rejection is expected to give an error object, same as with throw. Here we give a request instead.

Would be probably nicer to have some error object here. The caller method will carry this rejection outside, I think.

Not blocking for now, fine by me to improve this later.

Copy link
Member Author

@manolo manolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@platosha had to remove FF because failed in TC

Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @platosha and @qtdzz)


flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts, line 60 at r1 (raw file):

Previously, platosha (Anton Platonov) wrote…

How about using a private modifier from TypeScript instead of __memberName prefixes?

Done.


flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts, line 85 at r1 (raw file):

Previously, platosha (Anton Platonov) wrote…

Nit: typically a Promise rejection is expected to give an error object, same as with throw. Here we give a request instead.

Would be probably nicer to have some error object here. The caller method will carry this rejection outside, I think.

Not blocking for now, fine by me to improve this later.

Done. Also added a test for this code.

OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Review in progress to Reviewer approved Aug 8, 2019
Copy link
Contributor

@platosha platosha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r2.
Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained (waiting on @qtdzz)

@manolo manolo merged commit 76a3207 into ccdm Aug 8, 2019
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Reviewer approved to Done - pending release Aug 8, 2019
@manolo manolo deleted the mcm/ccdm/implement-start branch August 8, 2019 09:26
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
OLD Vaadin Flow ongoing work (Vaadin ...
  
Done - pending release
Development

Successfully merging this pull request may close these issues.

None yet

2 participants