Skip to content

Commit

Permalink
Remove YUI (#10135)
Browse files Browse the repository at this point in the history
<!-- Comment:
A great PR typically begins with the line below.
Replace XXXXX with the numeric part of the issue ID you created in Jira.
Note that if you want your changes backported into LTS, you need to
create a Jira issue. See
https://www.jenkins.io/download/lts/#backporting-process for more
information.
-->

See JENKINS-75100

Now that the [disable by default of
YUI](#10045) has been released
for ~1 month with no complaints its time to start thinking about
removing YUI itself.

We're passed the baseline cut-off for the next LTS which was what
@MarkEWaite requested that I wait for before removing YUI fully

What I've left:
* I've removed CSS where I think its safe but I haven't removed all
mentions of `yui`.
* `l:yui` I've changed it to do nothing but its used in a few
unmaintained plugins, I could remove this, thoughts?
* There's a few TODOs that say they could be cleaned up after yui was
removed for the component, but hasn't been done yet

ATH passed:
jenkinsci/acceptance-test-harness#1884
Bom: jenkinsci/bom#4176

<!-- Comment:
If the issue is not fully described in Jira, add more information here
(justification, pull request links, etc.).

 * We do not require Jira issues for minor improvements.
* Bug fixes should have a Jira issue to facilitate the backporting
process.
 * Major new features should have a Jira issue.
-->

### Testing done

Clicked around a number of pages and didn't see anything wrong.

<!-- Comment:
Provide a clear description of how this change was tested.
At minimum this should include proof that a computer has executed the
changed lines.
Ideally this should include an automated test or an explanation as to
why this change has no tests.
Note that automated test coverage is less than complete, so a successful
PR build does not necessarily imply that a computer has executed the
changed lines.
If automated test coverage does not exist for the lines you are
changing, you must describe the scenario(s) in which you manually tested
the change.
For frontend changes, include screenshots of the relevant page(s) before
and after the change.
For refactoring and code cleanup changes, exercise the code before and
after the change and verify the behavior remains the same.
-->

### Proposed changelog entries

- Remove the Yahoo! User Interface library

<!-- Comment:
The changelog entry should be in the imperative mood; e.g., write "do
this"/"return that" rather than "does this"/"returns that".
For examples, see: https://www.jenkins.io/changelog/

Do not include the Jira issue in the changelog entry.
Include the Jira issue in the description of the pull request so that
the changelog generator can find it and include it in the generated
changelog.

You may add multiple changelog entries if applicable by adding a new
entry to the list, e.g.
- First changelog entry
- Second changelog entry
-->

### Proposed upgrade guidelines

N/A

<!-- Comment:
Leave the proposed upgrade guidelines in the pull request with the "N/A"
value if no upgrade guidelines are needed.
The changelog generator relies on the presence of the upgrade guidelines
section as part of its data extraction process.
-->

```[tasklist]
### Submitter checklist
- [ ] The Jira issue, if it exists, is well-described.
- [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [ ] There is automated testing or an explanation as to why this change has no tests.
- [ ] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [ ] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [ ] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)).
- [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.
```

### Desired reviewers

@mention

<!-- Comment:
If you need an accelerated review process by the community (e.g., for
critical bugs), mention @jenkinsci/core-pr-reviewers.
-->

Before the changes are marked as `ready-for-merge`:

```[tasklist]
### Maintainer checklist
- [ ] There are at least two (2) approvals for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically.
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](#4387)).
- [ ] If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see [query](https://issues.jenkins.io/issues/?filter=12146)).
```
  • Loading branch information
krisstern authored Jan 12, 2025
2 parents d0aa978 + 45e27bb commit 9b6bc69
Show file tree
Hide file tree
Showing 206 changed files with 15 additions and 85,030 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ node/

# libraries / external deps / generated files
src/main/js/plugin-setup-wizard/bootstrap-detached.js
war/src/main/webapp/scripts/yui
war/src/main/webapp/jsbundles/
src/main/scss/_bootstrap.scss

Expand Down
15 changes: 6 additions & 9 deletions core/src/main/java/hudson/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -664,17 +664,14 @@ public static String validateIconSize(String iconSize) throws SecurityException
}

/**
* Gets the suffix to use for YUI JavaScript.
*/
public static String getYuiSuffix() {
return DEBUG_YUI ? "debug" : "min";
}

/**
* Set to true if you need to use the debug version of YUI.
* No longer used, to be removed after enough plugins have adopted a version of the test harness with
* <a href="https://github.com/jenkinsci/jenkins-test-harness/pull/874">jenkins-test-harness/pull/874</a> in it.
*
* @deprecated removed without replacement
*/
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "for script console")
public static boolean DEBUG_YUI = SystemProperties.getBoolean("debug.YUI");
@Deprecated(forRemoval = true, since = "TODO")
public static boolean DEBUG_YUI;

/**
* Creates a sub map by using the given range (both ends inclusive).
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion core/src/main/resources/lib/form/repeatable/repeatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var repeatableSupport = {
};

// do the ones that extract innerHTML so that they can get their original HTML before
// other behavior rules change them (like YUI buttons.)
// other behavior rules change them.
Behaviour.specify("DIV.repeated-container", "repeatable", -100, function (e) {
if (isInsideRemovable(e)) {
return;
Expand Down
30 changes: 1 addition & 29 deletions core/src/main/resources/lib/layout/layout.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -128,37 +128,9 @@ THE SOFTWARE.

<st:adjunct includes="org.kohsuke.stapler.bind"/>

<l:userExperimentalFlag var="removeYUI" flagClassName="jenkins.model.experimentalflags.RemoveYuiUserExperimentalFlag" />
<j:if test="${!removeYUI}">
<!-- To use the debug version of YUI, set the system property 'debug.YUI' to true -->
<j:set var="yuiSuffix" value="${h.yuiSuffix}" />
<l:yui module="yahoo" />
<l:yui module="dom" />
<l:yui module="event" />
<j:if test="${h.yuiSuffix=='debug'}">
<l:yui module="logger" />
</j:if>
<l:yui module="animation" />
<l:yui module="dragdrop" />
<l:yui module="container" />
<l:yui module="connection" />
<l:yui module="datasource" />
<l:yui module="autocomplete" />
<l:yui module="menu" />
<l:yui module="element" />
<l:yui module="button" />
<l:yui module="storage" />
</j:if>

<script src="${resURL}/scripts/hudson-behavior.js" type="text/javascript"></script>
<script src="${resURL}/scripts/sortable.js" type="text/javascript"/>

<j:if test="${!removeYUI}">
<link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
<link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/skins/sam/container.css" type="text/css"/>
<link rel="stylesheet" href="${resURL}/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" />
</j:if>

<l:hasPermission permission="${app.READ}">
<link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Jenkins" />
</l:hasPermission>
Expand All @@ -178,7 +150,7 @@ THE SOFTWARE.
<script src="${resURL}/jsbundles/sortable-drag-drop.js" type="text/javascript"/>
<script src="${resURL}/jsbundles/app.js" type="text/javascript" defer="true" />
</head>
<body id="jenkins" class="${removeYUI ? '' : 'yui-skin-sam'} ${layoutType} jenkins-${h.version}" data-version="${h.version}" data-model-type="${it.class.name}">
<body id="jenkins" class="${layoutType} jenkins-${h.version}" data-version="${h.version}" data-model-type="${it.class.name}">
<l:command-palette />

<j:if test="${layoutType!='full-screen'}">
Expand Down
7 changes: 1 addition & 6 deletions core/src/main/resources/lib/layout/side-panel.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ THE SOFTWARE.

<j:if test="${mode=='side-panel'}">
<div id="side-panel" class="app-page-body__sidebar ${attrs.sticky == 'true' ? 'app-page-body__sidebar--sticky' : ''}">
<d:invokeBody />
<!-- add YUI logger if debugging YUI -->
<j:if test="${h.yuiSuffix=='debug'}">
<!-- script to transform this into the Logger Console is done in hudson-behavior.js -->
<div id="yui-logreader" style="margin-top:1em"/>
</j:if>
<d:invokeBody />
</div>
</j:if>

Expand Down
13 changes: 3 additions & 10 deletions core/src/main/resources/lib/layout/yui.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<st:documentation>
Load Yahoo UI module.
<st:attribute name="module" use="required">
YUI module name to load.
Do not use this tag, YUI has been removed from Jenkins
<st:attribute name="module" deprecated="true">
Do not use this tag, YUI has been removed from Jenkins
</st:attribute>
</st:documentation>
<!--
We used to take @suffix as '-beta' to loa beta modules, but as of YUI 2.9 there's no beta module.
I don't think YUI2 will get new beta modules in the future, but if we do, we need to compute them
from the module name, since older plugins specify suffix="-beta" for modules that have graduated
beta since then.
-->
<script src="${resURL}/scripts/yui/${module}/${module}-${yuiSuffix}.js" />
</j:jelly>
1 change: 0 additions & 1 deletion eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = [
".pnp.cjs",
".pnp.loader.mjs",
"src/main/js/plugin-setup-wizard/bootstrap-detached.js",
"war/src/main/webapp/scripts/yui/*",
],
},
{
Expand Down
1 change: 0 additions & 1 deletion src/main/scss/base/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
@use "style";
@use "typography";
@use "visibility-utils";
@use "yui-compatibility";
17 changes: 0 additions & 17 deletions src/main/scss/base/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -670,23 +670,6 @@ table.progress-bar.red td.progress-bar-done {
}
}

/* ========================= YUI dialog ========================= */

/* discovered this margin fix by a trial and error. This can very well be a totally wrong fix, or perhaps updating
to the latest YUI will fix this? */
.dialog .hd {
margin: 0 !important;
font-size: var(--font-size-xs) !important;
}

.dialog .bd {
margin: 0 !important;
}

.dialog .ft {
margin: 0 !important;
}

/* ========================= tags/labels ================== */
// Used in core/src/main/java/hudson/util/TagCloud.java#getClassName

Expand Down
Loading

0 comments on commit 9b6bc69

Please sign in to comment.