Skip to content

WICKET-7187 10.x: added type to JavaScript content header items#1511

Merged
bitstorm merged 1 commit into
apache:wicket-10.xfrom
jstuyts:feature/WICKET-7187-10.x-type-for-content-header-item
Jul 10, 2026
Merged

WICKET-7187 10.x: added type to JavaScript content header items#1511
bitstorm merged 1 commit into
apache:wicket-10.xfrom
jstuyts:feature/WICKET-7187-10.x-type-for-content-header-item

Conversation

@jstuyts

@jstuyts jstuyts commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This is the 10.x version of #1498.

If the type is not set on the header item, almost everything works as before. The only change to current behavior is that `equals(...)` and `hashCode(...)` of `JavaScriptContentHeaderItem` now also use the type.

The type for JavaScript content header items are separate from the type for JavaScript reference header items because:

* Reference header items only support a subset of the browser-processed types: `text/javascript` and `module`.
* Using the same type for both types of header items would break backwards compatibility.
* Some browser-processed types (import maps and speculation rules) deserve a dedicated API. Setting the type on `JavaScriptHeaderItem` would result in an unclear API when subtypes for these browser-processed types are added: these types know their type and will ignore the type set on their base class.
@bitstorm bitstorm merged commit 7f2bb48 into apache:wicket-10.x Jul 10, 2026
3 checks passed
@jstuyts jstuyts deleted the feature/WICKET-7187-10.x-type-for-content-header-item branch July 10, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants