Skip to content

Chore/upstream 202604#17

Merged
craftzdog merged 6 commits into
mainfrom
chore/upstream-202604
Apr 29, 2026
Merged

Chore/upstream 202604#17
craftzdog merged 6 commits into
mainfrom
chore/upstream-202604

Conversation

@craftzdog
Copy link
Copy Markdown
Contributor

Status

  • Phase 1 — Snapshot & branch (chore/upstream-202604, checked out by user)
  • Phase 2 — Dependencies + lockfile (drop @svgr/webpack, autoprefixer; bumped next 16.2.2 → 16.2.4 to clear security advisory)
  • Phase 3 — Tooling configs (postcss / prettier / eslint flat config / tsconfig jsx:react-jsx)
  • Phase 4 — Tailwind v4 CSS migration (rewrite tailwind.css with @theme/@plugin, prism.css theme()var(), deleted tailwind.config.ts, preserved font-proxyma and --container-8xl)
  • Phase 5 — Tailwind class sweep (bg-gradient-to-* → bg-linear-to-, backdrop-blur → -sm, flex-grow → grow, break-words → wrap-break-word, outline-none → outline-hidden, theme(colors.) → var(--color-*))
  • Phase 6 — Port upstream component diffs (14 component files + 6 icon files)
  • Phase 7 — Convert 30 SVGs to TSX:
    • Used a custom Node converter (/tmp/svg-convert/convert.mjs) that lifts inline <defs><style>.a{...}</style> rules onto elements, strips XML declarations, titles, descs, xlink/svgjs namespaces, then emits typed React components matching the InstallationIcon.tsx convention ((props: React.ComponentPropsWithoutRef<'svg'>) => <svg ...{...props}>).
    • Output: 30 *Icon.tsx files in src/components/icons/.
    • Naming collision: search.svgSearchGlyphIcon.tsx to avoid clashing with the existing SearchIcon in Search.tsx.
    • Rewrote SvgIcon.jsxSvgIcon.tsx with a typed IconName union; registry key 'search' still maps for docs {% icon name="search" /%}.
    • Deleted the 30 source .svg files (kept the unused ones for follow-up cleanup).
  • Phase 8 — Simplify next.config.mjs (no webpack block, added nextjsExports: ['revalidate'])
  • Phase 9 — React 19 / TypeScript polish (tsc --noEmit clean, ESLint clean, added one react-hooks/immutability disable in Search.tsx for the autocomplete self-reference inside navigate)
  • Phase 10 — Smoke test:
    • npm run build → all 72 routes generated successfully
    • npm run dev → home (200, 110KB) and /start-guide/how-to-write-markdown-notes (200, 114KB) render
    • font-proxyma class present in HTML
    • Cog SVG path M10.546… rendered twice on a docs page (matches the two {% icon name="cog" /%} markdown calls)
  • Phase 11 — Commit on chore/upstream-202604

Outcome

Completed. Notes:

  • Deviation from upstream: Bumped next to 16.2.4 (upstream pinned 16.2.2) to clear a high-severity advisory.
  • Open follow-up: 2 transitive vulnerabilities remain in next's nested postcss. The only suggested "fix" is downgrading next to 9.3.3 (absurd). Accepted as-is until a future Next patch ships.
  • Open follow-up: ~50 unused .svg files remain in src/components/icons/. Out of scope for this PR; safe to delete in a follow-up cleanup PR.
  • Open follow-up: Fence.tsx's require('prismjs/components/prism-bash') may be redundant since v2 of prism-react-renderer includes a base bundle. Did not verify; left untouched per "leave working code alone" principle.
  • Did NOT push — branch chore/upstream-202604 is local. Open a PR when ready.

Files changed

.eslintrc.json                              D
eslint.config.mjs                           A
next.config.mjs                             M  (drop SVGR webpack, add nextjsExports)
package-lock.json                           M
package.json                                M
postcss.config.js                           M  (drop autoprefixer, use @tailwindcss/postcss)
prettier.config.js                          M  (add tailwindStylesheet)
src/app/not-found.tsx                       M
src/components/Button.tsx                   M
src/components/Callout.tsx                  M
src/components/DocsLayout.tsx               M
src/components/Hero.tsx                     M
src/components/Icon.tsx                     M
src/components/Layout.tsx                   M
src/components/MobileNavigation.tsx         M
src/components/Navigation.tsx               M
src/components/Prose.tsx                    M
src/components/QuickLinks.tsx               M
src/components/Search.tsx                   M
src/components/SnippetWindow.jsx            M
src/components/SvgIcon.jsx                  D
src/components/SvgIcon.tsx                  A
src/components/TableOfContents.tsx          M
src/components/ThemeSelector.tsx            M
src/components/ThumbLinks.jsx               M
src/components/icons/{Installation,Lightbulb,Plugins,Presets,Theming,Warning}Icon.tsx  M
src/components/icons/<30 new>Icon.tsx       A
src/components/icons/<30 used>.svg          D
src/styles/prism.css                        M
src/styles/tailwind.css                     M
tailwind.config.ts                          D
tsconfig.json                               M

Sync with upstream Tailwind Plus Syntax template (commit 0e86a10).

Stack:
- next 14 -> 16.2.4 (webpack mode via --webpack flag)
- react / react-dom 18 -> 19.2.4
- tailwindcss 3 -> 4.2.4 (CSS-first @theme config)
- @markdoc/next.js 0.3 -> 0.5 (nextjsExports: ['revalidate'])
- eslint 8 -> 9 (flat config)
- @headlessui/react, next-themes, flexsearch, prettier-plugin-tailwindcss bumps

Tailwind v4 migration:
- tailwind.css now @import 'tailwindcss' + @plugin + @theme blocks
  (font-proxyma and container-8xl preserved)
- prism.css uses var(--color-*) instead of theme()
- delete tailwind.config.ts (replaced by CSS @theme)
- delete autoprefixer (bundled in v4)
- class sweep: bg-gradient-to-* -> bg-linear-to-*, backdrop-blur ->
  backdrop-blur-sm, flex-grow -> grow, break-words -> wrap-break-word,
  outline-none -> outline-hidden, theme(colors.*) -> var(--color-*)

Drop @svgr/webpack, convert SVG icons to TSX:
- 30 used SVGs converted to React components in src/components/icons/*Icon.tsx
- SvgIcon.jsx -> SvgIcon.tsx (typed registry)
- search.svg -> SearchGlyphIcon.tsx (avoid name clash with Search.tsx)
- next.config.mjs no longer needs custom webpack block
- prismjs and fathom-client kept (Fence.tsx requires + Fathom analytics)
@craftzdog craftzdog merged commit aa2b398 into main Apr 29, 2026
1 of 2 checks passed
@craftzdog craftzdog deleted the chore/upstream-202604 branch April 29, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant