Skip to content

refactor(react): remove circular dependencies - #4236

Merged
joshblack merged 5 commits into
mainfrom
refactor/remove-circular-references
Feb 9, 2024
Merged

refactor(react): remove circular dependencies#4236
joshblack merged 5 commits into
mainfrom
refactor/remove-circular-references

Conversation

@joshblack

Copy link
Copy Markdown
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 pksjceFebruary 8, 2024 17:35
@changeset-bot

changeset-botBot commented Feb 8, 2024

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactMinor

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

github-actionsBot commented Feb 8, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js113 KB (-0.01% 🔽)
packages/react/dist/browser.umd.js113.66 KB (-0.01% 🔽)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-4236 February 8, 2024 17:48 Inactive

@broccolinisoupbroccolinisoup left a comment

Copy link
Copy Markdown
Member

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 queueFeb 9, 2024
Merged via the queue into main with commit 14a2776Feb 9, 2024
@joshblack
joshblack deleted the refactor/remove-circular-references branch February 9, 2024 15:39
@primerprimerBot mentioned this pull request Feb 9, 2024
Sign up for freeto 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

@joshblack@broccolinisoup