fix(vite-plugin-angular): remove duplicate hmr option#2204
fix(vite-plugin-angular): remove duplicate hmr option#2204brandonroberts merged 18 commits intoanalogjs:alphafrom
Conversation
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new Tailwind CSS v4 integration guide and updates multiple documentation pages (docs-app Tailwind guide, create-analog overview, vite-plugin-angular CSS preprocessors doc, and vite-plugin-angular README) to document a supported Tailwind setup (single root stylesheet importing Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a2f2b23 to
8992050
Compare
|
@coderabbitai resume |
✅ Actions performedReviews resumed. |
|
If we need a difference between dev/prod, we shouldn't recommend the |
|
This PR touches multiple package scopes: Please confirm the changes are closely related. |
d36190f to
8fb2979
Compare
|
@brandonroberts I force-pushed this with rebase merge ready commits. Cleaned it up and refocused it. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/docs-app/docs/integrations/tailwind/index.md`:
- Around line 127-131: Update the "HMR" section to add an explicit
Angular-version caveat: state that Angular HMR support requires Angular v19+ and
that Angular v16–v18 intentionally disable HMR and emit a runtime console
warning; reference the HMR heading in
apps/docs-app/docs/integrations/tailwind/index.md and, if helpful, link or
cross-reference the guidance in apps/docs-app/docs/guides/migrating.md (PR
`#2226`) so readers don’t assume HMR behaves the same across all supported Angular
versions.
In `@packages/vite-plugin-angular/README.md`:
- Line 97: Replace the relative docs link "/docs/integrations/tailwind" in the
README (the markdown link text "Tailwind CSS integration guide") with an
absolute docs URL (e.g.
https://your-docs-site.example/docs/integrations/tailwind) so the link resolves
correctly on GitHub/NPM README renderers; update the markdown link target to the
canonical site URL and verify the live README renders the link correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d2615d25-bdd1-4f9c-8523-b85dda81f871
⛔ Files ignored due to path filters (1)
packages/nx-plugin/src/generators/preset/__snapshots__/generator.spec.ts.snapis excluded by!**/*.snapand included bypackages/**
📒 Files selected for processing (11)
apps/docs-app/docs/integrations/tailwind/index.mdapps/docs-app/docs/packages/create-analog/overview.mdapps/docs-app/docs/packages/vite-plugin-angular/css-preprocessors.mdpackages/create-analog/__tests__/cli.spec.tspackages/create-analog/template-latest/vite.config.tspackages/nx-plugin/src/generators/app/files/template-angular-v17/vite.config.ts__template__packages/nx-plugin/src/generators/app/files/template-angular-v18/vite.config.ts__template__packages/nx-plugin/src/generators/app/files/template-angular-v19/vite.config.ts__template__packages/nx-plugin/src/generators/app/files/template-angular/vite.config.ts__template__packages/nx-plugin/src/generators/app/generator.spec.tspackages/vite-plugin-angular/README.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@brandonroberts good to merge |
brandonroberts
left a comment
There was a problem hiding this comment.
This is blocked on having both the Vite plugin and postcss plugins.
|
|
||
| export default defineConfig(() => ({ | ||
| plugins: [ | ||
| analog({ |
There was a problem hiding this comment.
This should flow through the analog plugin to the Vite plugin.
| 1. keep one root stylesheet such as `src/styles.css` | ||
| 2. put `@import 'tailwindcss';` in that stylesheet | ||
| 3. enable `@tailwindcss/vite` in `vite.config.ts` | ||
| 4. keep a `postcss.config.mjs` with `@tailwindcss/postcss` |
There was a problem hiding this comment.
Having both the Vite plugin and postcss feels like a bad solution. The Tailwind docs mention them as an either/or with the Vite plugin being the primary option.
|
|
||
| ## HMR | ||
|
|
||
| Prefer `hmr` over `liveReload` when you need to configure Angular HMR explicitly. `liveReload` remains a compatibility alias. |
There was a problem hiding this comment.
liveReload and hmr are not mutually exclusive. Keep liveReload as the option
|
I reworked this to address the review points directly.
I also rewrote the package-level docs to match the narrower contract:
Those pages now point people back to Tailwind's install docs for the install path itself, and only document the extra Analog config needed for Angular component styles. If someone only needs Tailwind utilities in templates and global CSS, the docs now tell them to keep the scaffold defaults and skip extra Analog Tailwind config. Verification I ran on this version:
The targeted tests passed, and the docs build passed. Docusaurus still reports unrelated pre-existing broken-anchor warnings elsewhere in the docs site, but there were no new build failures from this change set. At this point the PR should be much narrower: it no longer tries to define a broader Tailwind installation contract inside Analog docs, and it now matches the |
…onfiguration across Angular and Storybook integrations
9a96ea0 to
75ffacd
Compare
PR Checklist
Related:
Affected scope
Recommended merge strategy for maintainer [optional]
What is the new behavior?
This PR is now the narrow Tailwind follow-up to Tailwind stylesheet pipeline overhaul analogjs/analog#2226 and the closeout direction from RFC: Tailwind stylesheet pipeline overhaul analogjs/analog#2229.
Against the current
analogjs/alphatip, the intended branch diff now does three things:hmroption from@analogjs/vite-plugin-angular,@analogjs/platform, and@analogjs/storybook-angular, and keepsliveReloadas the Angular compilation/HMR flagserver.hmrsetting for transport behavior instead of exposing a second Analog-ownedhmrflaganalog()beforetailwindcss())The docs no longer present a dual-plugin Tailwind install as an Analog-owned contract. They now point readers to Tailwind's own install docs and only document the extra Analog config needed for Angular component styles:
tailwindCss.rootStylesheet@apply@referenceinjectionCurrent diff in this PR
Live reload / HMR API cleanup:
packages/vite-plugin-angular/src/lib/angular-vite-plugin.tspackages/vite-plugin-angular/src/lib/live-reload-plugin.tspackages/platform/src/lib/options.tspackages/platform/src/lib/platform-plugin.tspackages/storybook-angular/src/types.tspackages/storybook-angular/src/lib/preset.tsvite-plugin-angularandstorybook-angularTailwind docs and README cleanup:
apps/docs-app/docs/integrations/tailwind/index.mdapps/docs-app/docs/guides/migrating.mdapps/docs-app/docs/integrations/storybook/index.mdapps/docs-app/docs/packages/create-analog/overview.mdapps/docs-app/docs/packages/vite-plugin-angular/css-preprocessors.mdpackages/vite-plugin-angular/README.mdpackages/storybook-angular/README.mdGenerator alignment:
packages/create-analog/template-latest/vite.config.tspackages/nx-plugin/src/generators/app/files/template-angular*/vite.config.ts__template__Test plan
nx format:checkpnpm buildpnpm testTargeted verification run for this version:
pnpm exec prettier --checkon the touched code/docs filespnpm nx test vite-plugin-angularpnpm nx test storybook-angularpnpm nx build platformpnpm nx build docs-appThe docs build passed. Docusaurus still reports unrelated pre-existing broken-anchor warnings elsewhere in the site.
Does this PR introduce a breaking change?
Breaking change on the current v3 alpha API surface: the duplicate Analog
hmroption is removed from the Analog/plugin/Storybook options covered by this PR. UseliveReloadfor Angular compilation/HMR behavior and Vite'sserver.hmrfor transport configuration.Other information
This PR should be reviewed as a small follow-up to Tailwind stylesheet pipeline overhaul analogjs/analog#2226, not as a second implementation pass on the Tailwind pipeline itself.