-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: use pnpm to manage dependencies #12635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but TypeScript is acting up, and I don't see why since nothing should be different with regard to typing. 🤔 Also something fishy going on with plugin server tests.
addFilterDefaultOptions, | ||
}) | ||
const { reportFunnelStepReordered } = useActions(eventUsageLogic) | ||
export const ActionFilter = React.forwardRef<HTMLDivElement, ActionFilterProps>(function ActionFilter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this addition of function
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's for the ESLint rule react/display-name
- with the arrow function inside forwardRef
, the wrapped component is unnamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, I thought we were already compliant with this rule. Looks like it's just been a while since this file was last edited and only now did ESLint catch this.
Yeah... So this is the fun of migrating from Yarn 1 to pnpm (or a more strict Yarn) - Yarn 1 hoisted all modules to the root of With pnpm or a more correct Yarn version, you can only import packages specified in I'll keep watching the build, I think I'm getting closer to fixing all the TS issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking fantastic, well done! Ran this locally (bin/start
) and everything's working.
The only remaining issue it those few failing Cypress tests – though I ran them on a clean setup locally with fully green results, so this might be some flakiness. Also not sure why Jest tests haven't ran in CI. Once the checks are green, we can merge this.
patches/kea-forms@3.0.1.patch
Outdated
@@ -0,0 +1,37 @@ | |||
diff --git a/lib/types.d.ts b/lib/types.d.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @mariusandra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, cool, yeah an upstream fix would be even better. 🙂
The issue here is that kea
in 3.0.0-alpha accepted just two generic arguments for SelectorDefinition
, but in the 3.x.x released version requires three. Looks like kea-forms
assumes the alpha version's types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding this! I released version 3.0.2 of kea-forms with the fix.
addFilterDefaultOptions, | ||
}) | ||
const { reportFunnelStepReordered } = useActions(eventUsageLogic) | ||
export const ActionFilter = React.forwardRef<HTMLDivElement, ActionFilterProps>(function ActionFilter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, I thought we were already compliant with this rule. Looks like it's just been a while since this file was last edited and only now did ESLint catch this.
Yeah, having done this before, the flakiness may very well be related to some module reshuffling, and after merge / deploy it's quite possible that there might be a followup issue to fix for the release. 🙂 Whenever this is merged, it would be good to watch for any errors, etc. |
.github/workflows/ci-frontend.yml
Outdated
# Split the test into 3 parts. To increase the number split change the denominator in `length / 3` | ||
run: echo "test-chunks=$(yarn test --listTests --json | sed -n 3p | jq -cM '[_nwise(length / 3 | ceil)]')" >> $GITHUB_OUTPUT | ||
run: echo "test-chunks=$(pnpm test -- --listTests --json | sed -n 3p | jq -cM '[_nwise(length / 3 | ceil)]')" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jest tests aren't running in CI. Looks like this should be sed -n 5p
with pnpm
+ we might need to update ts-node
, as I'm getting a "Non-string value passed to ts.resolveTypeReferenceDirective
" error.
I would push this myself, but "Allow edits and access to secrets by maintainers" is unchecked on this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 👍
Allow edits and access to secrets by maintainers
Apparently GitHub doesn't support this if the repo and the fork are both located in organization accounts rather than personal accounts. 🤷 https://github.com/orgs/community/discussions/5634
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's very annoying. Now there are some "Jest encountered an unexpected token" problems in Frontend CI checks, and unfortunately I'm not able to push a fix either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! The last changes I think we need are:
- kea-forms can now be upgraded to a version that fixes the bug
- multiple RUN commands in production.Dockerfile should be combined to one, in two places
Other than that, if there's no easy way to get CI working, we're just going to merge it in, and quickly fix things if any remaining issues arise. I think the stakes are low enough that we could get away with it.
Okay, I've updated with changes from |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
We recently upgraded Jest and are running it now through I'd be happy to merge it in, though we decided to wait until next week as we're just about to release a new version of PostHog... and just in case it's best to wait for after that :). |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
Closing in favor of #13190 🚀 |
* chore: use pnpm to manage dependencies * Fix CI errors * Don't report Docker image size for external PRs * Fix pnpm-lock.yaml formatting * Fix module versions * Ignore pnpm-lock.yaml * Upgrade Cypress action for pnpm support * Set up node and pnpm before Cypress * Fix typescript issues * Include patches directory in Dockerfile * Fix Jest tests in CI * Update lockfile * Update lockfile * Clean up Dockerfile * Update pnpm-lock.yaml to reflect current package.json files * remove yarn-error.log from .gitignore * formatting * update data exploration readme * type jest.config.ts * fix @react-hook issues for jest * fix react-syntax-highlighter issues for jest * fix jest issues from query-selector-shadow-dom * fix transform ignore patterns and undo previous fixes * add missing storybook peer dependencies * fix nullish coalescing operator for storybook * reorder storybook plugins * update editor-update-tsd warning to new npm script * use legacy ssl for chromatic / node 18 compatibility * use pnpm for visual regression testing workflow * use node 16 for chromatic * add @babel/plugin-proposal-nullish-coalescing-operator as direct dependency * try fix for plugin-server * cleanup * fix comment and warning * update more comments * update playwright dockerfile * update plugin source types * conditional image size reporting * revert react-native instructions * less restrictive pnpm verions * use ref component name in line with style guide Co-authored-by: Jacob Gillespie <jacobwgillespie@gmail.com>
Thank you so much @jacobwgillespie! Check your email for a small gift from us :) |
Hey, thank you! 🙌 |
Problem
Followup from #12520 (see there for more context), this PR replaces Yarn 1 with pnpm. Yarn 1 is semi-unmaintained and has caused issues in
docker build
.Changes
This PR switches to use
pnpm
instead ofyarn
. The highlights are:package.json
if they previously were only available due to hoisting.How did you test this code?
Installed locally + ran
docker build
. Will need CI to run the tests.