Imrovement: Consolidate definition of type-Attribute for JavascriptHeaderItems

Open
#1,881 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Read the JavaScript header item classes named in the issue: JavaScriptReferenceType, JavaScriptContentType, JavaScriptBrowserProcessedContentType, and JavascriptHeaderItem. The issue says a pull request was prepared for Wicket 10 at https://github.com/apache/wicket/pull/1882; review that work to understand the proposed consolidation. The work is complete when the type attribute is defined consistently for all JavaScript header item subclasses.

Written by the indexing model from the issue text.

Description

There are two implementations for the same task: defining a value for the "type"-Attribute of a script-Tag:

  1. org.apache.wicket.markup.head.JavaScriptReferenceType for AbstractJavaScriptReferenceHeaderItem (and subclasses)
  2. org.apache.wicket.markup.head.JavaScriptContentType and org.apache.wicket.markup.head.JavaScriptBrowserProcessedContentType for JavascriptContentHeaderItem

Observation: all subclasses of JavascriptHeaderItems have (their own) solution to define a value for the "type"-Attribute

Conclusion: define the value for the "type"-Attribute in JavascriptHeaderItem - similar to the "id"-Attribute.

I personally like the style of the 2nd way with interface org.apache.wicket.markup.head.JavaScriptContentType but prefer to implement Constants directly in the Interface-Class.

I prepared a PR for this based on the Wicket 10 - Branch https://github.com/apache/wicket/pull/1882

Dominant language
Java
Stars
800
Forks
437
Avg merge
21h 36m
Merged PRs (30d)
167

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/wicket

All issues in apache/wicket

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.