Skip to content

Replace connect() with create() and getOrCreate()#253

Merged
alcuadrado merged 2 commits intomainfrom
get-or-create
Apr 16, 2026
Merged

Replace connect() with create() and getOrCreate()#253
alcuadrado merged 2 commits intomainfrom
get-or-create

Conversation

@alcuadrado
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 11, 2026 12:31
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hardhat-website Ready Ready Preview, Comment Apr 16, 2026 9:28pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 with create().
  • Added network.getOrCreate() documentation and a deprecation notice for network.connect().
  • Bumped @nomicfoundation/hardhat-errors (and lockfile transitive hardhat-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.

Comment thread src/content/docs/docs/guides/hardhat-console.mdx Outdated
Comment thread src/content/docs/docs/plugin-development/tutorial/testing.mdx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@alcuadrado alcuadrado enabled auto-merge April 16, 2026 21:27
@alcuadrado alcuadrado disabled auto-merge April 16, 2026 21:44
@alcuadrado alcuadrado merged commit 2f91b61 into main Apr 16, 2026
3 checks passed
@alcuadrado alcuadrado deleted the get-or-create branch April 16, 2026 21:44
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.

2 participants