solana-labs / solana-web3.js

Solana JavaScript SDK
https://solana-labs.github.io/solana-web3.js
MIT License
1.97k stars 792 forks source link

Rework the `__DEV__` flag to work with node-style and Vite-style build systems #2820

Closed steveluscher closed 2 weeks ago

changeset-bot[bot] commented 3 weeks ago

⚠️ No Changeset found

Latest commit: 35e6eac3672bdc5c903f5cd99b30ad7a112c8152

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

steveluscher commented 3 weeks ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @steveluscher and the rest of your teammates on Graphite Graphite

mcintyre94 commented 3 weeks ago

It looks like the CI issue is legit, I get the same locally:

$ pnpm test:treeshakability:node

> @solana/errors@2.0.0-preview.3 test:treeshakability:node /home/sol/src/solana-web3.js/packages/errors
> agadoo dist/index.node.mjs

process.env.NODE_ENV === 'development' || import.meta.env.MODE === 'development';

Failed to tree-shake dist/index.node.mjs
steveluscher commented 3 weeks ago

Failed to tree-shake dist/index.node.mjs

Related to our interests: https://github.com/terser/terser/issues/1536

steveluscher commented 2 weeks ago

Closing this in favour of the smallest possible improvement we can make before going further: #2840.