Skip to content

[Vite] Export web components must work #12057

Closed

Description

@gilberto-torrezan

How does it work today

  • An "export" bundle is created with everything used from exported components - this needs to be verified
    • For each WebComponentExporter a .js file is generated into {build.folder}/frontend and added as an import statement to the generated-flow-imports.js

How could it work

  • In a similar way by creating multiple bundles

Activity

  1. caalador commented on Nov 2, 2021

    @caalador
    Contributor

    Note. The current exported webcomponents uses v14 bootstrapping so it depends on stats.json to get the bundlefile name.

    For a production mode build in flow-test-embedding-generic you get:

    com.vaadin.flow.server.BootstrapException: Unable to read webpack stats file.
            at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupFrameworkLibraries(BootstrapHandler.java:863)
            at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupDocumentHead(BootstrapHandler.java:753)
            at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.getBootstrapPage(BootstrapHandler.java:628)
            at com.vaadin.flow.server.communication.WebComponentBootstrapHandler.synchronizedHandleRequest(WebComponentBootstrapHandler.java:224)
    
  2. caalador commented on Nov 3, 2021

    @caalador
    Contributor

    The exported component would seem to work as long as the BootstrapHandler::appendNpmBundle is made to get the correct bundle file. In production mode we could at the moment probably read that from the classpath, but where could we get the info in development mode?
    Should we parse the index.html for all the required bundles perhaps?

  3. self-assigned this
    on Nov 3, 2021
  4. added 3 commits that reference this issue on Nov 3, 2021
    cb2939d
    bd36271
    92f1991
  5. added a commit that references this issue on Nov 11, 2021
    97d4815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementviteTickets related to vite support

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions