Skip to content

Release 4.1.0#6407

Merged
kevin-brown merged 58 commits into
masterfrom
develop
May 26, 2026
Merged

Release 4.1.0#6407
kevin-brown merged 58 commits into
masterfrom
develop

Conversation

@kevin-brown

Copy link
Copy Markdown
Member

I'm not confident the full deployment pipeline is going to work here, but let's try it.

AlekseyArh and others added 30 commits March 4, 2021 18:53
If custom transport does not return any object 
then calling error callback would result in `Uncaught TypeError: right-hand side of 'in' should be an object, got undefined`.
This patch adds check if $request evaluates to something.
This is being increased to help mitigate a deployment race condition that can cause the JavaScript to not load if the npm release does not finish with 60 seconds.
Found via `codespell -q 3 -L eacf`
Added missing word spacing.
* Update  Arabic  Localization with removeItem

* Update Arabic Localization
* Luxembourgish translation

* Fixed linting issue in luxembourgish translation
* Update Indonesian Localization translation

- Added removeItem()
- Added search()
- Update searching()

* Update src/js/select2/i18n/id.js

* Update src/js/select2/i18n/id.js

Co-authored-by: Kevin Brown-Silva <[email protected]>
* During selection and unselection events, retrieve cached item data using the original 'option' element as the cache lookup key instead of the event target

* Fixup: only use 'option' element as cache lookup key during unselection -- not selection -- events

* Narrow down 'option' element query to find the unselected item by value

* Consistency: prefer jQuery.find...each pattern as used elsewhere in the codebase

* Lint fixup: fit within line length limits

* Use equality checks instead of jQuery/CSS selector attribute matching to filter relevant 'option' elements
*Total -- 1,717.61kb -> 1,463.41kb (14.8%)

/docs/pages/images/flags/wa.png -- 44.19kb -> 7.72kb (82.53%)
/docs/pages/images/flags/wv.png -- 44.19kb -> 12.03kb (72.78%)
/docs/pages/images/flags/hi.png -- 3.10kb -> 1.47kb (52.59%)
/docs/pages/images/flags/sc.png -- 4.38kb -> 2.27kb (48.16%)
/docs/themes/learn2/images/favicon.png -- 1.15kb -> 0.72kb (37.72%)
/docs/pages/images/flags/al.png -- 2.56kb -> 1.68kb (34.39%)
/docs/plugins/error/assets/readme_1.png -- 40.71kb -> 28.36kb (30.33%)
/docs/pages/images/flags/ak.png -- 2.16kb -> 1.59kb (26.18%)
/docs/themes/learn2/images/logo.png -- 1.19kb -> 0.88kb (26.01%)
/docs/themes/site/images/safari-pinned-tab.svg -- 0.75kb -> 0.56kb (25.42%)
/docs/plugins/problems/assets/readme_1.png -- 71.20kb -> 53.70kb (24.58%)
/docs/pages/images/flags/ms.png -- 5.95kb -> 4.54kb (23.6%)
/docs/pages/images/flags/ar.png -- 10.62kb -> 8.11kb (23.59%)
/docs/plugins/simplesearch/assets/search.svg -- 0.95kb -> 0.74kb (22.22%)
/docs/plugins/highlight/assets/readme_1.png -- 163.69kb -> 127.78kb (21.94%)
/docs/pages/images/flags/nm.png -- 1.49kb -> 1.17kb (21.08%)
/docs/pages/images/flags/in.png -- 6.82kb -> 5.43kb (20.49%)
/docs/pages/images/flags/az.png -- 5.32kb -> 4.25kb (20.19%)
/docs/pages/images/flags/tx.png -- 1.29kb -> 1.04kb (19.64%)
/docs/pages/images/flags/ri.png -- 6.76kb -> 5.45kb (19.49%)
/docs/pages/images/flags/tn.png -- 3.91kb -> 3.16kb (19.2%)
/docs/plugins/breadcrumbs/assets/readme_1.png -- 60.44kb -> 48.90kb (19.09%)
/docs/assets/rtfm-screenshot.png -- 131.33kb -> 107.16kb (18.41%)
/docs/pages/images/flags/oh.png -- 7.49kb -> 6.28kb (16.06%)
/docs/pages/images/flags/co.png -- 2.53kb -> 2.18kb (14.08%)
/docs/screenshot.jpg -- 147.13kb -> 127.14kb (13.59%)
/docs/themes/learn2/screenshot.jpg -- 118.97kb -> 102.90kb (13.5%)
/docs/pages/images/flags/md.png -- 4.01kb -> 3.47kb (13.38%)
/docs/pages/images/flags/ga.png -- 4.65kb -> 4.05kb (12.89%)
/docs/pages/images/flags/ca.png -- 6.99kb -> 6.10kb (12.8%)
/docs/pages/images/flags/wy.png -- 4.24kb -> 3.74kb (11.81%)
/docs/pages/images/flags/sd.png -- 10.01kb -> 8.89kb (11.24%)
/docs/pages/images/flags/la.png -- 11.22kb -> 10.01kb (10.8%)
/docs/pages/images/flags/ne.png -- 13.57kb -> 12.15kb (10.45%)
/docs/pages/images/flags/or.png -- 9.31kb -> 8.40kb (9.79%)
/docs/pages/images/flags/nc.png -- 3.90kb -> 3.57kb (8.46%)
/docs/pages/images/flags/de.png -- 7.72kb -> 7.12kb (7.81%)
/docs/pages/images/flags/nv.png -- 4.17kb -> 3.85kb (7.69%)
/docs/pages/images/flags/pa.png -- 10.93kb -> 10.10kb (7.62%)
/docs/pages/images/flags/mo.png -- 7.32kb -> 6.77kb (7.54%)
/docs/pages/images/flags/ky.png -- 9.92kb -> 9.19kb (7.41%)
/docs/pages/images/flags/mn.png -- 7.75kb -> 7.20kb (7.11%)
/docs/pages/images/flags/ia.png -- 6.94kb -> 6.46kb (6.83%)
/docs/themes/learn2/thumbnail.jpg -- 20.52kb -> 19.19kb (6.48%)
/docs/pages/images/flags/ut.png -- 10.42kb -> 9.77kb (6.3%)
/docs/pages/images/flags/ct.png -- 8.99kb -> 8.43kb (6.29%)
/docs/pages/images/flags/nh.png -- 12.49kb -> 11.74kb (6%)
/docs/pages/images/flags/fl.png -- 8.81kb -> 8.33kb (5.4%)
/docs/pages/images/flags/mi.png -- 10.23kb -> 9.73kb (4.86%)
/docs/pages/images/flags/ok.png -- 7.12kb -> 6.81kb (4.4%)
/docs/pages/images/flags/nd.png -- 11.52kb -> 11.01kb (4.38%)
/docs/pages/images/flags/va.png -- 9.90kb -> 9.47kb (4.37%)
/docs/plugins/simplesearch/assets/readme_1.png -- 110.46kb -> 106.12kb (3.93%)
/docs/pages/images/flags/wi.png -- 8.34kb -> 8.08kb (3.12%)
/docs/pages/images/flags/ks.png -- 7.58kb -> 7.35kb (2.99%)
/docs/pages/images/flags/ma.png -- 3.89kb -> 3.78kb (2.96%)
/docs/pages/images/flags/mt.png -- 7.17kb -> 7.00kb (2.46%)
/docs/pages/images/flags/vt.png -- 6.25kb -> 6.09kb (2.45%)
/docs/themes/learn2/fonts/fontawesome-webfont.svg -- 433.96kb -> 425.36kb (1.98%)
/docs/themes/learn2/images/clippy.svg -- 0.51kb -> 0.50kb (1.16%)
/docs/pages/images/flags/il.png -- 10.11kb -> 10.05kb (0.63%)
/docs/pages/images/flags/ny.png -- 9.50kb -> 9.45kb (0.53%)
/docs/pages/images/flags/nj.png -- 6.93kb -> 6.92kb (0.21%)

Signed-off-by: ImgBotApp <[email protected]>
Co-authored-by: ImgBotApp <[email protected]>
- Upgrade node to v12 for Github actions.
- Compiled and minified src with Grunt
This replaces jQuery's `addClass` function with the vanilla JavaScript
`classList.add`.
This replaces jQuery's `removeAttr` function with the vanilla JavaScript
`removeAttribute`.

$results, $rendered, $selection and $search all seem to be defined as a
single element, so we can call `[0]` to get the element.
)

* Dependencies: update to `sass` v1.77.8

* Dependencies: update to `grunt-contrib-qunit` v10.1.1

* CI: update all GitHub Actions workflows to Node v20 (current LTS)

* Build: recompile distributable files

* Dependencies: remove duplicate non-dev `sass` dependency

Co-authored-by: Kevin Brown-Silva <[email protected]>

* CI: Fixup: correction for environment variables in YAML config

Co-authored-by: Kevin Brown-Silva <[email protected]>

* Linting: delete removed `module` and `test` globals, and delete deprecated line-length limit.

* CI: Run `apt` commands as superuser

---------

Co-authored-by: Kevin Brown-Silva <[email protected]>
jayaddison and others added 28 commits August 23, 2024 17:19
…entifiers (#6241)

* integration test: selection and clearing of data from ajax source

* Fix: normalize response data items received from AJAX requests

* Extension: remove special-case logic for unselection events on multi-select controls

* test fixup: call assert.async test-completion event handler

* test log cleanup: increase the severity threshold for jquery-mockjax log events so that info-level messages do not pollute the test log output

* Revert "Extension: remove special-case logic for unselection events on multi-select controls"

This reverts commit 8fd9a00.

* Relocate AJAX-response-result normalization step, and add 'Array.isArray' check condition

* Lint fixup: rearrange code to fit within line length limits

* Nitpick: remove trailing end-of-line whitespace

* Dependencies: update to mockjax v2.6.1
* Fixup: reference `QUnit.test` instead of relying on global namespace entry

Relates-to / merge-resolution-for #6241, #6334

* Build: recompile distributable files

* Tests: temporarily comment-out a failing integration test

* Revert "Tests: temporarily comment-out a failing integration test"

This reverts commit 1863823.

* Tests: isolate `selection:update` integration test event handlers

* Cleanup: regenerate NPM lockfile
* Tests: update `jquery-mockjax` to v2.7.0-beta.0

This beta/prerelease version of `jquery-mockjax` includes jQuery-4.0.0.beta2 support.

See jakerella/jquery-mockjax#362 for details.

* Add support for `jQuery` v4.0.0-beta.2

Co-authored-by: James Addison <[email protected]>

* Documentation: retain defensive coding in retrieval of code content from HTML elements.

* Build: recompile distributable files

---------

Co-authored-by: marcellov7 <[email protected]>
)

* Integration test: multiple selection and clearing of grouped options

* Fix: convert grouped option identifiers to the 'string' type

* Build: recompile distributable files
- Update all devDependencies to latest versions compatible with Node 20
- Fix Sass @import deprecations: replace with @use/meta.load-css()
- Fix global builtin deprecations: sass:color for mix() and ie-hex-str()
- Fix Gruntfile source path typo: .css -> .scss for theme layouts
- Fix Gruntfile sass option: outputStyle -> style for Dart Sass API
* Upgrade jQuery 3.x to 3.7.1 and 4.x to 4.0.0 in tests

* Upgrade QUnit to 2.25.0 in tests
* Remove function

* Fix missing [0] on $search.autocomplete in selection/search.js

* Rebuild dist files and update package-lock.json

---------

Co-authored-by: Julien Coutault <[email protected]>
Co-authored-by: Kevin Brown-Silva <[email protected]>
* Multiple select placeholder

* Delete docs/themes/learn2/scss/nucleus.css

* Delete docs/themes/learn2/scss/nucleus.css.map

* Delete docs/themes/learn2/scss/theme.css

* Delete docs/themes/learn2/scss/theme.css.map

* Delete src/scss/core.css

* Delete src/scss/core.css.map

* Delete src/scss/theme/classic/layout.css

* Delete src/scss/theme/classic/layout.css.map

* Delete src/scss/theme/default/layout.css

* Delete src/scss/theme/default/layout.css.map

* class

* Remove diagram file

---------

Co-authored-by: Kevin Brown-Silva <[email protected]>
* Remove jQuery in Utils and Translation

* Fix error

* Update translation.js

* Simplify hasScroll and fix GetData dataset key lookup

Apply suggestion from review: use computedStyle.height/width directly
in hasScroll instead of manually summing padding values.

Fix GetData to convert attribute name format to dataset property key
format (e.g. 'foo-bar' -> 'fooBar') per the HTML spec, which fixes
the 'with nesting' data attributes test.

---------

Co-authored-by: Kevin Brown-Silva <[email protected]>
* Replace `attr` with `getAttribute` and `setAttribute`

This replaces jQuery's `attr` function with the vanilla JavaScript
`getAttribute` and `setAttribute`.

* Replace attr with getAttribute and setAttribute

This replaces jQuery's `attr` function with the vanilla JavaScript
`getAttribute` and `setAttribute`.

* Replace remaining removeAttr with removeAttribute in multiple.js

* Fix unintentional whitespace change in setAttribute call

* Fix aria-selected update to apply to all highlighted results, not just first

* Add test for aria-selected reset on all highlighted results on mouseenter

---------

Co-authored-by: Kevin Brown-Silva <[email protected]>
Co-authored-by: Jesse Nieminen <[email protected]>
* Updated polish translations

See https://github.com/select2/select2/pull/6203/files

* Make de dist file
"enforceFocus" solution depends on Bootstrap version
dropdownAutoWidth is not documented, and its behavior is not clear. It sets the width on the actual dropdown not the actual select2 box. That may be obvious to some, but others will think of the whole widget as a dropdown element.
…ts (#6297)

* Update hidePlaceholder.js

Validate placeholder as an object

* Update placeholder.js

Validate placeholder as an object
This pull request includes a

[x] Document update

Options API has no description for ```sorter``` callback option.
Added description.
Modify snippet to have the same class as the one declared.
* Upgrade build toolchain from Node 20 to Node 24 LTS

Node 20 reaches end-of-life in April 2026. Node 24 is the current active
LTS release (codename Krypton), making it the appropriate target for both
local development and CI/CD.

All existing devDependencies were already at their latest published versions
and were verified to work correctly on Node 24.16.0 without modification.
grunt passes fully: 1084 tests, 0 failures.

Changes:
- Add .nvmrc pinned to 24 so developers using nvm automatically switch to
  the correct Node version when entering the project directory
- Add engines field to package.json declaring the >=24 requirement, so npm
  warns contributors who attempt to install with an unsupported Node version
- Remove grunt-contrib-watch from devDependencies and Gruntfile.js; the
  watch task is no longer used and the package has been abandoned since 2018,
  making it a maintenance liability with known fragility on newer Node versions
- Update GitHub Actions workflows (main.yml, package-deploy.yml) to use
  Node 24 and upgrade actions/checkout and actions/setup-node from v1 to v4;
  v1 of both actions uses deprecated Node 12 runners which GitHub will
  eventually remove, and v4 is the current supported release

* Rebuild dist from current sources

The dist files were stale and did not reflect the current state of src/.
This rebuilds them by running grunt compile minify so that the published
package matches what the source produces.
Replace the long-lived NPM_TOKEN secret with OIDC-based trusted
publishing. This removes the need to store and rotate a static token in
repository secrets.

- Add id-token: write permission so the job can obtain an OIDC token
  from GitHub, which NPM uses to authenticate the publish request
- Add contents: read as explicit least-privilege for the checkout step
- Pass --provenance to npm publish to attach a signed provenance
  attestation linking the published package to this workflow run
- Pass --access public to ensure the package is published as public

Trusted publishing must also be enabled on the npmjs.com package
settings page by adding this repository and workflow as a trusted
publisher.
Updated version from 4.1.0-rc.0 to 4.1.0 in:
- package.json
- package-lock.json
- component.json
- docs/pages/01.getting-started/01.installation/docs.md
- docs/pages/13.i18n/docs.md
- docs/themes/site/templates/partials/base.html.twig
Rebuilt all dist files from source following the version bump from
4.1.0-rc.0 to 4.1.0. Includes updated JS bundles, minified files,
i18n locale files, and CSS.
- Remove '(unreleased)' marker from the 4.1.0 heading
- Add new features: jQuery 4.0.0 support (#6332), originalEvent in
  close trigger args (#6079)
- Add bug fixes: placeholder misalignment (#6277), RTL choice remove
  button (#6257), digit-only data-placeholder (#6297), AJAX unselection
  with non-string IDs (#6241, #6335), optgroup child string coercion (#6338)
- Add translations: lb (#6131), ug (#6166), ar (#6175), zh-TW (#6157),
  id (#6153), tr (#6123), ro (#6190), de/es/fr/pt/pt-BR (#6132),
  pl (#6097, #6377), nb (#6213), fa (#6258), nl (#6269), pt-BR typo
  (#6200), missing bs/ca/da/fi strings (#6305)
- Add miscellaneous: native DOM replacements for jQuery attr/removeAttr
  (#6227, #6228), classList.add (#6229), jQuery removal from Utils and
  Translation (#6233), prop() removal (#6289), NPM trusted publishing
  (#6405)
@kevin-brown
kevin-brown merged commit 13bad6e into master May 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.