Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 95ff94a
☁️ Nx Cloud last updated this comment at |
2db5af9 to
015b819
Compare
There was a problem hiding this comment.
The deprecation docs contradict the example configs
astro-docs/.../configure-vite.mdoc adds two caution asides flagging the helpers as deprecated:
- L31–32 — "
nxViteTsPathsis deprecated" - L133–134 — "
nxCopyAssetsPluginis deprecated"
But further down the same page, the "What your vite.config.ts looks like" section still demonstrates the deprecated helper in both example configs:
- For applications — L172
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin', L194plugins: [react(), nxViteTsPaths()] - For libraries — L223
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin', L230nxViteTsPaths()
So the page tells readers the helper is deprecated, then hands them a recommended vite.config.ts that uses it. The caution asides even say "as shown above" — but the canonical example config below them shows the old way. Please update those two example configs to tsconfigPaths() from vite-tsconfig-paths so the page is self-consistent.
Other docs pages still teach the deprecated helper
Beyond configure-vite.mdoc, several other guides still show nxViteTsPaths as the current way to do things. Worth fixing here or as a tracked follow-up so the deprecation messaging is consistent site-wide:
technologies/vue/nuxt/Guides/deploy-nuxt-to-vercel.mdoc— L46 import, L69plugins: [nxViteTsPaths()]technologies/react/Guides/adding-assets-react.mdoc— L344 import, L360nxViteTsPaths()technologies/test-tools/storybook/Guides/one-storybook-for-all.mdoctechnologies/test-tools/storybook/Guides/one-storybook-with-composition.mdoctechnologies/typescript/Guides/switch-to-workspaces-project-references.mdoc
(guides/Tasks & Caching/convert-to-inferred.mdoc also references it, but that guide is about migrating off old patterns, so it's likely fine as-is.)
FrozenPandaz
left a comment
There was a problem hiding this comment.
Docs updates look good — the example configs now use tsconfigPaths() from vite-tsconfig-paths consistently across the vite, react, vue/nuxt, and storybook guides. The earlier inconsistency is resolved.
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:
We investigated the e2e-gradle:e2e-ci--src/gradle-dsl.test.ts failure and determined it is unrelated to our changes — the PR only modifies vite and astro-docs, while e2e-gradle is untouched. The error is an intermittent ENOENT for a temporary workspace-data file produced during e2e environment setup, indicating a one-off timing gap in test infrastructure rather than a defect introduced by this PR.
No code changes were suggested for this issue.
Trigger a rerun:
🎓 Learn more about Self-Healing CI on nx.dev
`nxViteTsPaths` and `nxCopyAssetsPlugin` from `@nx/vite/plugins/*` run silently. Both helpers log a one-time deprecation warning on call and carry `@deprecated` JSDoc tags. Behavior unchanged in v23; removal candidate for v24. Configure-Vite docs lead with `vite-tsconfig-paths` and `publicDir` / `vite-plugin-static-copy` and flag the helpers as deprecated. NXC-4316
## Current Behavior `generator-utils.spec.ts > should generate correct config when using ts solution setup` and three `configuration.spec.ts > TS solution setup` tests set up `package.json` workspaces but no `pnpm-workspace.yaml`. `detectPackageManager()` resolves to pnpm in the test env, so `isWorkspacesEnabled` falls back to looking for `pnpm-workspace.yaml`, finds none, and reports the tree as non-TS-solution. The tests silently exercise the non-TS-solution path while their inline snapshots assert the TS-solution path. ## Expected Behavior Add `pnpm-workspace.yaml` to both TS-solution fixtures so `isUsingTsSolutionSetup` returns true and the existing `if (!isTsSolutionSetup)` gate in `createOrEditViteConfig` is actually exercised. Confirms that the TS solution setup does not emit `nxViteTsPaths` or `nxCopyAssetsPlugin` in generated configs. ## Related Issue(s) NXC-4316
…gacy branches ## Current Behavior `createOrEditViteConfig` skips `nxViteTsPaths` / `nxCopyAssetsPlugin` for ts-solution and emits them for non-ts-solution. The behaviour is implicit in scattered snapshots; no test asserts the split directly. ## Expected Behavior `configuration.spec.ts` gains two focused tests: ts-solution gen does not emit the deprecated helpers, non-ts-solution gen still does. The non-ts-solution test carries a TODO(v24) flagging the swap to `vite-tsconfig-paths` once the legacy branch is migrated. ## Related Issue(s) NXC-4316
## Current Behavior Stray duplicate `CopyAssetsHandler` import breaks `vite:build-base` (TS2300). New configuration spec inline snapshots use `rollupOptions`, but the generator emits `rolldownOptions`, so `vite:test` fails. ## Expected Behavior Single import. Inline snapshots match generator output. Both targets pass. Also marks the legacy non-ts-solution emit branch with a TODO(v24). ## Related Issue(s) NXC-4316
Current Behavior
nxViteTsPathsandnxCopyAssetsPluginfrom@nx/vite/plugins/*run silently. New TS-solution workspaces never emit them; new non-ts-solution workspaces still do.Expected Behavior
Both helpers log a one-time deprecation warning on call and carry
@deprecatedJSDoc tags. Behavior unchanged in v23; removal candidate for v24.package.jsoncopy is needed). Generator output is helper-free and a spec test locks that in.vite-tsconfig-paths.Configure-Vite docs lead with
vite-tsconfig-pathsandpublicDir/vite-plugin-static-copyand flag the helpers as deprecated.Related Issue(s)
NXC-4316