We have one product with 35-ish module files that rely on Tapestry modules (I searched for: "t5/") and another product with 10-ish modules.
I think most of our code is coded more directly against jQuery than against the t5 modules (we are mostly using the t5 functionality for receiving ajax responses and having access to constants etc.). I think most of our devs find it cumbersome to deal with the Tapestry specific modules and the somewhat foreign documentation vs. just going to the jQuery docs and relying on examples from the web. We are using the jQuery that Tapestry provides, but I guess that is not hard to fix, if that goes away. It would not be an impossible/crazy task to manually rewrite our affected code, especially not if we have a good recipe on how to do it. -- Chris On Mon, Jun 9, 2025 at 12:04 AM Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > Hello! > > TL;DR: do your Tapestry projects have JavaScript code that uses Tapestry's > own JS like t5/core/dom, t5/core/zone, t5/core/ajax, etc? How many JS files > have at least one of these dependencies? No exact numbers needed. We're > just trying to figure out the size of possible backward > compatibility problems. > > We've been working on improving the Tapestry's JavaScript support, > including support for ES6 modules[1], creating a non-Require.js mode (based > on ES6 modules) and converting Tapestry's own JavaScript sources from > CoffeeScript to TypeScript. > > The last part should help everyone developing Tapestry's JavaScript, since > CoffeeScript's syntax is way closer to Ruby than to JavaScript itself. In > addition, CoffeeScript is old and its last commit was more than 2.5 years > ago [2], while TypeScript is being actively developed and gaining adoption. > > There's one problem with TS's code generation, though: while it can output > both ES6 modules or AMD ones (the ones used by Require.js), the AMD > modules' exports are done in a bit different way. For example, if you have > this: > > define(["t5/core/dom", "t5/core/ajax"]], function(dom) { > var foo = dom("bar"); > ajax(...); > ); > > you'd need to change your code to > > define(["t5/core/dom"], function(dom) { > // The __importDefault function is generated by the Ts > // compiler and fixes the problem > dom = __importDefault(dom); > ajax = __importDefault(ajax); > var foo = dom("bar"); > ajax(...); > ); > > or > > define(["t5/core/dom", "t5/core/ajax"], function(dom) { > var foo = dom.default("bar"); // Notice the '.default' part > ajax.default(...); > ); > > Notice the changes would only need to be done once, when upgrading to > 5.10.0, and they're simple. > > This problem only happens for Require.js/AMD modules. If, after upgrading > to 5.10.0, your ES6 modules will import the ones provided by Tapestry > normally. There are tools for converting AMD modules to ES6 like > https://github.com/buxlabs/amd-to-es6. If you have a small number of > files, > doing it manually only takes a few minutes each at most (my own experience > while converting Tapestry's AMD modules to ES6) and your code will look > better and more modern in the end. > > We, the Tapestry team, would like to know whether this would be a problem > for your projects, especially if it would prevent upgrading from 5.7.0+ to > 5.10.0. With your feedback, we'll be able to define how to best use our > time, either trying to configure some source code transformation tool to > change TypeScript's output to avoid the problem above [3], creating a > migration tool or just investing in other Tapestry parts if this backward > incompatibility isn't a big deal for your projects. > > Thanks in advance. > > Cheers! > > [1] In other words, the modules supported by browsers using <script > type="module">. See > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules. > > [2] https://github.com/jashkenas/coffeescript/ > > [3] Something like the approach described in this article: > https://www.toptal.com/javascript/write-code-to-rewrite-your-code . > > -- > Thiago H. de Paula Figueiredo > Software developer/engineer > Apache Tapestry consultant, committer and project management committee > member > You can sponsor my work on Tapestry at > https://github.com/sponsors/machina-br >