Skip to content

Add migration guide from styled-components to vanilla-extract#60

Open
fed wants to merge 1 commit intomasterfrom
vanilla-extract-migration-guide
Open

Add migration guide from styled-components to vanilla-extract#60
fed wants to merge 1 commit intomasterfrom
vanilla-extract-migration-guide

Conversation

@fed
Copy link
Copy Markdown
Owner

@fed fed commented Mar 28, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 28, 2026 23:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new blog post documenting a migration path from styled-components to vanilla-extract, alongside small supporting updates to UI category taxonomy and styling/formatting configuration.

Changes:

  • Add a new “Migrating from styled-components to vanilla-extract” blog post under the new frontend category.
  • Replace the react category id with frontend in the UI category enum/model.
  • Update Markdown styling and adjust repo formatting defaults (Prettier/EditorConfig) toward tabs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/ui/types.ts Renames category id from react to frontend in the CategoryId enum.
src/model/categories.ts Updates the displayed category title/description to match the new frontend category.
src/ui/markdown.css.ts Re-indents and tweaks Markdown global styles (notably inline code and code blocks).
src/pages/blog/migrating-styled-components-vanilla-extract.md New migration-guide blog post content.
.prettierrc Changes formatting defaults (enables tabs).
.editorconfig Changes editor indentation defaults to tabs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/model/categories.ts
description: 'Thoughts about the React ecosystem, mostly on building declarative UIs and handling state.',
id: CategoryId.FRONTEND,
title: 'Frontend Web Development',
description: 'Thoughts about the frontend web development, including the React ecosystem, CSS libraries and everything in between.',
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar: “Thoughts about the frontend web development…” reads awkwardly; consider changing to “Thoughts about frontend web development…” (or similar) to avoid the extra “the”.

Suggested change
description: 'Thoughts about the frontend web development, including the React ecosystem, CSS libraries and everything in between.',
description: 'Thoughts about frontend web development, including the React ecosystem, CSS libraries and everything in between.',

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +109
case 'default':
default:
return css`
background-color: ${colors.grayMedium};
`;
}
}}}
`;
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the styled-components example snippet, the interpolation closing braces look unbalanced (}}}} at the end of the ${(props) => { ... }} block). Since this is a migration guide, it’d be good to fix the snippet so readers can copy/paste it without syntax errors.

Copilot uses AI. Check for mistakes.
Comment thread src/ui/types.ts
@@ -4,7 +4,7 @@ export enum CategoryId {
JAVASCRIPT = 'javascript',
TESTING = 'testing',
ACCESSIBILITY = 'accessibility',
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CategoryId.REACT was removed from the enum, but there are still references to it (e.g. src/model/external-posts.ts:34). This will break the TypeScript build; either add a backwards-compatible alias (e.g. keep REACT = 'react') or update all remaining references to use FRONTEND/'frontend' as intended.

Suggested change
ACCESSIBILITY = 'accessibility',
ACCESSIBILITY = 'accessibility',
REACT = 'react',

Copilot uses AI. Check for mistakes.
Comment thread src/ui/types.ts
TESTING = 'testing',
ACCESSIBILITY = 'accessibility',
REACT = 'react',
FRONTEND = 'frontend',
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming the category id from 'react' to 'frontend' also requires updating test fixtures that assert on the serialized categoryId string (e.g. src/templates/index.test.tsx currently expects categoryId: 'react'). Without updating those, the Jest suite will fail.

Suggested change
FRONTEND = 'frontend',
FRONTEND = 'react',

Copilot uses AI. Check for mistakes.
Comment thread src/ui/markdown.css.ts
Comment on lines 64 to +71
globalStyle(`${markdownStyle} code:not([class="grvsc-code"])`, {
backgroundColor: 'rgba(27, 31, 35, 0.05)',
borderRadius: borderRadius.default,
fontSize: '80%',
margin: 0,
padding: `${0.375 * gridSize}px ${0.75 * gridSize}px`,
whiteSpace: 'normal',
fontWeight: fontWeights.normal,
backgroundColor: 'rgba(27, 31, 35, 0.05)',
borderRadius: borderRadius.default,
fontSize: '80%',
margin: 0,
padding: `${0.375 * gridSize}px ${0.75 * gridSize}px`,
whiteSpace: 'nowrap',
fontWeight: fontWeights.normal,
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline-code style changes whiteSpace from normal to nowrap. This can cause long inline code spans/URLs to overflow their container instead of wrapping, especially on narrow viewports. Consider reverting to normal (or using a wrapping-friendly option like pre-wrap plus overflowWrap/wordBreak) unless the no-wrap behavior is explicitly desired.

Copilot uses AI. Check for mistakes.
Comment thread .prettierrc
Comment on lines +2 to +7
"useTabs": true,
"tabWidth": 4,
"printWidth": 140,
"singleQuote": true,
"proseWrap": "always",
"trailingComma": "all"
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR changes formatting defaults repo-wide (useTabs: true). That’s a broad, potentially high-churn change that isn’t implied by the PR title (migration guide) and will affect every future formatted file. If the intent is only to fix a single file’s formatting, consider reverting this config change or scoping it to specific filetypes via overrides.

Copilot uses AI. Check for mistakes.
Comment thread .editorconfig
Comment on lines 5 to 9
end_of_line = LF
charset = utf-8
indent_style = space
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching the global indent_style to tab changes editor behavior for all files in the repo. If the goal is to enforce tabs only for TS/JS while keeping spaces for other formats (or to avoid reindent churn), consider adding per-glob overrides (or leaving the global style as spaces) rather than changing [*].

Copilot uses AI. Check for mistakes.
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.

2 participants