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

[v-next] Port compile task to v-next package #5193

Merged
merged 68 commits into from May 15, 2024

Conversation

kanej
Copy link
Member

@kanej kanej commented May 9, 2024

This is an updated version of #5149, rebased off of the latest v-next.

This PR separates out the Hardhat compilation tasks into a separate package and converts them into a build system component.

The build system component package has been esmified and the original compilation tests ported across.

We have opted to separate out further internal code improvements as follow on PRs.

TODO

  • Double check ESM modifications to get back to green
  • Fix build on CI
  • Swap as many utils for the ./v-next/hardhat-utils as possible
  • Reassess dependencies for the package based after the utils swaps
  • Review each TODO
  • Refactor build system

Copy link

vercel bot commented May 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 2:41pm

Copy link

changeset-bot bot commented May 9, 2024

⚠️ No Changeset found

Latest commit: c565dfb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

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

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

import debug from "debug";
import fsExtra from "fs-extra";
import * as t from "io-ts";
import { deepEqual } from "fast-equals";
Copy link
Member Author

Choose a reason for hiding this comment

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

To pull this in directly from utils would mean making the chain of function calls above the cache async, is that what we intend with an async deepEqual?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably a question for @alcuadrado, but I believe we should be fine. The asynchronicity comes from dynamically importing the fast-equals package inside deepEqual. However, after the initial load, it is cached, so subsequent loads should be fast. The only potential disadvantage is the extra boilerplate required by all the async/await statements.

Copy link
Member

Choose a reason for hiding this comment

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

We discussed this and decided to defer the decision

return template;
}

export function assertHardhatInvariant(
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this move to utils?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is now in the Hardhat Errors package, we should pull it from there.

@@ -0,0 +1 @@
declare module "adm-zip";
Copy link
Member Author

Choose a reason for hiding this comment

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

This appeared to be necessary once we moved to v-next. I will look again at why we are not picking up the types.

kanej added 3 commits May 15, 2024 15:06
We should import this from the errors package, for the moment make this
public to get to passing.
Urls are required for dynamic import, on windows that means that just
resolving the path isn't enough.
@kanej kanej marked this pull request as ready for review May 15, 2024 14:36
@kanej kanej merged commit ad57553 into v-next May 15, 2024
39 checks passed
@kanej kanej deleted the esmify-compilation-against-vnext branch May 15, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants