Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -14,12 +14,11 @@
* the License.
*/

// TypeScript port of com.vaadin.client.ApplicationConfiguration, built alongside
// the Java version. A holder for the per-UI bootstrap configuration (service /
// context URLs, UI id, heartbeat / message-suspend timeouts, production mode,
// versions, dev-tools / live-reload settings). In Java it is a @JsType exported
// as window.Vaadin.Flow.internal.ApplicationConfiguration; the bootstrap
// populates it via the setters before the engine starts.
// TypeScript port of com.vaadin.client.ApplicationConfiguration. A holder for
// the per-UI bootstrap configuration (service / context URLs, UI id, heartbeat /
// message-suspend timeouts, production mode, versions, dev-tools / live-reload
// settings). The bootstrap populates it via the setters before the engine
// starts.

import { Console } from './Console';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ interface Atmosphere {
unsubscribeUrl: (url: string) => void;
}

// The Atmosphere connection callbacks, supplied from the Java side already
// wrapped in $entry (so uncaught exceptions reach GWT's handler). The
// getLastSeenServerSyncId value supplier is deliberately not $entry-wrapped, to
// mirror the original JSNI.
// The Atmosphere connection callbacks. The Java version wrapped these in $entry
// so that uncaught exceptions reached GWT's handler, except for the
// getLastSeenServerSyncId value supplier; here they are plain functions and
// exceptions surface through the browser.
interface AtmosphereCallbacks {
onOpen: (response: unknown) => void;
onReopen: (response: unknown) => void;
Expand Down
5 changes: 2 additions & 3 deletions flow-client/src/main/frontend/internal/Bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function atmosphereJsVersion(): string {

/**
* Wraps the raw bootstrap config object as a JsoConfiguration. getConfigInteger
* and getAtmosphereJSVersion are inlined here (they stay Java-native in the GWT
* and getAtmosphereJSVersion are inlined here (they were Java-native in the GWT
* build for deferred-binding reasons; see JsoConfiguration.ts).
*/
function toJsoConfiguration(rawConfig: unknown): JsoConfiguration {
Expand Down Expand Up @@ -179,8 +179,7 @@ export function startApplicationImmediately(): boolean {

/**
* Defers starting the application until the WebComponents polyfill signals it
* is ready, by running the (already $entry-wrapped) callback on the
* WebComponentsReady event.
* is ready, by running the callback on the WebComponentsReady event.
*/
export function deferStartApplication(callback: () => void): void {
window.addEventListener('WebComponentsReady', callback);
Expand Down
3 changes: 1 addition & 2 deletions flow-client/src/main/frontend/internal/ConstantPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* the License.
*/

// TypeScript port of com.vaadin.client.flow.ConstantPool, built alongside the
// Java version.
// TypeScript port of com.vaadin.client.flow.ConstantPool.

import { assert } from './assert';

Expand Down
9 changes: 4 additions & 5 deletions flow-client/src/main/frontend/internal/DefaultRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/

// TypeScript port of com.vaadin.client.DefaultRegistry — the concrete service
// assembly used by ApplicationConnection. It instantiates the ported TS services
// in dependency order (initialization order matters: later constructors read
// earlier services via the getters) and exposes the typed getters every service
// resolves its collaborators through. This is the cutover-assembly step that
// takes the build-alongside TS engine into use.
// assembly used by ApplicationConnection. It instantiates the services in
// dependency order (initialization order matters: later constructors read earlier
// services via the getters) and exposes the typed getters every service resolves
// its collaborators through.
//
// Push is wired via the AtmospherePushConnection factory, so setPushEnabled(true)
// creates a real Atmosphere connection (loading vaadinPush.js on demand).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,15 @@
* the License.
*/

// The executeJs context-object builder migrated from
// ExecuteJavaScriptProcessor.java, registered on
// window.Vaadin.Flow.internal.ExecuteJavaScriptProcessor by registerInternals;
// the Java method delegates here. The callbacks are supplied from the Java side
// already wrapped in $entry (so exceptions thrown asynchronously from the
// executed script still reach GWT's uncaught-exception handler). The element ->
// node resolution (getNode) keeps its $entry boundary on the Java side; here we
// only assemble the object the executed script runs against. Also bundled to
// ES5 for the HtmlUnit used by GwtTests.
// TypeScript port of com.vaadin.client.flow.ExecuteJavaScriptProcessor.
//
// The ExecuteJavaScriptProcessor class below is the build-alongside TS port of
// the rest of ExecuteJavaScriptProcessor.java: it decodes the invocation
// parameters, defers until any referenced node is bound, then manifests and runs
// the expression against a context wired to the ExecuteJavaScriptElementUtils
// callbacks. Composes the ported decoders / invokeJavaScript /
// getContextExecutionObject / element-utils / needsRebind. The Registry/StateTree
// are contracts satisfied at cutover.
// getContextExecutionObject assembles the object a server-sent script runs
// against (its `this`). The ExecuteJavaScriptProcessor class decodes the
// invocation parameters, defers until any referenced node is bound, then
// manifests and runs the expression against that context, wired to the
// ExecuteJavaScriptElementUtils callbacks. The Registry/StateTree slices it needs
// are declared here as narrow contracts rather than imported, to keep the
// dependency one-way.

import { needsRebind } from './binding/SimpleElementBindingStrategy';
import { decodeStateNode, decodeWithTypeInfo } from './ClientJsonCodec';
Expand All @@ -54,7 +46,7 @@ const TYPE_PROPERTY = 'type';
const INJECT_BY_ID = '@id';
const TEMPLATE_IN_TEMPLATE = 'subTemplate';

// The $entry-wrapped callbacks the executed script invokes via its context.
// The callbacks the executed script invokes via its context.
// attachExistingElement / populateModelProperties / registerUpdatableModelProperties
// take a resolved StateNode (looked up via getNode); the rest take their
// arguments directly.
Expand Down
6 changes: 3 additions & 3 deletions flow-client/src/main/frontend/internal/ExistingElementMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* the License.
*/

// TypeScript port of com.vaadin.client.ExistingElementMap, built alongside the
// Java version. Maps between a server-side node id requested to attach to an
// existing client-side element and that element.
// TypeScript port of com.vaadin.client.ExistingElementMap. Maps between a
// server-side node id requested to attach to an existing client-side element
// and that element.

/** Bidirectional mapping between server-side node ids and existing elements. */
export class ExistingElementMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
* the License.
*/

// TypeScript port of com.vaadin.client.InitialPropertiesHandler, built alongside
// the Java version on top of the TS reactive core. It prevents client-side
// TypeScript port of com.vaadin.client.InitialPropertiesHandler, on top of the
// TS reactive core. It prevents client-side
// default property values of newly created nodes from overriding the initial
// values the server sent: property updates for a node created during a server
// update are queued, and on flush each is either reset to the server's initial
// value or sent to the server (if the server had no initial value for it).
//
// The Registry/StateTree it talks to are not ported yet, so the slices it needs
// are declared here as contracts the future TS Registry/StateTree satisfy at
// cutover; this is the real implementation of the InitialPropertiesHandler
// contract that StateTree.ts already declares.
// The Registry/StateTree slices it needs are declared here as narrow contracts
// rather than imported, to keep the dependency one-way; this is the
// implementation of the InitialPropertiesHandler contract StateTree.ts declares.

import { Reactive } from './reactive/reactive';
import { NodeFeatures } from './nodefeature/NodeFeatures';
Expand Down
4 changes: 2 additions & 2 deletions flow-client/src/main/frontend/internal/SharedUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

// TypeScript port of the full public API of
// com.vaadin.flow.shared.util.SharedUtil, built alongside the Java version.
// Java-private helpers are kept as non-exported module-local functions.
// com.vaadin.flow.shared.util.SharedUtil. Java-private helpers are kept as
// non-exported module-local functions.

/**
* Adds the given query parameters to a URI, before any fragment. Mirrors
Expand Down
14 changes: 7 additions & 7 deletions flow-client/src/main/frontend/internal/SystemErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ export function handleError(
return systemErrorContainer;
}

// The SystemErrorHandler class is the build-alongside TS port of the
// orchestration in SystemErrorHandler.java, composing the DOM rendering above.
// This installment covers the logging / web-component-mode / recreate-web-
// components orchestration; the unrecoverable-error notification flow
// (handleUnrecoverableError) and the web-component session resynchronization
// (resynchronizeSession, XHR + heartbeat/push/reset) are DOM/network-bound and
// IT-validated. The Registry is a contract satisfied at cutover.
// The SystemErrorHandler class is the TS port of the orchestration in
// SystemErrorHandler.java, composing the DOM rendering above: the logging /
// web-component-mode / recreate-web-components handling, the unrecoverable-error
// notification flow (handleUnrecoverableError) and the web-component session
// resynchronization (resynchronizeSession, XHR + heartbeat/push/reset). The
// latter two are DOM/network-bound and covered by ITs rather than unit tests. The
// Registry is referenced through the narrow contract declared here.

/** A system message (caption/message/url), as configured for unrecoverable errors. */
interface SystemMessage {
Expand Down
3 changes: 1 addition & 2 deletions flow-client/src/main/frontend/internal/TrackingScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* the License.
*/

// TypeScript port of com.vaadin.client.TrackingScheduler, built alongside the
// Java version. It defers commands and reports whether any deferred work is
// TypeScript port of com.vaadin.client.TrackingScheduler. It defers commands and reports whether any deferred work is
// queued or in progress (used e.g. by TestBench to know when the client is
// idle). The GWT SchedulerImpl.scheduleDeferred maps to setTimeout(fn, 0); the
// tracking decrement is scheduled right after the command so it runs once the
Expand Down
4 changes: 2 additions & 2 deletions flow-client/src/main/frontend/internal/TreeChangeProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* the License.
*/

// TypeScript port of com.vaadin.client.flow.TreeChangeProcessor, built alongside
// the Java version on top of the TS state tree. It applies a batch of
// TypeScript port of com.vaadin.client.flow.TreeChangeProcessor, on top of the
// TS state tree. It applies a batch of
// server-sent JSON changes (attach/detach, map put/remove, list splice/clear,
// feature populate) to the StateTree. Changes are plain JS objects; values are
// passed through ClientJsonCodec.decodeWithoutTypeInfo (a no-op in JS).
Expand Down
6 changes: 2 additions & 4 deletions flow-client/src/main/frontend/internal/WidgetUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
* the License.
*/

// Implementations migrated from WidgetUtil.java, registered on
// window.Vaadin.Flow.internal.WidgetUtil by registerInternals; the Java methods
// delegate here. This module is also bundled to ES5 for the (old) HtmlUnit used
// by GwtTests, so it avoids newer syntax and the unicode regex flag.
// Implementations migrated from WidgetUtil.java: the low-level DOM / JS property
// helpers the rest of the engine uses.
//
// WidgetUtil.crazyJsCast and crazyJsoCast are intentionally not ported: they are
// GWT-compiler-only artifacts whose sole purpose is to make the Java compiler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/

// TypeScript port of the binding-layer contracts
// com.vaadin.client.flow.binding.BindingStrategy and BinderContext, built
// alongside the Java versions. They reference each other, so they live in one
// module. The Java BindingStrategy.getTag default routes through PolymerUtils
// (not ported yet), so it is optional here and wired at cutover.
// com.vaadin.client.flow.binding.BindingStrategy and BinderContext. They
// reference each other, so they live in one module. The Java
// BindingStrategy.getTag default routes through PolymerUtils, so it is optional
// here and supplied by the implementing strategies.

import type { StateNode } from '../StateNode';

Expand Down
6 changes: 3 additions & 3 deletions flow-client/src/main/frontend/internal/binding/Debouncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* the License.
*/

// TypeScript port of com.vaadin.client.flow.binding.Debouncer, built alongside
// the Java version. The GWT elemental Timer is mapped to setTimeout (one-shot,
// schedule) / setInterval (scheduleRepeating).
// TypeScript port of com.vaadin.client.flow.binding.Debouncer. The GWT elemental
// Timer of the original is mapped to setTimeout (one-shot, schedule) /
// setInterval (scheduleRepeating).

import { MapProperty } from '../nodefeature/MapProperty';

Expand Down
Loading
Loading