Skip to content

Make JavaScriptBootHandler only respond to servlet path and not all sub paths - #10431

Merged
pleku merged 32 commits into
masterfrom
scope-js-bootstraphandler
Apr 7, 2021
Merged

pleku merged 32 commits into
masterfrom
scope-js-bootstraphandler

Conversation

@Artur-

@Artur- Artur- commented Mar 26, 2021

Copy link
Copy Markdown
Member

Needed for #10363 and vaadin/spring#735

@haijian-vaadin haijian-vaadin added the hilla Issues related to Hilla label Mar 29, 2021
Artur- added a commit that referenced this pull request Mar 29, 2021
This is what is mostly needed for all implementations and getting it through
the request is more a workaround. The request is typically not needed at all
and relying on the internals of the request is problematic if we change how the
request is done, as is being done in e.g. #10431
Artur- added a commit that referenced this pull request Mar 29, 2021
This is what is mostly needed for all implementations and getting it through
the request is more a workaround. The request is typically not needed at all
and relying on the internals of the request is problematic if we change how the
request is done, as is being done in e.g. #10431
Artur- added a commit that referenced this pull request Mar 29, 2021
This is what is mostly needed for all implementations and getting it through
the request is more a workaround. The request is typically not needed at all
and relying on the internals of the request is problematic if we change how the
request is done, as is being done in e.g. #10431
Artur- added a commit that referenced this pull request Mar 30, 2021
This is what is mostly needed for all implementations and getting it through
the request is more a workaround. The request is typically not needed at all
and relying on the internals of the request is problematic if we change how the
request is done, as is being done in e.g. #10431
@Artur-
Artur- force-pushed the scope-js-bootstraphandler branch from 8125a7f to 6d7adbc Compare March 30, 2021 17:27
Artur- added a commit that referenced this pull request Mar 31, 2021
This is what is mostly needed for all implementations and getting it through
the request is more a workaround. The request is typically not needed at all
and relying on the internals of the request is problematic if we change how the
request is done, as is being done in e.g. #10431
Artur- added a commit that referenced this pull request Mar 31, 2021
This is what is mostly needed for all implementations and getting it through
the request is more a workaround. The request is typically not needed at all
and relying on the internals of the request is problematic if we change how the
request is done, as is being done in e.g. #10431
@Artur-
Artur- force-pushed the scope-js-bootstraphandler branch from e81e997 to 0c3370e Compare March 31, 2021 07:55
Artur- added 5 commits March 31, 2021 17:45
This is what is mostly needed for all implementations and getting it through
the request is more a workaround. The request is typically not needed at all
and relying on the internals of the request is problematic if we change how the
request is done, as is being done in e.g. #10431
@Artur-
Artur- force-pushed the scope-js-bootstraphandler branch from 194359c to 197c526 Compare March 31, 2021 14:45
@vaadin vaadin deleted a comment from Artur- Apr 6, 2021
* @deprecated use {@link #initializeUI(UI, Location)} instead
*/
@Deprecated
public void initializeUI(UI ui, VaadinRequest initRequest) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

INFO Do not forget to remove this deprecated code someday. rule

* @deprecated use {@link #resolvePageConfigurationHolder(UI, Location)} instead
*/
@Deprecated
public static Optional<Class<?>> resolvePageConfigurationHolder(UI ui,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

INFO Do not forget to remove this deprecated code someday. rule

@vaadin-bot

Copy link
Copy Markdown
Collaborator

SonarQube analysis reported 3 issues

  • MINOR 1 minor
  • INFO 2 info

Watch the comments in this conversation to review them.

1 extra issue

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MINOR BootstrapHandler.java#L900: Immediately return this expression instead of assigning it to the temporary variable "resourceProvider". rule

pleku pushed a commit that referenced this pull request Apr 7, 2021
)

This is a prerequisite to allow JavaScriptBootstrapHandler to pass the route path as a query parameter instead of relying on the request path info. Related to #10431

@pleku pleku left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it be a terrible idea to add an IT that verifies that someone does later on add code that breaks the assumption that sub paths don't work with JSBH ? So basically checking that a request to /foo?v-r=init... would not work ?

@Artur-

Artur- commented Apr 7, 2021

Copy link
Copy Markdown
Member Author

Added a unit test

@pleku pleku left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I was requesting for an IT but this is better than nothing.

@Artur-

Artur- commented Apr 7, 2021

Copy link
Copy Markdown
Member Author

What would an IT test? It is not an end user feature

@pleku
pleku enabled auto-merge (squash) April 7, 2021 08:26
@pleku

pleku commented Apr 7, 2021

Copy link
Copy Markdown

What would an IT test? It is not an end user feature

Verify that nothing is served from bootstrap if you craft an init request with subpath. But now thinking about it, not sure what adding it would even gain.

@pleku
pleku disabled auto-merge April 7, 2021 12:46
@pleku
pleku merged commit fd47059 into master Apr 7, 2021
@pleku
pleku deleted the scope-js-bootstraphandler branch April 7, 2021 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hilla Issues related to Hilla +1.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants