Replace connect() with create() and getOrCreate()#253
Merged
alcuadrado merged 2 commits intomainfrom Apr 16, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Hardhat documentation to reflect the new Network Manager API, replacing network.connect() usage with network.create() and documenting the new network.getOrCreate() helper, alongside a small dependency bump.
Changes:
- Replaced
connect()examples and references across guides/tutorials withcreate(). - Added
network.getOrCreate()documentation and a deprecation notice fornetwork.connect(). - Bumped
@nomicfoundation/hardhat-errors(and lockfile transitivehardhat-utils).
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| STYLE.md | Updates style examples to use network.create() terminology. |
| src/content/docs/ignition/docs/guides/upgradeable-proxies.mdx | Updates example to hre.network.create(). |
| src/content/docs/ignition/docs/guides/tests.mdx | Updates testing examples to network.create(). |
| src/content/docs/ignition/docs/guides/scripts.mdx | Updates script examples to hre.network.create(). |
| src/content/docs/ignition/docs/guides/ethers.mdx | Updates ethers guide examples to hre.network.create(). |
| src/content/docs/ignition/docs/guides/deploy.mdx | Updates deploy guide examples to hre.network.create(). |
| src/content/docs/docs/tutorial/typescript-tests.mdx | Updates tutorial text/code to network.create(). |
| src/content/docs/docs/reference/network-manager.mdx | Documents create()/getOrCreate(), adds connect() deprecation notice, updates examples. |
| src/content/docs/docs/reference/edr-simulated-networks.mdx | Updates example to network.create(). |
| src/content/docs/docs/plugin-development/tutorial/testing.mdx | Updates plugin tutorial tests to hre.network.create(). |
| src/content/docs/docs/plugin-development/tutorial/task.mdx | Updates task tutorial to hre.network.create(). |
| src/content/docs/docs/plugin-development/tutorial/network-connection.mdx | Updates tutorial narrative/examples to network.create(). |
| src/content/docs/docs/plugin-development/tutorial/index.mdx | Updates tutorial introduction/examples to network.create(). |
| src/content/docs/docs/plugin-development/explanations/lifecycle.mdx | Updates lifecycle example to hre.network.create(). |
| src/content/docs/docs/plugin-development/explanations/hooks.mdx | Updates hooks explanation to reference network.create(). |
| src/content/docs/docs/migrate-from-hardhat2/index.mdx | Updates migration snippet to hre.network.create(). |
| src/content/docs/docs/migrate-from-hardhat2/guides/mocha-tests.mdx | Updates migration testing examples to hre.network.create(). |
| src/content/docs/docs/guides/writing-tasks.mdx | Updates task guide examples to hre.network.create(). |
| src/content/docs/docs/guides/writing-scripts.mdx | Updates scripts guide example to hre.network.create(). |
| src/content/docs/docs/guides/testing/using-viem.mdx | Updates viem testing guide code/text to create(). |
| src/content/docs/docs/guides/testing/using-ethers.mdx | Updates ethers testing guide code/text to create(). |
| src/content/docs/docs/guides/hardhat-node.mdx | Updates hardhat node guide snippet to network.create(). |
| src/content/docs/docs/guides/hardhat-console.mdx | Updates console docs to network.create() (but see comment about malformed <Run>). |
| src/content/docs/docs/guides/forking.mdx | Updates forking examples to network.create(). |
| src/content/docs/docs/guides/deployment/using-scripts.mdx | Updates deployment scripts examples to network.create(). |
| src/content/docs/docs/explanations/network-management.mdx | Updates explanation examples/text to network.create() and mentions getOrCreate(). |
| src/content/docs/docs/explanations/multichain-support.mdx | Updates multichain example/text to network.create(). |
| src/content/docs/docs/explanations/global-options.mdx | Updates --network explanation to reference network.create(). |
| src/content/docs/docs/explanations/edr-simulated-networks.mdx | Updates explanation example/text to network.create(). |
| pnpm-lock.yaml | Updates lockfile for bumped Hardhat dependencies. |
| package.json | Bumps @nomicfoundation/hardhat-errors to ^3.0.10. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.