fix(nuxt): update unctx to v3 beta#35540
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm-workspace.yaml (1)
44-44: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider adding an explanatory comment for consistency.
Other
minimumReleaseAgeExcludeentries include comments (e.g.,# Renovate security update: [email protected]). Adding a brief comment here would help future developers understand why this beta is excluded and when it can be removed.♻️ Suggested comment
minimumReleaseAgeExclude: - '`@nuxt/`*' # Renovate security update: [email protected] - [email protected] - vue-bundle-renderer # Renovate security update: [email protected] - [email protected] + # Beta release: unctx v3 (memory leak fix) - [email protected]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm-workspace.yaml` at line 44, Add a brief explanatory comment alongside the minimumReleaseAgeExclude entry for [email protected], matching the existing comment style and documenting why this beta is excluded and when the exception can be removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pnpm-workspace.yaml`:
- Line 44: Add a brief explanatory comment alongside the
minimumReleaseAgeExclude entry for [email protected], matching the existing
comment style and documenting why this beta is excluded and when the exception
can be removed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 135ad701-8c3d-4ac3-ab49-e140bc236564
⛔ Files ignored due to path filters (2)
packages/nuxt/package.jsonis excluded by!**/package.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (4)
packages/nuxt/src/core/nuxt.tspackages/nuxt/src/core/plugins/unctx.tspackages/nuxt/test/unctx-transform.test.tspnpm-workspace.yaml
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/nuxt/src/core/plugins/unctx.ts (1)
24-45: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winConsider resetting the cached transformer promise on rejection.
If
createTransformerreturns a rejected promise, it is cached permanently intransformervia??=. Every subsequent call tohandlerwillawaitthe same rejected promise and throw, with no recovery path. While transformer creation failures are likely configuration errors (consistent, not transient), adding a catch to resettransformerwould make the plugin more resilient.♻️ Optional resilience improvement
async handler (code) { - const { shouldTransform, transform } = await (transformer ??= createTransformer(options.transformerOptions)) + try { + const { shouldTransform, transform } = await (transformer ??= createTransformer(options.transformerOptions)) + } catch (e) { + transformer = undefined + throw e + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/nuxt/src/core/plugins/unctx.ts` around lines 24 - 45, Update the cached transformer initialization in the transform handler to clear transformer when createTransformer rejects, allowing subsequent handler calls to retry creation. Preserve the existing successful caching and transformation behavior around shouldTransform and transform.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/nuxt/src/core/plugins/unctx.ts`:
- Around line 24-45: Update the cached transformer initialization in the
transform handler to clear transformer when createTransformer rejects, allowing
subsequent handler calls to retry creation. Preserve the existing successful
caching and transformation behavior around shouldTransform and transform.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c5d79ee1-095d-4bd4-a730-4c2a26f7fb7a
⛔ Files ignored due to path filters (4)
packages/kit/package.jsonis excluded by!**/package.jsonpackages/nitro-server/package.jsonis excluded by!**/package.jsonpackages/schema/package.jsonis excluded by!**/package.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (1)
packages/nuxt/src/core/plugins/unctx.ts
|
so,what can I do ,my version is 4.2.2 ,what is the latest version? has the problem of memory leakage been resolved? |
|
just wait for the next nuxt release, which will be 4.5.0 🙏 |
🔗 Linked issue
resolves #33644 (see #33644 (comment))
📚 Description
Updates unctx to v3 beta to address ALS memory leak + makes
UnctxTransformPluginasync due to API changes introduced in unctx v3.0.0-beta.2.While in beta, it can be used as a testing playground in userland apps using pkg.pr.new release.