fix(config): share CommonJS module fallback - #1990
Conversation
|
/bigbonk review for issues |
commit: |
|
Review — fix(config): share CommonJS module fallbackSolid refactor. I traced the new shared A few low-priority observations, none blocking: 1.
|
|
Review posted to PR #1990. SummaryI reviewed the CommonJS loader extraction in PR #1990 by tracing the new shared No blocking issues. The refactor faithfully preserves the prior behavior while sharing the loader, and the test coverage is thorough. Three low-priority observations, all non-blocking:
I also documented four things I verified are not problems (the |
|
Addressed the review observations in d7c8f2c: retry detection now scans all candidate |
|
/bigbonk review for correctness issues |
|
@james-elicx Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
|
/bigbonk review for correctness issues |
Review — fix(config): share CommonJS module fallbackI traced the new shared Verdict: correct, no blocking issues. Below is what I verified plus one pre-existing behavior worth flagging. Empirically verified correct (under legacy Node require/ESM semantics)
Non-blocking: side effects run twice on the import→CJS fallback (pre-existing)
This is inherited unchanged from #1961 (same try-import / catch-recompile shape), not a regression in this PR, and config/plugin top-levels are normally idempotent. Flagging only so it's tracked — a future improvement could be to attempt the cheap Tests / checks
Nice extraction — the shared loader is a faithful, well-tested consolidation of the two prior inline copies, and the symlink/read-only and |
|
Review posted to PR #1990. SummaryI reviewed the CommonJS loader extraction for correctness by tracing the new shared No blocking correctness issues. The refactor faithfully preserves CJS semantics and the legacy fallback works end-to-end. What I verified empirically:
One non-blocking, pre-existing observation (inherited unchanged from #1961, not introduced here):
|
Summary
.jsfallback introduced in fix(css): load local CommonJS PostCSS plugins #1961 into a shared Node-only loadernext.config.jsloading.cjsfiles from the next-config fallbackrequire()behavior across.jsand.cjsboundariesCompatibility
module.parent, circular dependencies, JSON, builtins, and native addonsrequire()after initial module evaluationTests
vp check packages/vinext/src/utils/commonjs-loader.ts packages/vinext/src/plugins/postcss.ts packages/vinext/src/config/next-config.ts tests/commonjs-loader.test.ts tests/postcss-resolve.test.ts tests/next-config.test.tsvp test run tests/commonjs-loader.test.ts tests/postcss-resolve.test.ts tests/next-config.test.ts(211 passed)vp run vinext#buildUpstream reference
Next.js uses
Module._compileplus a.jsrequire hook for config loading: