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

Introducing nx for caching #4766

Merged
merged 11 commits into from
Mar 25, 2023

Conversation

ZackDeRose
Copy link
Contributor

What it does

  • Mainly a like-for-like for the following package scripts: build, test:ci, typecheck
    • These three commands will still be called as they have been (e.g.: npm run build) and have the same effect. They have been optimized to add intelligent caching so we never need to run the same command on the same code twice!
    • (build was also optimized to run it's rollup and tsc commands in parallel, whereas before they were in sequence)
  • The pr workflow file was updated - it will still run the same checks as it had before, but it will now run all checks in parallel (as opposed to in sequence)
  • Adding nx means that we can use nx for task running which gives us some nice things - for example we can use the command: nx run-many --target=build to run all build tasks in the workspace, which includes all examples.
    • this could be a nice addition to add to the pr.yml file, so we can assert none of the examples broke by the PR's changes
    • intelligent caching has been added here as well (see the video for a demo!)

@vercel
Copy link

vercel bot commented Mar 20, 2023

@ZackDeRose is attempting to deploy a commit to the Tanstack Team on Vercel.

A member of the Team first needs to authorize it.

@ZackDeRose
Copy link
Contributor Author

ZackDeRose commented Mar 20, 2023

Missed this in the video, but looks like we need a dependency on from build-js (the rollup script), so it runs before we can run our tests (which makes sense!)

I added that to the project.json file:

{
  "name": "root",
  "targets": {
    // ...
    "test:ci": {
      "command": "vitest",
      "inputs": ["packageSources", "{workspaceRoot}/packages/*/__tests__/**/*"],
      "dependsOn": ["build-js"] // <== just added this line
    }
  }
}

With the timings (and typecheck being the long stick), the result is this "pipeline" in the pr script:

Screen Shot 2023-03-19 at 10 11 09 PM

@KevinVandy KevinVandy merged commit 17cea29 into TanStack:main Mar 25, 2023
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.

None yet

2 participants