New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: remove secret hidden internals and introduce new way to call native code from js #8166
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exciting We can keep DO_NOT_USE_OR_YOU_WILL_BE_FIRED_mimalloc_dump imo |
v fancy |
paperdave
force-pushed
the
dave/hide-internals
branch
from
January 15, 2024 21:31
deb72c4
to
ea4d610
Compare
jdalton
reviewed
Jan 18, 2024
jdalton
reviewed
Jan 18, 2024
jdalton
reviewed
Jan 18, 2024
jdalton
reviewed
Jan 18, 2024
jdalton
reviewed
Jan 18, 2024
jdalton
reviewed
Jan 18, 2024
jdalton
reviewed
Jan 18, 2024
jdalton
reviewed
Jan 18, 2024
❌ @paperdave 4 files with test failures on bun-darwin-x64: |
❌🪟 @paperdave, there are 9 test regressions on Windows x86_64
|
merge conflicts |
this PR is marked breaking as it removes some hidden apis. we will merge this before 1.1 but before the last 1.0.x |
❌ @paperdave 3 files with test failures on linux-x64-baseline: |
test/js/bun/wasm/wasi.test.js test i think is real |
paperdave
added a commit
that referenced
this pull request
Mar 14, 2024
❌ @paperdave 3 files with test failures on linux-x64: |
Jarred-Sumner
added a commit
that referenced
this pull request
Mar 23, 2024
* run-eval.test.ts * transpiler-cache.test.ts * node net * some open things * a * a * yikes * incredible * run it back * a * this code is what i like to call, incorrect * ok its all worng * remove an assertion that is wrong again * update test things and rebase * performance test * mark filesink with mkfifo as todo. see #8166 * hehe * not done * awa * fs test pass --------- Co-authored-by: Jarred Sumner <[email protected]> Co-authored-by: Jarred Sumner <[email protected]>
zackradisic
pushed a commit
that referenced
this pull request
Mar 25, 2024
* run-eval.test.ts * transpiler-cache.test.ts * node net * some open things * a * a * yikes * incredible * run it back * a * this code is what i like to call, incorrect * ok its all worng * remove an assertion that is wrong again * update test things and rebase * performance test * mark filesink with mkfifo as todo. see #8166 * hehe * not done * awa * fs test pass --------- Co-authored-by: Jarred Sumner <[email protected]> Co-authored-by: Jarred Sumner <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
ooooh magic javascript preprocessor shenanigans.
This PR removes
$lazy
, and replaces it with two alternatives:$cpp
and$zig
. These both take a filename and a function name, and they will call the function defined with no arguments.@lazy
Examples:
With this done, I will also be removing the following definitions
globalThis[Symbol.for("Bun.lazy")]
Bun.fs
Bun._Path
Bun._Os()
The API
Bun.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_mimalloc_dump
has been renamed toBun.unsafe.dumpMimalloc()
. While left undocumented, this will hopefully reduce the number of people fired from bun.If internals are required for unit testing, two mechanisms will be provided. In order for either to work, the environment variables
BUN_GARBAGE_COLLECTOR_LEVEL
andBUN_FEATURE_FLAG_INTERNAL_FOR_TESTING
must be set, or you must be running in a debug build.From there, runtime versions of$zig
and$cpp
will exist on the global object. These work the same as the bundled ones, but only map to symbols that have a used binding in thesrc/js
. Perhaps we can add a way to add additional bindings that aren't used insrc/js
but able to be exposed for testing, such as the syntax highlighter.From there, you can use
bun:internal-for-testing
, which currently contains three declarations:Extra Tasks