Skip to content

Conversation

@karlseguin
Copy link
Collaborator

If a webapi has a []const u8 parameter, then the page.call_arena is used. This is our favorite arena to use, but if the string value has a lifetime beyond the call, it then needs to be duped again (using page.arena).

When a webapi has a Env.String parameter, the page.arena will be used directly to get the value from V8, removing the need for an intermediary dupe in the call_arena.

This allows HTMLCollections to be streamlined. They no longer need to dupe the filter (tag name, class name, ...), which means they can no longer fail. It also means that we no longer need to needlessly dupe the string literals.

If a webapi has a []const u8 parameter, then the page.call_arena is used. This
is our favorite arena to use, but if the string value has a lifetime beyond the
call, it then needs to be duped again (using page.arena).

When a webapi has a Env.String parameter, the page.arena will be used directly
to get the value from V8, removing the need for an intermediary dupe in the
call_arena.

This allows HTMLCollections to be streamlined. They no longer need to dupe the
filter (tag name, class name, ...), which means they can no longer fail. It also
means that we no longer need to needlessly dupe the string literals.
@karlseguin karlseguin merged commit 36ce227 into main Sep 18, 2025
10 checks passed
@karlseguin karlseguin deleted the env_string branch September 18, 2025 11:06
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants