Repository navigation
Load chokidar with dynamic import - #460
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
VerificationEnvironment: Node.js v24.22.1, pnpm 10.34.7 (macOS) chokidar 4.0.3 (this PR as is)
chokidar 5.0.0 (installed temporarily with
|
| Check | Before this PR | With this PR |
|---|---|---|
pnpm run lint:typecheck |
src/server/app.ts(1,22): error TS1479 |
pass |
pnpm run lint:eslint |
not run | pass |
pnpm test |
2 suites failed (preview.test.ts, index.test.ts) |
26 suites, 248 tests passed |
pnpm run build |
not run | pass |
The "Before this PR" column was run on Node.js v24.22.0. The other runs used v24.22.1.
File watcher
- With both 4.0.3 and 5.0.0, I loaded
startLocalChangeWatcherfrom the builtdist/server/app.js, connected a WebSocket client, and wrote a file in the watched directory. The client receivedlocal changed. - With 4.0.3, I ran
qiita previewagainst a local Qiita API and opened an article in a browser. I appended a unique string to the article file. The string appeared in the article body without a page reload. - I did not run
qiita previewin a browser with 5.0.0. That can be checked on Bump chokidar from 4.0.3 to 5.0.0 #448 after it is rebased.
atm-snag2
marked this pull request as ready for review
October 22, 2026 08:24
atm-snag2
requested review from
a team and
inukai-masanori
and removed request for
a team
October 22, 2026 10:44
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.
What
Load
chokidarwith a dynamic import instartLocalChangeWatcher, so that qiita-cli keeps working whenchokidarbecomes ESM-only in v5.How
chalk,boxen,open). Migrating the whole package to ESM is out of scope.chokidarstays at 4.0.3 in this PR. The ESM build of 4.0.3 also hasexport default { watch, FSWatcher }, so the same code works with both 4.0.3 and 5.0.0.Why
#448 (
chokidar4.0.3 → 5.0.0) failslint,build, andtest.chokidar5.0.0 ships ESM only, and qiita-cli compiles to CommonJS (module: "Node16"), so the staticimport chokidar from "chokidar"becomes arequirecall that cannot load the package.lint:typecheck/build:server:src/server/app.ts(1,22): error TS1479test:src/commands/preview.test.tsandsrc/commands/index.test.tsfail to loadsrc/server/app.tsUntil this is fixed, every
chokidarbump is blocked here.Refs