vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
922 stars 57 forks source link

webcomponent-loader.js polyfill not present on Vaadin 18+ #264

Open darmro opened 3 years ago

darmro commented 3 years ago

Description of the bug

According to the documentation in "Introduction to Embedding Applications": https://vaadin.com/docs/v18/flow/embedding-flow-applications/tutorial-webcomponent-exporter.html and even new https://vaadin.com/docs-beta/latest/flow/embedding/intro/ to embed the exported application in a page one have to:

Add webcomponent-loader.js polyfill script to your page, for example

In Vaadin 14+ url "YOUR_EMBEDDED_APPLICATION_URI/VAADIN/build/webcomponentsjs/webcomponents-loader.js" in application was ok. But in Vaadin 18+ (I've checked 18.0.6 and 19.0.beta3) this url is a dead end. For Vaadin 18+ polyfill module is not served by the application (or is not accessible).

Minimal reproducible example

I took "Hello World Example / Plan Java Vaadin 14". Added a simple WebComponentExporter class and a simple servlet- all according to instructions from documentation (even for Vaadin 18+).

Quick test for Vaadin 14:
everything is ok, url "http://localhost:8080/project-base/VAADIN/build/webcomponentsjs/webcomponents-loader.js" works.

I've changed in pom Vaadin version to 18.0.6:
url "http://localhost:8080/project-base/VAADIN/build/webcomponentsjs/webcomponents-loader.js" is dead - (HTTP Status 404 – Not Found). The same app (as for previous test) so url in my servlet is for sure correct.

Of course for both applications file webcomponentsjs/webcomponents-loader.js is present in node_modules. So why it's not accesible from web application.

My simple test app (V 18+): skeleton-starter-flow.zip

Artur- commented 3 years ago

It sounds like an oversight in the documentation as you do not need the polyfill for any of the browsers Vaadin 18 supports

mshabarov commented 3 years ago

Related to that change apparently: https://github.com/vaadin/flow/pull/7416. Documentation update is needed.