Conversation
vite() の出力は <script type="module"> で、仕様上すでに defer 相当 (HTMLのパース完了後に実行)になる。async はその defer を打ち消し、 モジュールの読み込みが終わった時点で即実行させるため、HTMLのパースが <body> に達する前に main.js が走ることがある。 その場合、DOMを参照する処理が対象0件で空振りする。 - Alpine が「Unable to initialize. Trying to load Alpine before <body> is available.」を警告する。Alpine は警告後も MutationObserver で 後から流れてくる要素を拾うため、x-data の動作自体には実害が出にくい - externalLinks(次のコミットで対応)が空振りし、外部リンクに target="_blank" / rel="noopener noreferrer" が付かない。文書末尾に あるフッターのリンクはどのページでも処理に間に合わない このテーマを出発点にした複数のサイトで、main.js の実行開始時点で document.body が存在しないこと(readyState=loading)と、それによる フッターの外部リンクの付与漏れを実測で確認している。Chrome / Edge で 再現し、Safari では実行が遅く再現しないことがある。ビルドし直すと出て 古いビルド生成物では出ないため、原因を掴みにくい。 ダウンロードは modulepreload が先行するので、async を外しても取得は 遅くならない。むしろ <head> のパース中に大きなモジュールを同期実行 しなくなる分、初回描画には有利。
組み込みJSは他すべてが domContentLoaded() で包まれているのに externalLinks だけ同期実行されており、DOM構築前に呼ばれると querySelectorAll が0件を返して外部リンクに target/rel が付かないまま 終わる。 前のコミットの async 削除で実行タイミング側は解消しているが、この処理 自体はDOMを参照するため、他の組み込みJSと揃えて domContentLoaded を 待たせ、読み込み方法の変更に依存しないようにする。 htmx のスワップ後に window.dispatch(event.target) から呼ばれる経路では、 既にDOMに入った要素が context になるため domContentLoaded は即時発火し、 挙動は変わらない。
Bumps the npm group with 1 update: [lint-staged](https://github.com/lint-staged/lint-staged). Updates `lint-staged` from 17.3.0 to 17.4.1 - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md) - [Commits](lint-staged/lint-staged@v17.3.0...v17.4.1) --- updated-dependencies: - dependency-name: lint-staged dependency-version: 17.4.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the npm group in /themes/develop with 4 updates: [alpinejs](https://github.com/alpinejs/alpine/tree/HEAD/packages/alpinejs), [smartphoto](https://github.com/appleple/SmartPhoto), [eslint](https://github.com/eslint/eslint) and [@rollup/rollup-linux-x64-gnu](https://github.com/rollup/rollup). Updates `alpinejs` from 3.16.2 to 3.16.3 - [Release notes](https://github.com/alpinejs/alpine/releases) - [Commits](https://github.com/alpinejs/alpine/commits/v3.16.3/packages/alpinejs) Updates `smartphoto` from 2.1.6 to 2.1.7 - [Release notes](https://github.com/appleple/SmartPhoto/releases) - [Commits](appleple/SmartPhoto@v2.1.6...v2.1.7) Updates `eslint` from 10.9.0 to 10.9.1 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](eslint/eslint@v10.9.0...v10.9.1) Updates `@rollup/rollup-linux-x64-gnu` from 4.62.5 to 4.63.1 - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](rollup/rollup@v4.62.5...v4.63.1) --- updated-dependencies: - dependency-name: alpinejs dependency-version: 3.16.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm - dependency-name: smartphoto dependency-version: 2.1.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm - dependency-name: eslint dependency-version: 10.9.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm - dependency-name: "@rollup/rollup-linux-x64-gnu" dependency-version: 4.63.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Vite の configLoader: 'native' で __dirname が未サポートになる警告が出ていたため解消する。
fix: vite.config.js の __dirname を import.meta.dirname に置き換える
…t-dependency developテーマのpdfjs-dist直接依存を削除
main.jsのasync読み込みをやめてDOM参照処理の実行タイミングを保証する
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.
リリース内容
マージするとタグ発行・リリース作成が自動実行されます。