The @JavaScript annotation should explain that it's included in a module scope
See original GitHub issueIn general, the following forum topic poses an interesting question:
The question is: why does not @JavaScript()
annotation run given javascript file in a global scope, but in a module scope? I think it’s really important to document this straight in the @JavaScript
annotation javadoc, since Java developers are usually not JavaScript developers.
- Vaadin / Flow version: 14.1.27
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
The @JavaScript annotation should explain that it's included in a ...
The @JavaScript annotation should explain that it's included in a module scope.
Read more >Javascript Function defined in JsFile used by @JavaScript
Hi,. i have this js file in frontend/js/test.js function testFunction() { console.log("Here i am"); }. My view is doing at class level a...
Read more >Why wouldn't you use explicit annotations when defining ...
I am new to AngularJS and learning about the two styles of writing controller functions. It seems as though the only reason someone...
Read more >Scope hoisting - Parcel
In production builds, Parcel concatenates modules into a single scope. This is called "scope hoisting". Parcel also statically analyzes the imports and ...
Read more >Documentation - Modules - TypeScript
The compiler detects whether each module is used in the emitted JavaScript. If a module identifier is only ever used as part of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve summarized the issue at hand at https://mvysny.github.io/Vaadin-difference-jsmodule-javascript/
What would be needed (as a separate ticket) is a way of explicitly choosing whether a local script file should be included in the bundle or loaded as a standalone
<script>
(i.e. no module scoping, no strict mode). The current approach that chooses based on the structure of the string defined for the annotation is very confusing, and even making workarounds difficult because of https://github.com/vaadin/flow/issues/8290.