Skip to content

fix(streams): warn in browser when process is undefined (#574) - #637

Open
miriamisa022-cyber wants to merge 1 commit into
conduit-protocol:mainfrom
miriamisa022-cyber:fix/574-warn-v1-deprecated-browser
Open

fix(streams): warn in browser when process is undefined (#574)#637
miriamisa022-cyber wants to merge 1 commit into
conduit-protocol:mainfrom
miriamisa022-cyber:fix/574-warn-v1-deprecated-browser

Conversation

@miriamisa022-cyber

Copy link
Copy Markdown

warnV1Deprecated used a triple typeof guard that returned false (isDev = false) in browser bundles where process is not defined, silently swallowing all v1 deprecation warnings.

Fix: use optional chaining — process?.env?.NODE_ENV !== 'production' — so the absence of process evaluates to undefined !== 'production' (true) and the warning fires unless the environment is provably production.

Adds a regression test that verifies the optional-chaining expression evaluates to true when process is undefined, matching the semantics of a plain browser bundle.

What does this PR do?

Type of change

  • Bug fix
  • New feature / method
  • Refactor
  • Test coverage
  • Documentation
  • Dependency update

Related issue

Closes #

Changes

File Change

Checklist

  • npm run typecheck — no errors
  • npm run lint — no warnings
  • npm test — all tests pass
  • npm run build — bundle compiles cleanly
  • No any types introduced
  • New public methods documented in docs/api.md
  • All on-chain amounts kept as bigint — no Number() conversion in arithmetic
  • New methods mock-tested in src/tests/
  • CHANGELOG.md updated under [Unreleased]
  • src/index.ts updated if new exports added

Breaking changes?

  • No
  • Yes — describe below and add BREAKING CHANGE: footer to relevant commit

Notes for reviewers

closes #574

…ocol#574)

warnV1Deprecated used a triple typeof guard that returned false
(isDev = false) in browser bundles where process is not defined,
silently swallowing all v1 deprecation warnings.

Fix: use optional chaining — process?.env?.NODE_ENV !== 'production'
— so the absence of process evaluates to undefined !== 'production'
(true) and the warning fires unless the environment is provably
production.

Adds a regression test that verifies the optional-chaining expression
evaluates to true when process is undefined, matching the semantics
of a plain browser bundle.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@miriamisa022-cyber Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant