Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow plugin dependencies mechanism should be reworked. #3096

Closed
SomeoneToIgnore opened this issue Dec 4, 2017 · 4 comments
Closed

Flow plugin dependencies mechanism should be reworked. #3096

SomeoneToIgnore opened this issue Dec 4, 2017 · 4 comments

Comments

@SomeoneToIgnore
Copy link
Contributor

As an plugin example, consider vaadin-grid. It requires extra files to be used in order to function properly, one of the files is gridConnector.js.

Current way of adding those dependencies is to put them into META-INF/resources/frontend so that flow-maven-plugin can copy them to the resulting war. Those files are copied to the frontend:// roots of the app (frontend-es6 and frontend-es5 by default) for production mode.

If we put gridConnector.js to META-INF/resources/frontend/gridConnector.js, we need to reference it:

  • if we reference the connector as @HtmlImport("frontend://addon.html"), the production mode works fine, since flow-maven-plugin copies files wherever they belong to
    But if the user changes development mode frontend directory location with, say, -Dvaadin.frontend.url.dev=context://mySuperDir the application will fail to locate gridConnector.js in development mode.

  • if we reference the connector as @HtmlImport("context://frontend/gridConnector.js"), the production mode will fail, since there will be no frontend directory after flow-maven-plugin processes the files.

We need to come up with the idea how to fix this.

@Legioth
Copy link
Member

Legioth commented Dec 4, 2017

What's the purpose of allowing the user to change the development-time setting if it will inevitably lead to things not working?

@SomeoneToIgnore
Copy link
Contributor Author

#2554

To keep the URL structure consistent between development and production,
a configurable frontend prefix is used in all cases. This also helps
simplify the maven setup since there's not need to serve any files from
special locations.

@SomeoneToIgnore
Copy link
Contributor Author

SomeoneToIgnore commented Dec 4, 2017

That was the original intention.
We can remove it, sure, just need to double check bakery guys at least, since they are using the feature to have their sources in the src/main/webapp/ directory.
From the quick look at the project setup, it looks like there should be no issues with moving it to src/main/webapp/frontend

@Legioth
Copy link
Member

Legioth commented Dec 5, 2017

I believe it would be most appropriate to just remove the setting since it causes more problems than it helps solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants