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

Use extracted @primer/behaviors #1700

Merged
merged 4 commits into from
Dec 8, 2021
Merged

Use extracted @primer/behaviors #1700

merged 4 commits into from
Dec 8, 2021

Conversation

dgreif
Copy link
Member

@dgreif dgreif commented Dec 6, 2021

As discussed in ADR 2, all of the "behaviors" in PRC have been written in vanilla javascript, with React Hooks that wrap the vanilla js behaviors. One of the reasons for this approach was that the behaviors could eventually be extracted and shared with other projects, like PVC and github/github. We have seen an increased need for a few of these behaviors on the github/github side, and have extracted the behaviors to a new @primer/behaviors package that can be shared. This PR removes all of the behaviors from the PRC project and pulls in @primer/behaviors as a replacement.

Closes https://github.com/github/primer/issues/483

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • 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.

@dgreif dgreif requested review from a team and pksjce December 6, 2021 15:48
@changeset-bot
Copy link

changeset-bot bot commented Dec 6, 2021

🦋 Changeset detected

Latest commit: c49033b

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 Patch

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 Dec 6, 2021

size-limit report 📦

Path Size
dist/browser.esm.js 56.98 KB (-0.48% 🔽)
dist/browser.umd.js 57.29 KB (-0.56% 🔽)

@@ -9,5 +9,7 @@ module.exports = {
'<rootDir>/src/utils/test-deprecations.tsx',
'<rootDir>/src/utils/test-helpers.tsx'
],
testMatch: ['<rootDir>/(src|codemods)/__tests__/**/*.test.[jt]s?(x)', '!**/*.types.test.[jt]s?(x)']
testMatch: ['<rootDir>/(src|codemods)/__tests__/**/*.test.[jt]s?(x)', '!**/*.types.test.[jt]s?(x)'],
// @primer/behaviors is ESM, so needs to be transformed
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this didn't make sense to me — it seems like you're saying something needs to be transformed, but then the code seems like you're setting it to be ignored?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good old double negatives at work here. This is the transform ignore option, and we are passing it a regex for node_modules minus @primer/behaviors. By setting this option, we overwrite the default which is just node_modules

Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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


CleanShot 2021-12-06 at 17 07 25@2x

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