Skip to content

Use extracted @primer/behaviors - #1700

Merged
dgreif merged 4 commits into
mainfrom
primer-behaviors
Dec 8, 2021
Merged

Use extracted @primer/behaviors#1700
dgreif merged 4 commits into
mainfrom
primer-behaviors

Conversation

@dgreif

Copy link
Copy Markdown
Contributor

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.

Closeshttps://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 pksjceDecember 6, 2021 15:48
@changeset-bot

changeset-botBot commented Dec 6, 2021

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js56.98 KB (-0.48% 🔽)
dist/browser.umd.js57.29 KB (-0.56% 🔽)

Comment threadjest.config.js
],
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

@colebemiscolebemis left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread.changeset/neat-forks-shout.md Outdated
@dgreif
dgreif merged commit 9d2827a into mainDec 8, 2021
@dgreif
dgreif deleted the primer-behaviors branch December 8, 2021 21:56
@github-actionsgithub-actionsBot mentioned this pull request Dec 8, 2021
@dgreifdgreif mentioned this pull request Dec 13, 2021
pksjce pushed a commit that referenced this pull request Dec 20, 2021
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.

3 participants

@dgreif@jfuchs@colebemis