Skip to content

feat: jQuery 4 にアップグレード#1396

Draft
nanasess wants to merge 3 commits into
EC-CUBE:masterfrom
nanasess:feature/jquery4
Draft

feat: jQuery 4 にアップグレード#1396
nanasess wants to merge 3 commits into
EC-CUBE:masterfrom
nanasess:feature/jquery4

Conversation

@nanasess
Copy link
Copy Markdown
Contributor

Summary

EC-CUBE 2 系を jQuery 3.7.1 から jQuery 4.0 にアップグレードする。あわせて jquery-ui 1.14.1 → 1.14.2、jquery-migrate 3.5.2 → 4.0 を取り込む。

jquery-migrate@4 は package.json に残置し、ユーザーが html/user_data/packages/<template_code>/ 配下に書いた独自テンプレート JS でレガシー API を使っているケースを保護する。$.migrateMute は削除して警告を常時 console 出力し、deprecated API 利用箇所の早期発見を促す。

Changes

1. 本体コードの jQuery 4 互換 API 置換 (17 箇所)

jQuery 4 で削除される .attr('checked'|'selected'|'disabled') の文字列設定挙動と、イベントショートカット .load(fn) を置換。

  • 管理画面: admin/design/index.tpl, admin/order/edit.tpl, admin/ownersstore/{plugin,plugin_hookpoint_list}.tpl, admin/products/{product,product_class}.tpl
  • PC フロント: default/products/detail.tpl (お気に入りボタンの img load イベント)
  • インストーラ: install/templates/step1.tpl (SMTP フォーム disable)
  • バンドル: data/eccube.js (規格 2 プルダウンの option 選択状態 + migrateMute 削除)

2. 同梱の旧式 jQuery プラグインを jQuery 4 互換に更新

  • jquery.biggerlink.js (sphone, 2007 年版): .bind() 5 件 → .on()
  • jquery.autoResizeTextAreaQ-0.1.js (sphone, 2010 年版): .bind() 1 件 → .on()
  • jquery.multiselect2side.js (admin CSV, 2010 年版): .size() 9 件 → .length.attr('selected', bool) 9 件 → .prop('selected', bool)

3. 依存関係更新

  • jquery: 3.7.1^4.0.0
  • jquery-migrate: ^3.5.2^4.0.0 (残置、warn は mute しない)
  • jquery-ui: ^1.14.1^1.14.2 (jQuery 4 公式テスト済)

4. ビルド成果物

  • yarn.lock を新規追加
  • html/js/eccube.{js,css,map} を esbuild で再生成

Test plan

  • npm run build 成功
  • data/vendor/bin/phpunit 通過 (jQuery 化と無関係の既存 mysqli object is already closed エラー 11 件は別問題)
  • Playwright E2E (admin/MySQL): 78/81 passed
    • 失敗 3 件 (admin/products/review, admin/basis/delivery × 2) は jQuery 4 修正箇所と無関係で master でも再現する可能性が高い (PC フロントの商品検索フォーム不在、管理画面のルーティング問題)
    • jQuery 4 修正対象画面のテスト (商品規格登録、商品編集、ownersstore plugin install、upload_csv) は全て passed
  • Playwright E2E (front_guest/MySQL)
  • Playwright E2E (front_login/MySQL)
  • Playwright E2E (PostgreSQL 環境一式)
  • 手動検証 (E2E 未カバー画面):
    • 管理画面レイアウト編集 (admin/design/index.php) — sortable によるブロック並び替え
    • 管理画面受注編集 (admin/order/edit.php) — 数量入力欄の disable 制御
    • PC 商品詳細 — a.expansion のカラーボックス画像拡大
    • PC 商品詳細 — お気に入りボタンの tooltip
    • sphone 商品詳細 — slick スライダー (#detailphotoblock ul, #whobought_area ul)
    • sphone マイページ履歴 — $.colorbox モーダル
    • 管理画面 CSV 設定 — multiselect2side による項目移動
    • インストーラ (/install/) — SMTP フォーム disable 切替
  • ブラウザ DevTools console で本体・同梱プラグイン由来の JQMIGRATE 警告が出ないこと

既知の懸念

  • slick-carousel@1.8.1 は upstream で jQuery 4 未対応。動作確認で $.type is not a function 等が出た場合は slick-carousel-jquery4@4.x への差し替えを検討する。
  • jquery-colorbox@1.6.4 は upstream archived。本 PR では動作確認のみとし、将来的に TurbojetTechnologies/colorbox fork への移行を別 issue で検討。

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d977349c-3364-4d52-9aec-71fcc9fffc27

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.30%. Comparing base (21c871c) to head (d7767bb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1396   +/-   ##
=======================================
  Coverage   55.30%   55.30%           
=======================================
  Files          87       87           
  Lines       11089    11089           
=======================================
  Hits         6133     6133           
  Misses       4956     4956           
Flag Coverage Δ
tests 55.30% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

nanasess and others added 2 commits May 15, 2026 22:06
jQuery 4.0 で `.attr('checked'|'selected'|'disabled')` の文字列値での設定挙動と
イベントショートカット `.load(fn)` (Ajax 版ではないバインド) が削除されたため、
EC-CUBE 本体の対象 17 箇所を jQuery 4 ネイティブ API に置換した。

- 管理画面: design/index, order/edit, ownersstore/{plugin,plugin_hookpoint_list},
  products/{product,product_class}
- PC フロント: products/detail (favorite ボタンの img load イベント)
- インストーラ: install/step1 (SMTP フォーム disable)
- バンドル: data/eccube.js (規格 2 プルダウンの option 選択状態)

また data/eccube.js の `\$.migrateMute = true;` を削除し、jquery-migrate の
警告を常時 console に出力するよう変更した。これは将来 jQuery メジャーアップ時に
deprecated API 利用箇所を早期発見するため。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EC-CUBE 2 に同梱されている 2007〜2010 年制作の旧式 jQuery プラグイン 3 つで、
jQuery 4 で削除された API (.bind, .size, .attr('selected', ...) ) を
jQuery 4 ネイティブ API に置換した。

- jquery.biggerlink.js (sphone): .bind() 5 件 → .on()
- jquery.autoResizeTextAreaQ-0.1.js (sphone): .bind() 1 件 → .on()
- jquery.multiselect2side.js (admin CSV 設定): .size() 9 件 → .length、
  .attr('selected', true/false) 9 件 → .prop('selected', true/false)

これらは upstream で更新されていない fork なので、本リポジトリで直接修正する
方針を採った。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- jquery: 3.7.1 → ^4.0.0
- jquery-migrate: ^3.5.2 → ^4.0.0
- jquery-ui: ^1.14.1 → ^1.14.2 (jQuery 4 公式テスト済バージョン)

jquery-migrate は package.json から削除せず残置する。本体・同梱プラグインは
jQuery 4 ネイティブ API に改修済みのため migrate なしで動作するが、ユーザーが
html/user_data/packages/<template_code>/ 配下に書いた独自テンプレート JS で
レガシー API を使っているケースに対する後方互換シムとして機能させる。

警告は意図的に mute しないため、ユーザーカスタム部分の deprecated API 利用が
ブラウザ console で可視化される。将来のメジャーアップ時の修正を促す目的。

合わせて esbuild ビルド成果物 (html/js/eccube.{js,css,map}) を再生成した。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant