Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
621c889
feat: identify focus and blur invocations with a command object
totally-not-ai[bot] Sep 16, 2026
db6feb0
feat: invoke focus and blur through a JS invoker interface
totally-not-ai[bot] Sep 16, 2026
f3c12bb
feat: run declared JavaScript without compiling it in the browser
totally-not-ai[bot] Sep 16, 2026
4521d7a
test: cover the failure paths of the JS invoker API
totally-not-ai[bot] Sep 16, 2026
88536b8
fix: keep a precompiled bundle usable when invoker JavaScript is missing
totally-not-ai[bot] Sep 16, 2026
118e3db
Merge branch 'main' into feat/js-invoker-seam-for-focusable
Artur- Sep 18, 2026
ef99514
fix: reject an invoker call whose parameters do not add up
totally-not-ai[bot] Sep 18, 2026
dc9a9a8
fix: complete the pending result of an invoker call that can not run
totally-not-ai[bot] Sep 18, 2026
b9a408c
feat: report an invoker whose JavaScript the bundle no longer carries
totally-not-ai[bot] Sep 18, 2026
7be1ffd
fix: compare an invoker with the bundle as the build renders it
totally-not-ai[bot] Sep 18, 2026
599df46
feat: apply a changed invoker declaration without a restart
totally-not-ai[bot] Sep 18, 2026
062b95b
fix: render the invoker file from the file and what changed
totally-not-ai[bot] Sep 18, 2026
bbf7fe0
refactor: move the invoker types out of dom and nest the focus invoker
totally-not-ai[bot] Sep 18, 2026
376dc86
fix: keep the javadoc of the invoker types resolvable after the move
totally-not-ai[bot] Sep 18, 2026
dce444d
feat: invoke page level JavaScript through an invoker as well
totally-not-ai[bot] Sep 18, 2026
1e9545d
refactor: fold the page invoker into how the page already schedules
totally-not-ai[bot] Sep 18, 2026
930b6e0
Revert "feat: invoke page level JavaScript through an invoker as well"
totally-not-ai[bot] Sep 18, 2026
92dbe82
fix: rebuild a bundle that carries no invoker JavaScript
totally-not-ai[bot] Sep 18, 2026
bc0ed50
chore: restore the client lockfile
totally-not-ai[bot] Sep 18, 2026
6370ab2
refactor: name the generator methods for what they do
totally-not-ai[bot] Sep 18, 2026
6d01499
chore: drop a generated file that a test run left behind
totally-not-ai[bot] Sep 18, 2026
fed4987
fix: read the invoker file from the frontend folder, not the dev server
totally-not-ai[bot] Sep 18, 2026
1a2832a
feat: check an invoker interface when it is handed out
totally-not-ai[bot] Sep 18, 2026
f7eb1f9
fix: say what a default method on an invoker interface needs
totally-not-ai[bot] Sep 18, 2026
b5a1cb3
Merge remote-tracking branch 'origin/main' into feat/js-invoker-seam-…
totally-not-ai[bot] Sep 18, 2026
d6911db
chore: keep the merge free of an unrelated header change
totally-not-ai[bot] Sep 18, 2026
c7528d7
refactor: write the invoker file the way a generated file is written
totally-not-ai[bot] Sep 19, 2026
c5ca9fa
test: say that the hash a bundle was built with is arbitrary here
totally-not-ai[bot] Sep 19, 2026
cc10543
fix: ask one configuration where the invoker file is
totally-not-ai[bot] Sep 19, 2026
3aeb6cd
test: pin the shape an application declares JavaScript in
totally-not-ai[bot] Sep 19, 2026
7572804
test: pin a declaration where its text could be mangled
totally-not-ai[bot] Sep 19, 2026
c64dc25
docs: point between the two ways of running JavaScript on an element
totally-not-ai[bot] Sep 19, 2026
b8289a3
docs: say that calling a function sends an expression too
totally-not-ai[bot] Sep 19, 2026
8d06def
refactor: let the task own its file, and the hotswapper own the decis…
totally-not-ai[bot] Sep 19, 2026
a4ac4a3
fix: report only what the file is missing when it cannot be written
totally-not-ai[bot] Sep 19, 2026
04450c5
refactor: name both ways of running JavaScript executeJs
totally-not-ai[bot] Sep 19, 2026
81530a2
docs: say that the interface version answers rather than runs
totally-not-ai[bot] Sep 19, 2026
7759d69
refactor: name it a JavaScript definition rather than an invoker
totally-not-ai[bot] Sep 20, 2026
0b8780e
test: cover a bundle that carries no hash for the generated file
totally-not-ai[bot] Sep 20, 2026
c0601bb
refactor: ask one question per branch, and say what the methods do
totally-not-ai[bot] Sep 20, 2026
e2b4516
test: pin that an unchanged declaration leaves the generated file alone
totally-not-ai[bot] Sep 20, 2026
3379725
test: write the generated file once, where the hotswapper reads it
totally-not-ai[bot] Sep 20, 2026
3f0766c
refactor: one way to build a method identifier, one place for the lookup
totally-not-ai[bot] Sep 20, 2026
01d9f16
refactor: let a definition declare only JavaScript, and check it else…
totally-not-ai[bot] Sep 20, 2026
b64ee95
docs: say what the interface version of executeJs does, the way the o…
totally-not-ai[bot] Sep 20, 2026
ff27ef9
feat: send a hash of the JavaScript rather than the Java that declare…
totally-not-ai[bot] Sep 21, 2026
6fee071
fix: add the functions a generated file is missing, and never take an…
totally-not-ai[bot] Sep 21, 2026
cc18bec
feat: send what an invocation runs as a constant, the same way for both
totally-not-ai[bot] Sep 21, 2026
13fc0ba
fix: read what an invocation runs through the constants in the MPR fi…
totally-not-ai[bot] Sep 21, 2026
123eac8
refactor: send only the function to run, and name it in the bundle in…
totally-not-ai[bot] Sep 21, 2026
3830cb9
fix: add the registry a name is assigned into when a file has none
totally-not-ai[bot] Sep 21, 2026
a7ff87c
refactor: read what an invocation runs out of the pool, and say what …
totally-not-ai[bot] Sep 21, 2026
bdbe8c1
docs: say when the constants are taken in a second time
totally-not-ai[bot] Sep 21, 2026
3cfe77f
refactor: take the constants of a message in once, and say so once
totally-not-ai[bot] Sep 21, 2026
28c928f
fix: let a key that arrives again name what the pool already holds
totally-not-ai[bot] Sep 21, 2026
ee70681
refactor: name the function in an object, so nothing else can look li…
totally-not-ai[bot] Sep 21, 2026
a22affb
test: pin that a string constant is an expression, whatever it reads …
totally-not-ai[bot] Sep 21, 2026
2d766be
refactor: say one thing about a method that is wrong in two ways
totally-not-ai[bot] Sep 21, 2026
39953e1
docs: say that the guard keeps the lists apart, not that it changes a…
totally-not-ai[bot] Sep 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,17 @@ private static boolean needsBuildInternal(Options options,
((ObjectNode) statsJson.get(FRONTEND_HASHES_STATS_KEY)).remove(
FrontendUtils.GENERATED + FrontendUtils.COMMERCIAL_BANNER_JS);

if (jsDefinitionsChanged(options, statsJson)) {
UsageStatistics.markAsUsed(
"flow/rebundle-reason-changed-js-definitions", null);
return true;
}
// JavaScript definition file hash has already been checked
// removing it from hashes map to prevent other unnecessary checks
((ObjectNode) statsJson.get(FRONTEND_HASHES_STATS_KEY))
.remove(FrontendUtils.GENERATED
+ FrontendUtils.JS_DEFINITIONS_FILE_NAME);

if (!BundleValidationUtil.frontendImportsFound(statsJson, options)) {
UsageStatistics.markAsUsed(
"flow/rebundle-reason-missing-frontend-import", null);
Expand Down Expand Up @@ -993,6 +1004,37 @@ private static boolean isCommercialBannerConditionChanged(Options options,
return false;
}

/**
* Checks whether the JavaScript that the {@code @JsDefinition} interfaces
* of the application declare differs from what the bundle was built with.
* <p>
* The functions are generated into the bundle, so a declaration that
* changed, a definition that was added and a bundle built before any
* definition existed all mean that the bundle no longer contains what a
* call would look up, which shows up at runtime as a call that cannot be
* run.
*/
private static boolean jsDefinitionsChanged(Options options,
JsonNode statsJson) {
JsonNode frontendHashes = statsJson.get(FRONTEND_HASHES_STATS_KEY);
String jsDefinitionsPath = FrontendUtils.GENERATED
+ FrontendUtils.JS_DEFINITIONS_FILE_NAME;
String content = new TaskGenerateJsDefinitions(options)
.getFileContent();

List<String> faultyContent = new ArrayList<>();
compareFrontendHashes(frontendHashes, faultyContent, jsDefinitionsPath,
content);
if (!faultyContent.isEmpty()) {
// Either the declarations changed, or the bundle was built before
// they existed and carries none of their JavaScript
getLogger().info(
"Detected JavaScript declared by the JavaScript definitions that the bundle does not carry");
return true;
}
return false;
}

private static Map<String, String> getRemainingImports(
List<String> jarImports, List<String> projectImports,
JsonNode frontendHashes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class NodeTasks implements FallibleCommand {
TaskGenerateWebComponentHtml.class,
TaskGenerateWebComponentBootstrap.class,
TaskGenerateFeatureFlags.class,
TaskGenerateJsDefinitions.class,
TaskInstallFrontendBuildPlugins.class,
TaskUpdatePackages.class,
TaskRunNpmInstall.class,
Expand Down Expand Up @@ -262,6 +263,8 @@ public NodeTasks(Options options) {

commands.add(new TaskGenerateFeatureFlags(options));

commands.add(new TaskGenerateJsDefinitions(options));

if (options.getJarFiles() != null
&& options.getJarFrontendResourcesFolder() != null) {
commands.add(new TaskCopyFrontendFiles(options));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import static com.vaadin.flow.internal.FrontendUtils.INDEX_JS;
import static com.vaadin.flow.internal.FrontendUtils.INDEX_TS;
import static com.vaadin.flow.internal.FrontendUtils.INDEX_TSX;
import static com.vaadin.flow.internal.FrontendUtils.JS_DEFINITIONS_FILE_NAME;

/**
* A task for generating the bootstrap file
Expand Down Expand Up @@ -83,6 +84,8 @@ protected String getFileContent() {
for (TypeScriptBootstrapModifier modifier : modifiers) {
modifier.modify(lines, options);
}
lines.add(0,
String.format("import './%s';%n", JS_DEFINITIONS_FILE_NAME));
lines.add(0,
String.format("import './%s';%n", FEATURE_FLAGS_FILE_NAME));
return String.join(System.lineSeparator(), lines);
Expand Down
Loading
Loading