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

chore(repo): Scoping Turborepo task inputs #1882

Merged
merged 4 commits into from
Oct 19, 2023
Merged

Conversation

tmilewski
Copy link
Member

@tmilewski tmilewski commented Oct 14, 2023

Description

Speed up DX by scoping down the Turborepo inputs on particular tasks.

As-is, any changed file in a package results in Turborepo marking that package as altered. That slows down the DX as it requires a task (and, potentially, dependent tasks) to be re-run every time.

This PR ensures that only the relevant files are considered when Turborepo is making that determination.

There are a number of useful cases for this, like speeding up the turnaround time for developers running tasks like npm run test.

The convoluted example below might not seem like much, but it all adds up, especially, when the dependent tasks are further up the dependency graph.

Example:

You're testing a change you made to @clerk/clerk-sdk-node directly and your editing only your tests.

Current

You run npm run test -- --filter=@clerk/clerk-sdk-node:

Because all files are considered for the dependent build task, it's also re-run:

  • @clerk/clerk-sdk-node:build (runs)
  • @clerk/clerk-sdk-node:test (runs)

New

You run npm run test -- --filter=@clerk/clerk-sdk-node:

Because only required files are considered for the dependent build, it isn't re-run:

  • @clerk/clerk-sdk-node:build (cached)
  • @clerk/clerk-sdk-node:test (runs)

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@tmilewski tmilewski self-assigned this Oct 14, 2023
@tmilewski tmilewski requested a review from a team as a code owner October 14, 2023 18:13
@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2023

🦋 Changeset detected

Latest commit: 25b5840

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

Copy link
Member

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Small typo

package.json Outdated Show resolved Hide resolved
Copy link
Member

@BRKalow BRKalow left a comment

Choose a reason for hiding this comment

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

I love that you're using the per-workspace turbo.json files here!

@tmilewski tmilewski force-pushed the build/turbo-task-inputs branch from c64e8e6 to 4be2951 Compare October 17, 2023 19:07
@LekoArts LekoArts dismissed their stale review October 18, 2023 07:36

Changes were made

package.json Outdated Show resolved Hide resolved
@tmilewski tmilewski force-pushed the build/turbo-task-inputs branch from 4be2951 to 201750e Compare October 18, 2023 18:47
@tmilewski tmilewski requested review from BRKalow and LekoArts October 18, 2023 19:00
@tmilewski tmilewski enabled auto-merge October 18, 2023 21:30
Copy link
Member

@BRKalow BRKalow left a comment

Choose a reason for hiding this comment

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

One question about the dependsOn change for lint, otherwise this looks pretty good. Nice improvement!

turbo.json Show resolved Hide resolved
@tmilewski tmilewski disabled auto-merge October 19, 2023 03:39
@tmilewski tmilewski enabled auto-merge October 19, 2023 03:39
@tmilewski tmilewski added this pull request to the merge queue Oct 19, 2023
Merged via the queue into main with commit e5ac37e Oct 19, 2023
12 checks passed
@tmilewski tmilewski deleted the build/turbo-task-inputs branch October 19, 2023 03:56
@clerk-cookie
Copy link
Collaborator

This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@clerk clerk locked as resolved and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants