Skip to content

Sync Primer view_components upstream through v0.51.6 - #502

Closed
myabc wants to merge 7 commits into
mainfrom
bump/primer-upstream
Closed

Sync Primer view_components upstream through v0.51.6#502
myabc wants to merge 7 commits into
mainfrom
bump/primer-upstream

Conversation

@myabc

@myabc myabc commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

🤖 Opened by an agent on Alex's behalf.

Syncs the fork with primer/view_components through upstream v0.51.6 — merge target 6733f3c0e (parent of Release Tracking primer#4098).

Upstream changes included

Fork-specific commits on top

  • Re-applies the recursive tsconfig include (app/components/primer/**/*.ts). The merge otherwise reverts it to upstream's top-level-only glob, so nested component TS transforms without experimentalDecorators under Vite 8/rolldown and the demo build dies on Catalyst @controller (terser: Unexpected character '@'), failing every chrome system test. Verified locally: tsc clean, demo Vite build green (315ms).
  • Inherits the static-files-workflow credential fix already on main (dd6de0efd), so the "Generate static files" job can push again.

Notes

  • Replaces the previous Sync Primer view_components upstream through v0.51.6 #499 branch, which committed botched static/classes.json output and had a messy force-push / CI-autocommit history.
  • static/classnames.* regenerated from the merged sources and confirmed idempotent.
  • Dependencies kept at the fork's (higher) versions — no upstream gem or npm lockfile bumps were dropped by merge=ours.

primer Bot and others added 6 commits June 16, 2026 15:55
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…lector lists (primer#4095)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Syncs the fork with primer/view_components up to upstream commit
6733f3c (parent of Release Tracking primer#4098), the last release in
this batch reaching v0.51.6.

Notable upstream changes pulled in:
- classnames.js Set export (primer#4096): static/classnames.{js,cjs,d.ts}
  plus the package.json exports subpath and files entries.
- perf(css): removed universal `*` subjects and expanded merged
  `:is()` selector lists (primer#4095).

Conflicts resolved keeping the fork's identity, scope and its higher
dependency versions; upstream's new exports/files additions and the
static class-name output were merged in and regenerated cleanly.
Extends the include glob so nested component sources (alpha/,
beta/, open_project/) are matched, and excludes generated .d.ts
files that would otherwise conflict with their sources.

Fixes the Vite dev server in the demo app: its per-file tsconfig
resolution honours include patterns, so unmatched files were
transformed without experimentalDecorators. Catalyst @controller
decorators then reached the browser untransformed, aborting the
whole JS module graph - no custom elements were registered and
ActionMenu overlays rendered as static in-flow content.

(cherry picked from commit ba86b76)
(cherry picked from commit 393f680)
Copilot AI review requested due to automatic review settings July 21, 2026 14:29
@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cd07172

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@openproject/primer-view-components Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@myabc myabc closed this Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Syncs this fork with upstream primer/view_components through v0.51.6, while preserving fork-specific TypeScript build behavior and incorporating upstream CSS performance improvements and a new classnames export intended for consumer/tooling use.

Changes:

  • Expand CSS selectors (avoid universal subjects / merged :is() lists) to improve style-recalc performance in a few components.
  • Add static/classnames.{js,cjs,d.ts} plus package.json subpath exports and update script/export-css-selectors to generate the flat class-name set.
  • Update tsconfig.json to include nested component TS files and exclude *.d.ts.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsconfig.json Makes TS compilation include nested component sources; excludes *.d.ts.
static/classnames.js New ESM Set export of all class names (generated).
static/classnames.d.ts Types for the classnames subpath export.
static/classnames.cjs New CJS Set export of all class names (generated).
static/classes.json Regenerated classes-to-component mapping reflecting CSS selector expansion.
script/export-css-selectors Updates selector export script to also emit the flat classnames set.
package.json Adds exports (including ./classnames) and ships the new static artifacts.
app/components/primer/beta/popover.pcss Expands caret selectors for better style-recalc performance.
app/components/primer/beta/breadcrumbs.pcss Expands selectors to avoid merged :is(...) compilation.
app/components/primer/alpha/text_field.pcss Adds stylelint disable/enable and expands selectors for performance.
app/components/primer/alpha/auto_complete.pcss Removes universal descendant color override in favor of inheritance.
.devcontainer/Dockerfile Removes Yarn apt source to avoid apt-key/GPG failures in devcontainer builds.
.changeset/fast-pumas-juggle.md Changeset for CSS style-recalc performance improvements.
.changeset/classnames-export.md Changeset for the new classnames export.

Comment on lines +55 to +63
if (collectClassNames) {
parsed.forEach(compound => {
compound.forEach(token => {
if (token.type === 'attribute' && token.name === 'class' && token.action === 'element') {
allClassNames.add(token.value)
}
})
})
}
Comment thread package.json
Comment on lines +14 to +18
"./classnames": {
"types": "./static/classnames.d.ts",
"import": "./static/classnames.js",
"require": "./static/classnames.cjs"
},
@github-actions

Copy link
Copy Markdown

⚠️ Visual or ARIA snapshot differences found

Our visual and ARIA snapshot tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional.

Review differences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants