792b8485fe
GitHub recommends blobless clones over shallow clones: https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ > For these reasons we do not recommend shallow clones except for builds that delete the repository immediately afterwards. Fetching from shallow clones can cause more harm than good! I've been using blobless clones for development for the last couple weeks. The blobless clone has the benefit of including the full repository history (for the cloned branch). Tools like `git blame` will be slower as git fetches the related blobs on-demand. Benchmarks (using all the flags in the docs): - The blobless clone is faster on my machine, taking 11.1 seconds versus 13.1 seconds for the shallow clone. - The blobless clone takes up 256M on disk, versus 244M for the shallow clone. It's worse, but not by much.
1.5 KiB
1.5 KiB
Developing
- The development branch is
canary
. - All pull requests should be opened against
canary
. - The changes on the
canary
branch are published to the@canary
tag on npm regularly.
To develop locally:
- Install Rust and Cargo via rustup.
- Install the GitHub CLI.
- Clone the Next.js repository (download only recent commits for faster clone):
gh repo clone vercel/next.js -- --filter=blob:none --branch canary --single-branch
- Create a new branch:
git checkout -b MY_BRANCH_NAME origin/canary
- Enable pnpm:
corepack enable pnpm
- Install the dependencies with:
pnpm install
- Start developing and watch for code changes:
pnpm dev
- In a new terminal, run
pnpm types
to compile declaration files from TypeScript. Note: You may need to repeat this step if your types get outdated. - When your changes are finished, commit them to the branch:
git add . git commit -m "DESCRIBE_YOUR_CHANGES_HERE"
- To open a pull request you can use the GitHub CLI which automatically forks and sets up a remote branch. Follow the prompts when running:
gh pr create
For instructions on how to build a project with your local version of the CLI, see Developing Using Your Local Version of Next.js as linking the package is not sufficient to develop locally.