Repository navigation
管理画面と QuickManager から jQuery を外し、本体も同梱しないようにする - #859
Merged
Merged
Conversation
管理画面の本体は jQuery を使わなくなったため、header.inc.php での jquery.min.js の読み込みと $j の定義をやめる。外部のアドオンの互換のために、 隠れた設定 mgr_jquery_path が入っているときだけ読み込み、jQuery があるときだけ $j を定義する。jquery.min.js は QM の公開側と互換のために残す。 jquery-migration.md に、アドオンの作者・利用者向けの置き換えと戻し方 (OnManagerMainFrameHeaderHTMLBlock のプラグイン、mgr_jquery_path)を書く。 csrf.js・helpers.php のコメントを jQuery が無い前提に直す。 Refs #823 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019j5AHQgfMXdM9GxE4j1Fj1
Refs #823 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019j5AHQgfMXdM9GxE4j1Fj1
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
#858 を案 2 で確定したため、jquery.min.js を削除し、それを読み込む設定を廃止する。 - 管理画面: 隠れた設定 mgr_jquery_path による読み込みをやめる。プラグインで jQuery を読み込んだときだけ $j を定義する互換は残す - QM: 公開側に jQuery を読み込む設定 loadfrontendjq と読み込み先の jqpath を廃止し、@Version を 1.5.7 に上げる。noconflictjq は、サイトが読み込んだ jQuery に $j の別名を付ける互換として残す - jquery-migration.md: jQuery が必要なときは、自分で用意してプラグインで読み込むように案内する Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
前のコミットで jquery.min.js を削除したのに合わせ、それを読み込む設定と案内を外す (前のコミットに入れ損ねた分)。 - 管理画面: 隠れた設定 mgr_jquery_path による読み込みをやめる。プラグインで jQuery を読み込んだときだけ $j を定義する互換は残す - QM: 公開側に jQuery を読み込む設定 loadfrontendjq と読み込み先の jqpath を廃止し、@Version を 1.5.7 に上げる。noconflictjq は、サイトが読み込んだ jQuery に $j の別名を付ける互換として残す - jquery-migration.md: jQuery が必要なときは、自分で用意してプラグインで読み込むように案内する Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@codex review |
Member
Author
|
@codex レビューして |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2957b785b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
jQuery を同梱しなくなったので、$j を付ける互換も本体から外す。 jQuery を自分で読み込む利用者が、プラグインの側で $j も定義する。 - header.inc.php: jQuery があるときに $j を定義する処理を削除 - QuickManager: 設定 noconflictjq(サイトの jQuery に $j の別名を付ける)を廃止 - qm.js: jQuery.colorbox.close を差し込む互換を削除(閉じるのは parent.QM.close()) Codex の指摘(遅延読み込みの jQuery に $j が付かない)は、別名を付ける処理ごと無くして解消する。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
互換性の変更: 管理画面は jQuery を同梱せず、読み込みません。
$j/jQueryも定義されません。$j(...)に頼る外部のアドオン(他の作者のプラグイン、自作の ManagerManager のウィジェット、mm_rulesに手で書いた JS)は、書き換えるか、jQuery を自分で用意してプラグインで読み込む必要があります(assets/docs/jquery-migration.mdの「外部のアドオンの互換」)。本体は互換の$jも定義しません。QuickManager の設定loadfrontendjq・noconflictjq、隠れた設定mgr_jquery_pathは廃止しました。管理画面と QuickManager から jQuery を外し、jQuery の廃止(#679)を終える。外部のアドオンへの互換は、#858 で確定した案 2 で扱う。
Closes #823
Closes #858
Closes #838
決めたこと(#858:案 2)
manager/media/script/jquery/jquery.min.jsごと外す。jQuery に頼るアドオンは、利用者が jQuery を用意して読み込むmgr_jquery_pathと、QM のloadfrontendjq/jqpathは、読み込む先が無くなるので廃止する$jを定義しない。jQuery を自分で読み込む利用者が、プラグインの側で$jも定義する(QM のnoconflictjqとjQuery.colorbox.closeの互換も外す)loadfrontendjqの新規インストールの既定)は論点が無くなる変更内容
manager/media/script/jquery/jquery.min.jsを削除(約 87KB)manager/actions/header.inc.phpmgr_jquery_pathによる読み込みも削除)$jを定義しない(var $j = jQuery.noConflict();を削除)loadfrontendjqと、読み込み先のjqpathを廃止noconflictjq(サイトの jQuery に$jの別名を付ける)も廃止qm.jsのjQuery.colorbox.closeを差し込む互換を削除。モーダルを閉じるのはparent.QM.close()(コアはすでにこちらだけを使う)Qm::$jqpathは、旧版のプラグインのコードが代入するため宣言だけ残す(PHP 8.2 以降の動的プロパティの警告を避ける)assets/docs/jquery-migration.md:「外部のアドオンの互換」を、jQuery を自分で用意してプラグインで読み込む案内に書き換え、廃止した設定を明記csrf.js・helpers.php:jQuery がある前提のコメントを直した(動きは変わらない)既存のサイトの QM のプロパティに保存済みの
loadfrontendjqは、アップデート後も残るが、読まれないだけで害はない。何が変わるか(リリース記事の候補)
$j/jQueryも無くなるmm_rulesに手で書いた$j(...)は動かなくなる。書き換えるか、jQuery を自分で用意してOnManagerMainFrameHeaderHTMLBlockのプラグインで読み込む$jも付けなくなる(設定loadfrontendjq・noconflictjqは廃止)。parent.$j.colorbox.close()を呼ぶアドオンはparent.QM.close()に書き換える。サイトのテンプレートが jQuery を使うときは、テンプレートで読み込む確認手順
Docker の検証環境(php 8.4 / mariadb 11)で、Playwright を使って確かめた。
$jを外したあと(1dbda4dc1)noconflictjq/loadfrontendjqが無い$jとjQueryは undefined、JS のエラーなし$jとjQueryは undefined で、$jを付けるスクリプトも出ないa=27&quickmanager=1)が開き、中でも$j/jQueryは undefined。閉じるボタンと、iframe の中からのparent.QM.close()で閉じる。保存すると DB に入り、親ページが読み直されるwindow.jQueryを置く)$jもjQuery.colorboxも付けない表側の 404 は備考のアイコン(
save.png/stop.png。#878 で直す)だけ。案 2 にしたとき(d2957b785)
jQueryと$jは undefined、JS のエラーなしjQueryは undefined(案 2 にする前の版での確認:管理画面の 43 画面を直接開く・シェルで移るの 2 通りで回り、JS のエラーは main と同じ。ManagerManager の検証用ルールのセット A〜E の観測値が main の記録と一致)
php -l(header.inc.php・qm.inc.php・on_web_page_prerender.php)、node --check(qm.js)備考
on_doc_form_prerender.php)が、テーマに無いアイコン(media/style/<テーマ>/images/icons/save.png/stop.png)を指していて 404 になるのを見つけた。main でも同じで、この PR とは別件(管理画面のボタンの、隠れたアイコンを整理する #878 で直す)manager/actions/element/mutate_plugin.dynamic.phpに MooTools の書き方($('id').setProperty/$$())の残りがある。jQuery ではなく、main でも動いていない(今回の変更による回帰ではない)🤖 Generated with Claude Code