Skip to content

Conversation

@joshblack
Copy link
Member

This PR removes circular dependencies that we have in @primer/react. It also updates our rollup config to throw an error when we encounter one when bundling. Circular dependencies in an ESM context create issues where you are unable to use an imported identifier because it has not been defined in the module context yet.

Changelog

New

Changed

  • Update imports that point directly to src/index.ts and replaced them with imports directly to the module
  • Update cycles by moving shared code into a shared file, either an existing one or by creating a new one

Removed

Rollout strategy

  • Minor release

Technically this should be a refactor and no behavior should change but, just to be safe, I think this should go out under a minor release to make sure

Testing & Reviewing

  • Verify that the refactor doesn't break any references or functionality 😅

@joshblack joshblack requested review from a team and pksjce February 8, 2024 17:35
@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2024

🦋 Changeset detected

Latest commit: 3335d86

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 Feb 8, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 113 KB (-0.01% 🔽)
packages/react/dist/browser.umd.js 113.66 KB (-0.01% 🔽)

@github-actions github-actions bot temporarily deployed to storybook-preview-4236 February 8, 2024 17:48 Inactive
Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

This is great! Thanks so much for taking care of this ✨

@joshblack joshblack added this pull request to the merge queue Feb 9, 2024
Merged via the queue into main with commit 14a2776 Feb 9, 2024
@joshblack joshblack deleted the refactor/remove-circular-references branch February 9, 2024 15:39
@primer primer bot mentioned this pull request Feb 9, 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