Skip to content

Bay.js v4.0.0

Latest

Choose a tag to compare

@Dunks1980 Dunks1980 released this 22 Oct 19:13
· 1 commit to main since this release

Bay.js 4.0.0 is a major release focused on security, reliability, and predictable rendering, with improvements to the template engine, component lifecycle, hydration, and event handling.

What's new

  • Safer HTML rendering: Dynamic strings are escaped by default. Trusted markup can be rendered explicitly using $bay.html().
  • Improved template security: Stronger validation of dynamic HTML, attributes, and script/style content.
  • Component lifecycle improvements: More reliable mounting, updates, and cleanup.
  • Hydration improvements: Better consistency between server-rendered and client-rendered content.
  • Event handling improvements: More predictable event bindings and modifiers.
  • Updated distribution files: ESM and classic JavaScript builds for different integration needs.
  • Updated documentation: New HTML rendering examples, revised security guidance, and updated interactive demos.

Breaking changes

Bay.js 4.0.0 introduces intentional breaking changes.

Dynamic HTML strings are no longer automatically treated as trusted markup.

// Trusted markup
$bay.html(trustedMarkup)

Applications using dynamic HTML, generated attributes, or script/style content within templates may require migration.

Review your existing templates before upgrading from v3.

Installation

npm install @dunks1980/bay.js@4.0.0

Documentation

https://bayjs.dunkerley.dev/

Testing

The release passed package regression tests, browser assertions, documentation example checks, and distribution compatibility tests.