@HtmlImport trigger deprecation warning (production mode)

Hello,

we are calling @HtmlImport(“test.html”), and inside html file, we call to import JavaScripts as such:

<script src="jquery-3.3.1.min.js"></script>
<script src="TweenMax.min.js"></script>

In production mode, sometimes the animation shows up, but sometimes it doesn’t. At times that it doesn’t, the following message shows up:
[Deprecation]
HTML Imports is deprecated and will be removed in M73, around March 2019. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 for more details.

Note: For non-production mode it always load.

If anyone can help, please do.

Hello. You need to use the src="frontend://... as the path so that the imports will work correctly in the production mode because the production build will map the file import paths to ES5 and ES6 bundle version based on what the browser supports.

The deprecation of HtmlImports is a known thing that does not have any effect on this - after the support has been removed from those browsers that had the support, it will just keep on working like before because the polyfills are already there.

We are already working on npm & ES6 modules support for Flow for Vaadin 14. Then if you want to, you can run a migration tool to convert your project to use npm & Polymer 3 and ES6 modules instead of HtmlImports and webjars (which are based on Bower).
https://github.com/vaadin/flow/issues/4561