Skip to content

Conversation

@DannyDelott
Copy link
Contributor

@DannyDelott DannyDelott commented Nov 8, 2024

During the process of refactoring tech debt in appconfig and the frontend, I encountered an issue with the YieldSourceId type, which is defined using TypeScript’s declaration merging feature. When imported into the UI, this type was incorrectly resolving to never.

Investigation & Discovery

After spending considerable time troubleshooting, I shared the issue on StackOverflow to gain insights.

Solution & Comparison

This PR introduces a minimal reproduction case that demonstrates the discrepancy in type resolution when building the .d.ts definition file using tsc versus tsup.

  • With tsc: The declaration merging behaves as expected, and the correct type definition is produced.
  • With tsup: The type unexpectedly resolves to never.

This PR serves as both documentation of the issue and a comparison of the behavior between the two build tools.

@changeset-bot
Copy link

changeset-bot bot commented Nov 8, 2024

⚠️ No Changeset found

Latest commit: 154bd07

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

@vercel
Copy link

vercel bot commented Nov 8, 2024

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

Name Status Preview Comments Updated (UTC)
hyperdrive-mainnet-staging ❌ Failed (Inspect) Nov 12, 2024 1:11am
hyperdrive-sepolia-staging ❌ Failed (Inspect) Nov 12, 2024 1:11am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
hyperdrive-js ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 1:11am
hyperdrive-mainnet-production ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 1:11am
hyperdrive-sepolia-production ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 1:11am
testnet-v1 ⬜️ Ignored (Inspect) Nov 12, 2024 1:11am
testnet-v1.0.6 ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 1:11am
trading-competition ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 1:11am

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