Skip to content

Add Process object so as to allow process.env#4597

Merged
jedel1043 merged 6 commits intoboa-dev:mainfrom
randomboi404:add-process
Feb 4, 2026
Merged

Add Process object so as to allow process.env#4597
jedel1043 merged 6 commits intoboa-dev:mainfrom
randomboi404:add-process

Conversation

@randomboi404
Copy link
Contributor

This Pull Request fixes/closes #4492.

It changes the following:

  1. Ability to access ENV variables passed into boa:

Example code

const api_key = process.env.API_KEY
API_KEY=xxxxx boa -m app.js
  1. Allows future addition of other process object methods of node js.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,598 52,598 0
Passed 49,420 49,421 +1
Ignored 2,134 2,134 0
Failed 1,044 1,043 -1
Panics 0 0 0
Conformance 93.96% 93.96% +0.00%
Fixed tests (1):
test/staging/Temporal/v8/instant-to-json.js (previously Failed)

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.49%. Comparing base (6ddc2b4) to head (77c459c).
⚠️ Report is 644 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4597      +/-   ##
==========================================
+ Coverage   47.24%   56.49%   +9.25%     
==========================================
  Files         476      547      +71     
  Lines       46892    60060   +13168     
==========================================
+ Hits        22154    33933   +11779     
- Misses      24738    26127    +1389     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@randomboi404 randomboi404 requested a review from hansl February 2, 2026 17:57
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

2 non-blocking nits for now. If you want to merge without addressing that's fine we can do it in a follow up PR.

@randomboi404
Copy link
Contributor Author

That makes sense.

Regarding the new TestAction::harness() since console tests haven't been migrated yet, I think it's better to let process be consistent with it and do a follow up once test harness is adopted more broadly.

Regarding it being enabled by default, I think we should let it be enabled for now and if in case we strictly don't want it enabled as it's a node api, we'll do a follow up to make it not being enabled by default.

@nekevss
Copy link
Member

nekevss commented Feb 3, 2026

I'd second having the Process extension not on by default.

I think this is a super cool extension to have as an option, but since process is not based on a web standard, we should have it be an opt in extension and not opt out.

@randomboi404
Copy link
Contributor Author

Done! I've made it optional.

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

Thanks! 😄

The feature flag approach looks good to me!

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! I have a couple of questions about the implementation

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@jedel1043 jedel1043 added this pull request to the merge queue Feb 4, 2026
Merged via the queue into boa-dev:main with commit 0ab290b Feb 4, 2026
18 checks passed
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.

Feature: process.env

4 participants