Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move legacy primer/primitives into Primer React #3787

Merged
merged 25 commits into from
Jan 17, 2024
Merged

Conversation

langermank
Copy link
Contributor

@langermank langermank commented Oct 4, 2023

Part of https://github.com/github/primer/issues/2054

As we gear up for Primitives v8 (next major) I'm looking for ways we can stopgap the breaking change to provide more time for Primer libraries to upgrade. This PR copies the dist that Primer React depends on directly into Primer React which allows us to remove it from Primitives. The only thing truly referenced from Primitives are colors, while most other values were hand written in the theme file.

Goals:

  • Don't break anything
  • No major refactor, just a stopgap

Changelog

New

  • Adds the colors dist from primer/primitives and removes dependency

Changed

  • Moved typography into the theme file directly and removed the unused stuff
  • Converted to es modules

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan

Testing & Reviewing

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2023

🦋 Changeset detected

Latest commit: 3d43bf4

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.47 KB (-0.48% 🔽)
dist/browser.umd.js 105.08 KB (-0.43% 🔽)

@langermank langermank temporarily deployed to github-pages October 5, 2023 16:48 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3787 October 5, 2023 16:48 Inactive
@langermank langermank temporarily deployed to github-pages October 5, 2023 17:03 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3787 October 5, 2023 17:04 Inactive
@langermank langermank temporarily deployed to github-pages October 5, 2023 17:22 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3787 October 5, 2023 17:22 Inactive
@langermank langermank marked this pull request as ready for review October 5, 2023 17:33
@langermank langermank temporarily deployed to github-pages October 5, 2023 17:39 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3787 October 5, 2023 17:40 Inactive
@@ -0,0 +1,602 @@
const colors = {
Copy link
Member

Choose a reason for hiding this comment

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

Could these files be .ts with the variable set as const? This could mean that the files are checked with TypeScript and we don't have to check-in the generated definition files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally! Thanks, will make that change 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joshblack took a stab at converting it all to JS, can you give it a look? I don't totally know what I'm doing.

@langermank langermank temporarily deployed to github-pages October 5, 2023 22:15 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3787 October 5, 2023 22:16 Inactive
Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Seems great! I think we just need to debug the integration PR failing and should be good to try out in our next release 👀

CODEOWNERS Outdated Show resolved Hide resolved
src/theme.ts Outdated Show resolved Hide resolved
@langermank langermank added this pull request to the merge queue Jan 17, 2024
Merged via the queue into main with commit c9d7421 Jan 17, 2024
30 checks passed
@langermank langermank deleted the temp-legacy-primitives branch January 17, 2024 23:44
@primer primer bot mentioned this pull request Jan 17, 2024
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.

3 participants