Skip to content

Conversation

@mookums
Copy link
Contributor

@mookums mookums commented Dec 8, 2025

This backports Navigation mostly and all of the related changes that I made across various PRs.

This backports a number of PRs (including various with zigdom_backport labels)

This also brings over the URL stitch (now resolve) fix and the regression test that was solved by #1113.

@mookums mookums force-pushed the zigdom-navigation branch 3 times, most recently from 09ae1c7 to b3e2c1b Compare December 8, 2025 13:31
}

pub fn onRemovePage(self: *Navigation) void {
self._proto = undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wasn't expecting that...Is there a reason for having these onRemovePage and onNewPage at all? Can the Navigation instance not be created once (in the Session)...nothing here references the *Page or anything tied to the page lifetime (e.g. window) as far as I can see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Navigation has an EventTarget so with libdom, we had to create a new EventTarget whenever a new Page was created (or we'd get a segfault). With zigdom (from my understanding), since we create a new Factory whenever we get a new page, we need to create a new EventTarget for it whenever we create a new page.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It can be created outside the factory, or the factory methods could take an opts that allows an explicit allocator to be passed in (though I don't love that approach, since it's an if check on every create).

@karlseguin
Copy link
Collaborator

This looks good. Up to you if you think it's worth moving the Navigation instance to the session-owned arena so that we don't to reset between page navigation events - but I do think it would be cleaner. I'm trying to think if there are any implications to doing it (since nothing else does)...can't think of any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants