jstuyts commented on PR #1498:
URL: https://github.com/apache/wicket/pull/1498#issuecomment-4822497437

   @bitstorm I've had to do some research to understand what is possible with 
`<script>`. As usual with HTML, it is quite complex. References can only be 
classic scripts or modules, while inline content can be classic scripts, 
modules, import maps, speculation rules and data blocks: 
https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
   
   So I think the current implementation of reference header item classes with 
`JavaScriptReferenceType`, correctly reflects what is allowed.
   
   What I think is needed are:
   
   * The addition of a attribute `type` to `JavaScriptContentHeaderItem`, with 
its own type hierarchy instead of reusing `JavaScriptReferenceType`.
   * Specialized classes for import maps and speculation rules, to provide a 
nice API to construct these instead of having to generate JSON yourself with 
`JavaScriptContentHeaderItem`. Because of the flexibility of import maps and 
(probably) speculation rules, these specialized classes may have limitations.
   
   With these changes Wicket will prevent the user from making (some) mistakes, 
while still allowing full control if needed.
   
   It will look like this. Green types already exists, purple ones are new:
   <img width="1678" height="623" alt="afbeelding" 
src="https://github.com/user-attachments/assets/9337cb7c-de60-4581-a449-4c12fc277f6a";
 />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to