[
https://issues.apache.org/jira/browse/WICKET-7187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18090433#comment-18090433
]
ASF GitHub Bot commented on WICKET-7187:
----------------------------------------
jstuyts opened a new pull request, #1498:
URL: https://github.com/apache/wicket/pull/1498
Added type to JavaScript content header items, and added a JavaScript import
map header item.
The first attempt was to make a base class for
`AbstractJavaScriptReferenceHeaderItem` and `JavaScriptContentHeaderItem`, and
move the type to there. But `setType(...)` in the former returns
`AbstractJavaScriptReferenceHeaderItem`. Moving the type information up the
hierarchy would break backward compatibility. The (simple) code for managing
the type has simply been copied now.
`JavaScriptReferenceType` should be called `JavaScriptType` now, but that
would also break backward compatibility. This has been documented.
If the new features are not used, almost everything works as before. The
only change to current behavior is that `equals(...)` and `hashCode(...)` of
`JavaScriptContentHeaderItem` now also use the type.
> 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)