Skip to content

[Regression] Unexpected order of JavaScript execution in prod mode #18016

Closed

Description

@vursen

Description of the bug

We have a TooltipConfiguration that registers a UIInitListener to run some JavaScript that ensures the default global configuration for tooltips. This JavaScript assumes that the @JsModule dependencies, particularly tooltip.ts, are imported in the browser before its execution.

However, in version 24.3, this no longer works consistently. In dev mode, everything still works as expected. In prod mode, the Flow client starts executing UIInitListener's JavaScript before the @JsModule dependencies become available, which then results in an "undefined method" error on the client-side.

Expected behavior

The executeJS instructions scheduled in UIInitListener should be executed only after the @JsModule dependencies are imported in the browser.

Minimal reproducible example

  1. git checkout bug/ui-init-listener in flow-components.
  2. Run mvn clean install -Drelease -DskipTests
  3. Run mvn jetty:run -Drun-it -Drelease -f vaadin-button-flow-parent/vaadin-button-flow-integration-tests
  4. Open http://localhost:8080/vaadin-button/tooltip-defaults and reload to get UIInitListener invoked.
  5. Observe several JS errors in the browser log.

Versions

  • Vaadin / Flow version: 24.3
  • Java version: 17
  • OS version: Mac OS

Activity

  1. changed the title [-]Incorrect order of JavaScript execution in prod mode[/-] [+][Regression] Incorrect order of JavaScript execution in prod mode[/+] on Nov 10, 2023
  2. moved this from 🆕 Needs triage to 🔖 High Priority (P1) in Vaadin Flow bugs & maintenanceon Nov 13, 2023
  3. self-assigned this
    on Nov 13, 2023
  4. moved this from 🟢Ready to Go to ⚒️ In progress in Vaadin Flow | Hilla | Kits ongoing workon Nov 14, 2023
  5. changed the title [-][Regression] Incorrect order of JavaScript execution in prod mode[/-] [+][Regression] Unexpected order of JavaScript execution in prod mode[/+] on Nov 15, 2023
  6. mshabarov commented on Nov 16, 2023

    @mshabarov
    Contributor

    Covered by changes in Tooltip configuration initialisation via vaadin/flow-components#5724.

  7. moved this from 🔖 High Priority (P1) to ✅ Closed in Vaadin Flow bugs & maintenanceon Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions