[
https://issues.apache.org/jira/browse/WICKET-7187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095275#comment-18095275
]
ASF subversion and git services commented on WICKET-7187:
---------------------------------------------------------
Commit 4b8235f575e65cdd505d0ccde59860ae3cec353e in wicket's branch
refs/heads/master from Johan Stuyts
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=4b8235f575 ]
WICKET-7187 added type to JavaScript content header items. (#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.
> JavaScript header items: `module` for content, and import maps
> --------------------------------------------------------------
>
> Key: WICKET-7187
> URL: https://issues.apache.org/jira/browse/WICKET-7187
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Reporter: Johan Stuyts
> Priority: Major
>
> A number of JavaScript components has stopped providing
> [UMD|https://github.com/umdjs/umd] builds, and provide [ECMAScript
> modules|https://tc39.es/ecma262/#sec-modules] instead. To be able to use
> those modules, JavaScript in the header must also be a module. But currently
> it is not possible to specify the type for
> {{{}JavaScriptContentHeaderItem{}}}.
> Additionally, modules use "[bare
> modules|https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#bare_modules]"
> to import dependencies, and these bare modules need to be mapped to the URLs
> of resource references so the JavaScript can be loaded.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)