This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch feature/coffeescript-to-typescript in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
commit 488e55ab72b844dd0914d8f53bfa78adac270e2d Author: Thiago H. de Paula Figueiredo <[email protected]> AuthorDate: Sat May 3 08:18:56 2025 -0300 TAP5-2804: fixing imports and JSDoc --- 5_10_RELEASE_NOTES.md | 7 +- tapestry-core/src/main/typescript/package.json | 6 +- .../main/typescript/src/t5/core/ajaxformloop.ts | 3 +- .../src/main/typescript/src/t5/core/alert.ts | 1 - .../main/typescript/src/t5/core/autocomplete.ts | 1 - .../main/typescript/src/t5/core/confirm-click.ts | 1 - .../src/main/typescript/src/t5/core/datefield.ts | 3 +- .../typescript/src/t5/core/exception-display.ts | 1 - .../main/typescript/src/t5/core/exception-frame.ts | 1 - .../main/typescript/src/t5/core/form-fragment.ts | 2 - .../src/main/typescript/src/t5/core/graphviz.ts | 1 - .../src/main/typescript/src/t5/core/init.ts | 1 - .../src/main/typescript/src/t5/core/localdate.ts | 3 +- .../src/t5/core/{messages.ts => messages-amd.ts} | 50 ++++----- .../t5/core/{messages.ts => messages-es-module.ts} | 4 +- .../src/main/typescript/src/t5/core/messages.ts | 39 ++----- .../src/main/typescript/src/t5/core/pageinit.ts | 112 +++++++++++---------- .../src/main/typescript/src/t5/core/palette.ts | 9 +- .../src/main/typescript/src/t5/core/select.ts | 1 - .../typescript/src/t5/core/t5-core-dom-jquery.ts | 4 + .../src/t5/core/t5-core-dom-prototype.ts | 4 + .../main/typescript/src/t5/core/time-interval.ts | 1 - .../src/main/typescript/src/t5/core/tree.ts | 1 - .../src/main/typescript/src/t5/core/types.ts | 2 +- .../src/main/typescript/src/t5/core/validation.ts | 4 +- .../main/typescript/src/t5/core/zone-refresh.ts | 1 - .../src/main/typescript/src/t5/core/zone.ts | 2 +- tapestry-core/src/main/typescript/tsconfig.json | 6 +- 28 files changed, 122 insertions(+), 149 deletions(-) diff --git a/5_10_RELEASE_NOTES.md b/5_10_RELEASE_NOTES.md index 0bc1af18a..8bb02a0a8 100644 --- a/5_10_RELEASE_NOTES.md +++ b/5_10_RELEASE_NOTES.md @@ -2,7 +2,7 @@ Scratch pad for changes destined for the 5.10.0 release notes page. # Added configuration symbols -* `tapestry.es-module-path-prefix` (`SymbolConstants.ES_MODULE_PATH_PREFIX`) +* `tapestry.es-modules-enabled`(`SymbolConstants.ES_MODULES_ENABLED`) # Added methods @@ -22,8 +22,9 @@ Scratch pad for changes destined for the 5.10.0 release notes page. # Non-backward-compatible changes -Using Require.js and AMD modules, modules that used to return a function -now return an object with a `default` property with the function. +When using Require.js and AMD modules, from Tapestry 5.10.0 on, +the previously returned objects, functions or values are now +the `default` property of the object received from `require()`. This is a consequence we couldn't avoid from the CoffeeScript to JavaScript to TypeScript conversion. diff --git a/tapestry-core/src/main/typescript/package.json b/tapestry-core/src/main/typescript/package.json index 559028228..2171b0df8 100644 --- a/tapestry-core/src/main/typescript/package.json +++ b/tapestry-core/src/main/typescript/package.json @@ -12,11 +12,13 @@ }, "scripts": { "build": "npm run build-es-module; npm run build-amd", - "build-es-module": "npx tsc --outDir ../resources/META-INF/assets/es-modules/t5/", - "build-amd": "npx tsc --module amd --outDir ../resources/META-INF/modules/t5/", + "build-es-module": "npx tsc --outDir ../resources/META-INF/assets/es-modules/t5/; npm run rename-es-module;", + "build-amd": "npx tsc --module amd --outDir ../resources/META-INF/modules/t5/; npm run rename-amd;", "clean-amd": "rm -rf ../resources/META-INF/modules/t5/core/*; rm -rf ../resources/META-INF/modules/t5/beanvalidation/*;", "clean-es-module": "rm -rf ../resources/META-INF/assets/es-modules/t5/core/*; ../resources/META-INF/assets/es-modules/t5/beanvalidation/*", "clean": "npm run clean-amd; npm run clean-es-module", + "rename-amd": "mv ../resources/META-INF/modules/t5/core/messages-amd.js ../resources/META-INF/modules/t5/core/messages.js", + "rename-es-module": "mv ../resources/META-INF/assets/es-modules/t5/core/messages-es-module.js ../resources/META-INF/assets/es-modules/t5/core/messages.js", "docs": "typedoc", "clean-docs": "rm -rf docs" }, diff --git a/tapestry-core/src/main/typescript/src/t5/core/ajaxformloop.ts b/tapestry-core/src/main/typescript/src/t5/core/ajaxformloop.ts index a4dbef2bc..ce5f8587d 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/ajaxformloop.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/ajaxformloop.ts @@ -17,11 +17,10 @@ * * Provides handlers related to the core/AjaxFormLoop component (as well as core/AddRowLink and * core/RemoveRowLink). - * @packageDocumentation */ import dom from "t5/core/dom"; import events from "t5/core/events"; -import console from "t5/core/console.js" +import console from "t5/core/console" import ajax from "t5/core/ajax"; import { ElementWrapper, ResponseWrapper } from "t5/core/types"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/alert.ts b/tapestry-core/src/main/typescript/src/t5/core/alert.ts index 0ee77c18b..a4c05439b 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/alert.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/alert.ts @@ -16,7 +16,6 @@ * ## t5/core/alert * * Support for the core/Alerts components. - * @packageDocumentation */ import dom from "t5/core/dom"; import console from "t5/core/console"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/autocomplete.ts b/tapestry-core/src/main/typescript/src/t5/core/autocomplete.ts index 39fcedf88..a9a11d8aa 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/autocomplete.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/autocomplete.ts @@ -17,7 +17,6 @@ * * Support for the core/Autocomplete Tapestry mixin, a wrapper around * the Twitter autocomplete.js library. - * @packageDocumentation */ import dom from "t5/core/dom"; import underscore from "underscore"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/confirm-click.ts b/tapestry-core/src/main/typescript/src/t5/core/confirm-click.ts index 6c309edf7..b722c8cef 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/confirm-click.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/confirm-click.ts @@ -2,7 +2,6 @@ * ## t5/core/confirm-click * * Support for the Tapestry Confirm mixin, and for running confirmation dialogs programmatically. - * @packageDocumentation */ import $ from "jquery"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/datefield.ts b/tapestry-core/src/main/typescript/src/t5/core/datefield.ts index 93b982f7c..b4ab62201 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/datefield.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/datefield.ts @@ -16,7 +16,6 @@ * ## t5/core/datefield * * Provides support for the `core/DateField` component. - * @packageDocumentation */ import dom from "t5/core/dom"; import events from "t5/core/events"; @@ -38,7 +37,7 @@ const days = (messages("date-symbols.days")).split(","); // Shuffle sunday to the end, so that monday is first. -days.push(days.shift()); +days.push(days.shift()!); const monthsLabels = (messages("date-symbols.months")).split(","); let abbreviateWeekDay = (name: string) => name.substr(0, 1).toLowerCase(); diff --git a/tapestry-core/src/main/typescript/src/t5/core/exception-display.ts b/tapestry-core/src/main/typescript/src/t5/core/exception-display.ts index 2a5ba75b5..39979729c 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/exception-display.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/exception-display.ts @@ -17,7 +17,6 @@ * * Provides dynamic behavior for the t5/core/ExceptionDisplay component; specifically, * filtering the stack trace. - * @packageDocumentation */ import dom from "t5/core/dom"; import { ElementWrapper } from "t5/core/types"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts b/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts index eb6e961b3..356f2fa6a 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts @@ -20,7 +20,6 @@ * * Manages a special element used to present an HTML exception report from an Ajax request (where a non-markup response * was expected, including a partial page render response). - * @packageDocumentation */ import dom from "t5/core/dom"; import { AddableContent, ElementWrapper } from "t5/core/types"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/form-fragment.ts b/tapestry-core/src/main/typescript/src/t5/core/form-fragment.ts index 164de1f31..02082f288 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/form-fragment.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/form-fragment.ts @@ -14,8 +14,6 @@ * ## t5/core/form-fragment * * JavaScript code for the `core/FormFragment` component. - * - * @packageDocumentation */ import _ from "underscore"; import dom from "t5/core/dom"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/graphviz.ts b/tapestry-core/src/main/typescript/src/t5/core/graphviz.ts index 352245332..0c126b145 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/graphviz.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/graphviz.ts @@ -16,7 +16,6 @@ * ## t5/core/graphviz * * Support to the core/Graphviz Tapestry component. - * @packageDocumentation */ import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/graphviz.js"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/init.ts b/tapestry-core/src/main/typescript/src/t5/core/init.ts index 7ddc685c8..883d8ff18 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/init.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/init.ts @@ -22,7 +22,6 @@ * * Compatibility module, invokes functions on the T5.initializers namespace. * Introduced in 5.4, to be removed at some point in the future, when T5.initializers is itself no more. - * @packageDocumentation */ import console from "t5/core/console"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/localdate.ts b/tapestry-core/src/main/typescript/src/t5/core/localdate.ts index 2dffeafae..2d0a59a6b 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/localdate.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/localdate.ts @@ -22,9 +22,8 @@ * * Used with the LocalDate component to present a Date in a particular format, in the * browser's time zone. - * @packageDocumentation */ -import dom from "t5/core/dom.js" +import dom from "t5/core/dom" import moment from "t5/core/moment"; const ATTR = "data-localdate-format"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/messages.ts b/tapestry-core/src/main/typescript/src/t5/core/messages-amd.ts similarity index 68% copy from tapestry-core/src/main/typescript/src/t5/core/messages.ts copy to tapestry-core/src/main/typescript/src/t5/core/messages-amd.ts index 3662c61fe..ed4571b6c 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/messages.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/messages-amd.ts @@ -34,31 +34,25 @@ * @packageDocumentation */ -import _ from "underscore"; -import console from "t5/core/console"; - -// In the unexpected case that the data-locale attribute is missing, assume English -const locale = (document.documentElement.getAttribute("data-locale")) || "en"; - -let messages: any = {}; -import(`t5/core/messages/${locale}`).then((m: any) => messages = m); - -// Returns the application message catalog message for the given key. Returns -// a placeholder if the key is not found. -const get = function(key: string) { - const value = messages[key]; - - if (value) { - return value; - } else { - console.error(`No value for message catalog key '${key}' exists.`); - return `[[Missing Key: '${key}']]`; - } -}; - -// Returns all keys that are defined by the underlying catalog, in no specific order. -get.keys = () => _.keys(messages); - - -// Export get as the main function. -export default get; + var locale; + + locale = (document.documentElement.getAttribute("data-locale")) || "en"; + + // @ts-ignore + define(["t5/core/messages/" + locale, "underscore", "t5/core/console"], function(messages, _, console) { + var get; + get = function(key) { + var value; + value = messages[key]; + if (value) { + return value; + } else { + console.error("No value for message catalog key '" + key + "' exists."); + return "[[Missing Key: '" + key + "']]"; + } + }; + get.keys = function() { + return _.keys(messages); + }; + return get; + }); diff --git a/tapestry-core/src/main/typescript/src/t5/core/messages.ts b/tapestry-core/src/main/typescript/src/t5/core/messages-es-module.ts similarity index 96% copy from tapestry-core/src/main/typescript/src/t5/core/messages.ts copy to tapestry-core/src/main/typescript/src/t5/core/messages-es-module.ts index 3662c61fe..afd3d4d8a 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/messages.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/messages-es-module.ts @@ -40,8 +40,8 @@ import console from "t5/core/console"; // In the unexpected case that the data-locale attribute is missing, assume English const locale = (document.documentElement.getAttribute("data-locale")) || "en"; -let messages: any = {}; -import(`t5/core/messages/${locale}`).then((m: any) => messages = m); +// @ts-ignore +let messages: any = await import(`t5/core/messages/${locale}`); // Returns the application message catalog message for the given key. Returns // a placeholder if the key is not found. diff --git a/tapestry-core/src/main/typescript/src/t5/core/messages.ts b/tapestry-core/src/main/typescript/src/t5/core/messages.ts index 3662c61fe..c1a0916a6 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/messages.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/messages.ts @@ -16,44 +16,19 @@ /** * ## t5/core/messages * - *For all of these modules, we've turned off CoffeeScript's normal outer function - * wrapper, as each module is just a call to `define()` with a function that fulfills - * the same purpose. This one is different, as it is necessary to compute one of the dependencies. - * On the server `t5/core/messages/<locale>` is actually generated dynamically, as is a simple - * mapping of message keys to message values, from the global application message catalog. - * - * This module provides access to localized messages from the Tapestry applications' server-side - * application message catalog (which is, itself, built from multiple resources, some provided by - * the framework, others provided by the application, or third-party libraries). - * - * Messages in the catalog that contain Java-style format specifiers are not included, as there - * is no facility for formatting those on the client. This is actually done as a simple test for the - * presence of the `%` character. In addition, any message key that begins with "private-" is - * assumed to contain sensitive data (such as database URLs or passwords) and will not be - * exposed to the client. + * Stub so other modules this one can compile. The ones actually used will + * be messages-amd.js and messages-es-module.js depending on whether + * ES modules or AMD/Require.js ones are used. + * * @packageDocumentation */ import _ from "underscore"; -import console from "t5/core/console"; - -// In the unexpected case that the data-locale attribute is missing, assume English -const locale = (document.documentElement.getAttribute("data-locale")) || "en"; - -let messages: any = {}; -import(`t5/core/messages/${locale}`).then((m: any) => messages = m); -// Returns the application message catalog message for the given key. Returns -// a placeholder if the key is not found. -const get = function(key: string) { - const value = messages[key]; +let messages: {[key: string]: string} = {}; - if (value) { - return value; - } else { - console.error(`No value for message catalog key '${key}' exists.`); - return `[[Missing Key: '${key}']]`; - } +const get = function(key: string): string { + return messages[key]; }; // Returns all keys that are defined by the underlying catalog, in no specific order. diff --git a/tapestry-core/src/main/typescript/src/t5/core/pageinit.ts b/tapestry-core/src/main/typescript/src/t5/core/pageinit.ts index 769545cb0..5100e68bd 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/pageinit.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/pageinit.ts @@ -19,7 +19,6 @@ * The module name may also indicate the function exported by the module, as a suffix following a colon: * e.g., "my/module:myfunc". * Any additional values in the initializer are passed to the function. The context of the function (this) is null. - * @packageDocumentation */ import _ from "underscore"; @@ -112,6 +111,12 @@ const invokeInitializer = function(tracker: () => any, qualifiedName: string, in // @ts-ignore return require([moduleName], function(moduleLib: any) { + + // If it's an AMD module generated by TypeScript and it has a default export, + // it gets wrapped, so we try to unwrap it here. + if (moduleLib != null && moduleLib.__esModule && moduleLib["default"] != null) { + moduleLib = moduleLib["default"]; + } try { // Some modules export nothing but do some full-page initialization, such as adding @@ -149,6 +154,59 @@ const invokeInitializer = function(tracker: () => any, qualifiedName: string, in }); }; + // Pre-loads a number of libraries in order. When the last library is loaded, + // invokes the callback (with no parameters). +function loadLibraries(libraries: string[], callback: () => any) { + // @ts-ignore + const reducer = (callback, library) => (function() { + console.debug(`Loading library ${library}`); + // @ts-ignore + return require([library], callback); + }); + + const finalCallback = _.reduceRight(libraries, reducer, callback); + + return finalCallback.call(null); +}; + + // Passed a list of initializers, executes each initializer in order. Due to asynchronous loading + // of modules, the exact order in which initializer functions are invoked is not predictable. + // @ts-ignore +function initialize(inits, callback) { + if (inits == null) { inits = []; } + console.debug(`Executing ${inits.length} inits`); + let callbackCountdown = inits.length + 1; + + // tracker gets invoked once after each require/callback, plus once extra + // (to handle the case where there are no inits). When the count hits zero, + // it invokes the callback (if there is one). + const tracker = function() { + callbackCountdown--; + + if (callbackCountdown === 0) { + console.debug("All inits executed"); + if (callback) { return callback(); } + } + }; + + // First value in each init is the qualified module name; anything after + // that are arguments to be passed to the identified function. A string + // is the name of a module to load, or function to invoke, that + // takes no parameters. + for (var init of Array.from(inits)) { + if (_.isString(init)) { + invokeInitializer(tracker, init, []); + } else { + // @ts-ignore + var [qualifiedName, ...initArguments] = Array.from(init); + // @ts-ignore + invokeInitializer(tracker, qualifiedName, initArguments); + } + } + + return tracker(); +} + // Loads all specified libraries in order (this includes the core stack, other stacks, and // any free-standing libraries). It then executes the initializations. Once all initializations have // completed (which is usually an asynchronous operation, as initializations may require the loading @@ -178,58 +236,10 @@ const loadLibrariesAndInitialize = function(libraries, inits) { }; export default exports_ = _.extend(loadLibrariesAndInitialize, { - // Passed a list of initializers, executes each initializer in order. Due to asynchronous loading - // of modules, the exact order in which initializer functions are invoked is not predictable. - // @ts-ignore - initialize(inits, callback) { - if (inits == null) { inits = []; } - console.debug(`Executing ${inits.length} inits`); - let callbackCountdown = inits.length + 1; - - // tracker gets invoked once after each require/callback, plus once extra - // (to handle the case where there are no inits). When the count hits zero, - // it invokes the callback (if there is one). - const tracker = function() { - callbackCountdown--; - - if (callbackCountdown === 0) { - console.debug("All inits executed"); - if (callback) { return callback(); } - } - }; - - // First value in each init is the qualified module name; anything after - // that are arguments to be passed to the identified function. A string - // is the name of a module to load, or function to invoke, that - // takes no parameters. - for (var init of Array.from(inits)) { - if (_.isString(init)) { - invokeInitializer(tracker, init, []); - } else { - // @ts-ignore - var [qualifiedName, ...initArguments] = Array.from(init); - // @ts-ignore - invokeInitializer(tracker, qualifiedName, initArguments); - } - } - - return tracker(); - }, - - // Pre-loads a number of libraries in order. When the last library is loaded, - // invokes the callback (with no parameters). - loadLibraries(libraries: string[], callback: () => any) { - // @ts-ignore - const reducer = (callback, library) => (function() { - console.debug(`Loading library ${library}`); - // @ts-ignore - return require([library], callback); - }); - const finalCallback = _.reduceRight(libraries, reducer, callback); + initialize: initialize, - return finalCallback.call(null); - }, + loadLibraries: loadLibraries, evalJavaScript(js: string) { console.debug(`Evaluating: ${js}`); diff --git a/tapestry-core/src/main/typescript/src/t5/core/palette.ts b/tapestry-core/src/main/typescript/src/t5/core/palette.ts index aeccf2c00..e9dc2d991 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/palette.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/palette.ts @@ -16,7 +16,6 @@ * ## t5/core/palette * * Support for the `core/Palette` component. - * @packageDocumentation */ import dom from "t5/core/dom"; import _ from "underscore"; @@ -35,7 +34,7 @@ class PaletteController { hidden: ElementWrapper; moveUp: ElementWrapper; moveDown: ElementWrapper; - doDeselectElement: ElementWrapper; + deselect: ElementWrapper; reorder: boolean; valueToOrderIndex: {}; @@ -46,7 +45,7 @@ class PaletteController { this.hidden = this.container.findFirst("input[type=hidden]")!; this.selected = this.container.findFirst("[data-action=select]")!; - this.doDeselectElement = this.container.findFirst("[data-action=deselect]")!; + this.deselect = this.container.findFirst("[data-action=deselect]")!; this.moveUp = this.container.findFirst("[data-action=move-up]")!; this.moveDown = this.container.findFirst("[data-action=move-down]")!; @@ -138,7 +137,7 @@ class PaletteController { }); // @ts-ignore - this.select.on("click", () => { + this.selected.on("click", () => { this.doSelect(); return false; }); @@ -180,7 +179,7 @@ class PaletteController { // should be enabled and which disabled. updateButtons() { // @ts-ignore - this.select.element.disabled = this.available.element.selectedIndex < 0; + this.selected.element.disabled = this.available.element.selectedIndex < 0; // @ts-ignore const nothingSelected = this.selected.element.selectedIndex < 0; diff --git a/tapestry-core/src/main/typescript/src/t5/core/select.ts b/tapestry-core/src/main/typescript/src/t5/core/select.ts index 88eaea104..c109caf8a 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/select.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/select.ts @@ -15,7 +15,6 @@ * * Provides a document event handler that triggers an update a zone when the value * of a select element within the zone changes. - * @packageDocumentation */ import events from "t5/core/events"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts index ed0d721ce..39afe9da9 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts @@ -10,6 +10,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * jQuery implementation of Tapestry's DOM wrappers. + */ + import type { ElementWrapper, EventWrapper, RequestWrapper, ResponseWrapper, ElementOffset, DOM, AddableContent, OnEventHandler, AjaxRequestOptions } from "t5/core/types"; import _ from "underscore"; import "t5/core/utils"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts index dde6ce2b9..ee4dd9ed3 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts @@ -10,6 +10,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * Prototype implementation of Tapestry's DOM wrappers. + */ + import type { ElementWrapper, EventWrapper, RequestWrapper, ResponseWrapper, ElementOffset, DOM, AddableContent, OnEventHandler, AjaxRequestOptions } from "t5/core/types"; import _ from "underscore"; import utils from "t5/core/utils"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/time-interval.ts b/tapestry-core/src/main/typescript/src/t5/core/time-interval.ts index 205d90d46..96bc5e339 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/time-interval.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/time-interval.ts @@ -17,7 +17,6 @@ * * Used with the Interval component to express the interval between two timestamps, * or the dynamic difference between now and an end point in the past or future. - * @packageDocumentation */ import dom from "t5/core/dom"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/tree.ts b/tapestry-core/src/main/typescript/src/t5/core/tree.ts index 07450fdfe..db9001ae7 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/tree.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/tree.ts @@ -16,7 +16,6 @@ * ## t5/core/tree * * Handlers to support to the core/Tree Tapestry component. - * @packageDocumentation */ import dom from "t5/core/dom"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/types.ts b/tapestry-core/src/main/typescript/src/t5/core/types.ts index 14fe5f771..5f0af6eae 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/types.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/types.ts @@ -11,7 +11,7 @@ // limitations under the License. /** - * Module defining some types used specially on `t5/core/dom`. + * Module defining some types used specially on `t5/core/dom` and `t5/core/zone`, among others. * @packageDocumentation */ diff --git a/tapestry-core/src/main/typescript/src/t5/core/validation.ts b/tapestry-core/src/main/typescript/src/t5/core/validation.ts index dd8c71b69..1a8dffded 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/validation.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/validation.ts @@ -27,8 +27,8 @@ import _ from "underscore"; import dom from "t5/core/dom"; import events from "t5/core/events"; import utils from "t5/core/utils"; -import messages from "t5/core/messages.js" -import { ElementWrapper }from "t5/core/types"; +import messages from "t5/core/messages"; +import { ElementWrapper } from "t5/core/types"; const REGEXP_META = "t5:regular-expression"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/zone-refresh.ts b/tapestry-core/src/main/typescript/src/t5/core/zone-refresh.ts index 00a3905d1..52fb3fc04 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/zone-refresh.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/zone-refresh.ts @@ -15,7 +15,6 @@ /** * ## t5/core/zone-refresh * - * @packageDocumentation */ import events from "t5/core/events"; diff --git a/tapestry-core/src/main/typescript/src/t5/core/zone.ts b/tapestry-core/src/main/typescript/src/t5/core/zone.ts index 420f97eeb..822e6da72 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/zone.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/zone.ts @@ -24,7 +24,7 @@ * @packageDocumentation */ -import dom from "t5/core/dom.js" +import dom from "t5/core/dom" import events from "t5/core/events"; import ajax from "t5/core/ajax"; import console from "t5/core/console"; diff --git a/tapestry-core/src/main/typescript/tsconfig.json b/tapestry-core/src/main/typescript/tsconfig.json index 2190f0d3f..43c0714b5 100644 --- a/tapestry-core/src/main/typescript/tsconfig.json +++ b/tapestry-core/src/main/typescript/tsconfig.json @@ -3,10 +3,10 @@ /* Visit https://aka.ms/tsconfig to read more about this file */ /* Language and Environment */ - "target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ /* Modules */ - "module": "nodenext", /* Specify what module code is generated. */ + "module": "ES2022", /* Specify what module code is generated. */ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "baseUrl": "src/", @@ -40,7 +40,7 @@ "include": [ "src/**/*.ts" ], - "exclude": ["node_modules", ".vscode"], + "exclude": ["node_modules", ".vscode", "src/t5/core/messages-amd.ts"], "typedocOptions": { "entryPoints": [
