jstuyts commented on PR #1498: URL: https://github.com/apache/wicket/pull/1498#issuecomment-4878937699
@bitstorm in my opinion, moving `type` to `JavaScriptHeaderItem` is the wrong approach. There are certain types (currently import maps and speculation rules) that can really benefit from a dedicated API. These sub types of `JavaScriptHeaderItem` would also inherit `type`, but ignore its value because they already know their type. With the type hierarchy in the schema above, the API is nicer: the user is prevented from making mistakes. Also, there is no need for breaking compatibility. The only "downside" is that 2 enum values of `JavaScriptReferenceType` (`TEXT_JAVASCRIPT` and `MODULE`) have to be duplicated in `JavaScriptWellKnownContentType`. I feel that the improvement of the API is worth it. What I can do is: make a PR for everything in the hierarchy above, except for `JavaScriptImportMapHeaderItem` and `JavaScriptSpeculationRulesHeaderItem` (which I was not going to build as I have found no use for it yet). I can create a separate PR for the import map later. This way, the type for content items will be available sooner. -- 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]
