flow-and-components-documentation icon indicating copy to clipboard operation
flow-and-components-documentation copied to clipboard

Document operations done by Maven plugin

Open raisoftware opened this issue 6 years ago • 3 comments
trafficstars

https://vaadin.com/docs/v14/flow/production/tutorial-production-mode-advanced.html states: "The intention of the goal is to prepare the frontend files. This is a complex process involving several steps: - ..."

We do not use Maven for our build process, we use Bazel along with some scripts. It would be helpful to know what exactly is each goal doing so we can reproduce it within our build process, without having to reverse engineer the entire plugin for Maven. Can you please provide instructions on the expected output, or the manual process to obtain it? The description as is lacks detail.

raisoftware avatar Jun 13 '19 12:06 raisoftware

Hello. Starting from Vaadin 14, the Maven plugin will actually run Webpack for both the development mode and the production build. Those should be much easier for you to handle, as you can probably just run webpack with your scripts ? You can see our configuration files there. You'll have to update your project to npm mode though. We are going to make a migration tool for that, but in the mean while you can read about it from https://vaadin.com/docs/v14/flow/v14-migration/v14-migration-guide.html

Sorry, but I don't think we are going to add any more specific instructions about the compatibility mode version of the Maven plugin production build. What it basically does is

  1. extra all the frontend files from webjars
  2. runs Polymer CLI for the transpilation, minification and bundling of the frontend code
  3. make sure the bundle files are included in the produced package

pleku avatar Jun 25 '19 07:06 pleku

Hello, I want to clarify that I am not talking about the compatibility mode. You are requiring the use of the Maven plugin for all development, including webpack mode, but we cannot use Maven because we use a Bazel build process. I am just asking for the specifications of the Maven plugin, so we can redo it using Bazel. Surely you already have those specs, since you build the maven plugin using them.

raisoftware avatar Jul 22 '19 10:07 raisoftware

Hi.

For development mode there should be no special needs except perhaps giving the project.basedir as a System property (this should point to the folder where sources when running the servlet.

For a production build it's a bit more complex as there is optimization on what is included and fallback modules, but in essence it would be to execute as an application

        new NodeTasks.Builder(new DevModeClassFinder(classes),
                npmFolder, generatedFolder, frontendDirectory)
                        .runNpmInstall(runNpmInstall)
                        .enablePackagesUpdate(true)
                        .useByteCodeScanner(optimizeBundle)
                        .copyResources(jarFiles)
                        .copyLocalResources(frontendResourcesDirectory)
                        .enableImportsUpdate(true)
                        .withEmbeddableWebComponents(
                                generateEmbeddableWebComponents)
                        .withTokenFile(getTokenFile()).enablePnpm(pnpmEnable)
                        .withHomeNodeExecRequired(requireHomeNodeExec)
                        .withNodeVersion(nodeVersion)
                        .withNodeDownloadRoot(nodeDownloadRootURI)
                        .build()
                        .execute();

but as seen from the development mode starter getting all the paths correct is not an easy feat. initialization

caalador avatar Aug 10 '20 09:08 caalador