hilla
hilla copied to clipboard
CCDM: importing `generated-flow-imports` in `index.ts` does not create a valid `stats.json` for production
1.- in flow-tests/test-embedding/embedding-test-assets
run mvn install
2.- in flow-tests/test-embedding/test-embedding-production
enable client side bootstrapping
<properties>
...
<vaadin.useDeprecatedV14Bootstrapping>false</vaadin.useDeprecatedV14Bootstrapping>
<properties>
3.- run mvn verify
and every tests will fail
4.- create a frontend/index.ts
file with just this content
import '../target/frontend/generated-flow-imports';
5.- run mvn verify
and most tests pass but those that need view templates (there are exceptions in console when reading the template content from stats)
6.- check the content of target/classes//META-INF/VAADIN/config/stats.json
and we can see that there are no modules for the required template
Otherwise by running mvn verify -Dvaadin.useDeprecatedV14Bootstrapping=true
all tests pass, and the content of the stats file has the correct modules.
Note: that the import in the index.js
file is needed since the application is exported as webcomponents and vaadin bootstrap is not needed but custom pages that includes the web component.
Other options for fixing webcomponents might be to deliver two bundles by webpack, one for the index.html that serves regular vaadin pages via index.ts, and another with the webcomponents with just the generated imports file