Skip to content

feat: add context/libc Stage 4 helper APIs#737

Merged
buke merged 3 commits intomainfrom
feature/api-4
Apr 13, 2026
Merged

feat: add context/libc Stage 4 helper APIs#737
buke merged 3 commits intomainfrom
feature/api-4

Conversation

@buke
Copy link
Copy Markdown
Owner

@buke buke commented Apr 13, 2026

  • add DumpError, LoopOnce, PollIO, NewDate, NewSymbol, NewGlobalSymbol
  • add SetImportMeta and BootstrapBJSON context helpers
  • add Value.IsDate
  • add comprehensive Stage 4 tests with fail-closed coverage

- add DumpError, LoopOnce, PollIO, NewDate, NewSymbol, NewGlobalSymbol\n- add SetImportMeta and BootstrapBJSON context helpers\n- add Value.IsDate\n- add comprehensive Stage 4 tests with fail-closed coverage
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several new methods to the Context and Value types to support JavaScript Dates, Symbols, and module metadata. It also adds event loop control helpers like LoopOnce and PollIO, along with a BootstrapBJSON utility. The review feedback recommends refactoring BootstrapBJSON from a standalone function into a method of the Context type to ensure consistency with the library's existing API patterns.

Comment thread context.go Outdated
Comment thread context_test.go Outdated
Comment thread context_test.go Outdated
Comment thread context_test.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (00c83bc) to head (bba597b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #737   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         3659      3704   +45     
=========================================
+ Hits          3659      3704   +45     
Files with missing lines Coverage Δ
context.go 100.00% <100.00%> (ø)
runtime.go 100.00% <100.00%> (ø)
value.go 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00c83bc...bba597b. Read the comment docs.

🚀 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.

@buke
Copy link
Copy Markdown
Owner Author

buke commented Apr 13, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several new methods to the Context and Value types to support JavaScript Date, Symbols, and module metadata. It also refactors the BootstrapStdOS and BootstrapTimers functions into methods on the Context type and adds event loop helpers like LoopOnce and PollIO. Feedback was provided to simplify redundant nil checks in the SetImportMeta and BootstrapBJSON methods where internal helper functions already perform these validations.

Comment thread context.go Outdated
Comment thread context.go Outdated
@buke
Copy link
Copy Markdown
Owner Author

buke commented Apr 13, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several new helper methods to the Context and Value types, including support for JavaScript Dates, Symbols, and BJSON bootstrapping. It also adds event loop control methods like LoopOnce and PollIO, along with comprehensive tests for these new features. Feedback was provided regarding the refactoring of BootstrapStdOS and BootstrapTimers from standalone functions to methods on *Context, which introduces breaking changes to the public API. It is recommended to maintain backward compatibility by providing deprecated standalone wrappers for these functions.

Comment thread runtime.go
Comment thread runtime.go
@buke buke merged commit 8ddefa6 into main Apr 13, 2026
8 checks passed
@buke buke deleted the feature/api-4 branch April 13, 2026 02:46
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.

1 participant