Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ scratch

*.bun-build

scripts/lldb-inline

test/integration/bun-types/fixture/bun.lock
.claude/scheduled_tasks.lock
.claude/worktrees
Expand Down
11 changes: 3 additions & 8 deletions docs/project/bindgen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ An example of `stringEnum` from `fmt_jsc.bind.ts` / `bun:internal-for-testing`:
export const Formatter = t.stringEnum("highlight-javascript", "highlight-javascript-redacted", "escape-powershell");

export const fmtString = fn({
implNamespace: "js_bindings",
args: {
global: t.globalObject,
code: t.UTF8String,
Expand All @@ -162,7 +161,9 @@ export const fmtString = fn({
On the Rust side, the enum is mirrored as a `#[repr(u8)]` enum. Bindgen
**sorts `t.stringEnum` values alphabetically** before emitting the C++
`enum class`, so discriminants must match the generated header's order, not
the `.bind.ts` declaration order:
the `.bind.ts` declaration order. (The `js_bindings` submodule below is just
how `fmt_jsc.rs` organizes its binding impls; the Rust module layout is up to
the implementing file.)

```rust
pub mod js_bindings {
Expand All @@ -186,12 +187,6 @@ pub mod js_bindings {

WebIDL strongly encourages kebab-case for enumeration values, to be consistent with existing Web APIs.

Comment thread
robobun marked this conversation as resolved.
## `implNamespace`

Setting `implNamespace: "foo"` on a `fn({...})` routes the generated call to
`crate::<basename>::foo::fn_name` instead of `crate::<basename>::fn_name`. Use
this to group related binding implementations under a submodule.

## `t.oneOf`

A `oneOf` is a union of two or more types. It is represented as a Rust
Expand Down
67 changes: 0 additions & 67 deletions scripts/debug-coredump.ts

This file was deleted.

100 changes: 0 additions & 100 deletions scripts/gamble.ts

This file was deleted.

176 changes: 0 additions & 176 deletions scripts/github-metrics.ts

This file was deleted.

Loading