-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WICKET-7066: Make type=module possible for JavascriptHeaderItem #598
Conversation
@@ -16,7 +16,10 @@ | |||
*/ | |||
package org.apache.wicket.markup.head; | |||
|
|||
import static org.apache.wicket.markup.head.JavascriptReferenceType.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wildcard imports please!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR adjusted
|
||
public enum JavascriptReferenceType { | ||
|
||
TEXT_JAVASCRIPT("text/javascript"), MODULE("module"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other types like importmap
?
Using an enum makes it hard to use custom values when/if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Martin,
thank you for your remark.
I just started with the approach using a simple String instead of an Enum.
But then I realized, that there are only two "real" types for Javascript-References: Javascript-Mimetype ( "text/javascript", "application/javascript", "application/ecmascript") and "module".
All other types imply that the src-Attribute is ignored and the "real content" is placed inside the body of the <script>-Tag. But this is not the intention of the AbstractJavaScriptReferenceHeaderItem.
The documentation I used: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type
Kind regards
Hans
*/ | ||
package org.apache.wicket.markup.head; | ||
|
||
public enum JavascriptReferenceType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public classes need javadoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR adjusted
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@hosea ping! :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks you!
No description provided.