Skip to content

Conversation

@karlseguin
Copy link
Collaborator

Missing the AbortSignal.any() API.

This API is superficially simple, but required a number of deeper changes.

1 - The poor support for namespace/static functions introduced in #749 has been improved. Static functions, like AbortSignal.timeout, are now correctly supported.

I still think the console behavior is weird, but it's now implemented as a receiver-less method (which is now supported for all methods). Possibly still not correct, but at least it's simpler and and better aligned with how we structure our code.

2 - Like the Window before, this introduces an EventTarget which is not a libdom node, an AbortSignal. Unlike Window, this isn't a singleton and can't be easily detected. I corrupted the internal event type to serve as a discriminator to the event target. If this doesn't work for future cases, we'll have to come up with a more general solution, like attaching some internal_type_id to the event_target.

3 - Ran into a variation of the empty-struct identity map issue (see: #812). This time I tried to solve this properly, but it turns out that making the identity map type-aware isn't without its challenges and drawback. Instead, I solved this specific by forcing unique addresses between conflicted objects. As punishment for my failure, I documented the issue: https://github.com/lightpanda-io/project/discussions/165

4 - I believe this is the first case where we've had to raise an arbitrary exception from Zig code (with a user-defined message). My solution exposes the underlying JS context (aka scope), which I don't like, but I don't expect this to be a common requirement, so if we need to change things around, it shouldn't be a problem.

Copy link
Contributor

@sjorsdonkers sjorsdonkers left a comment

Choose a reason for hiding this comment

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

Works for airbnb

@karlseguin karlseguin merged commit 1c6f4a7 into main Jun 28, 2025
10 checks passed
@karlseguin karlseguin deleted the abort_controller branch June 28, 2025 01:00
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 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.

4 participants