Skip to content
This repository was archived by the owner on Aug 21, 2026. It is now read-only.
This repository was archived by the owner on Aug 21, 2026. It is now read-only.

Name #83

Closed
Closed

Description

@annevk

I'm somewhat hesitant to raise this bikeshed, but #82 (comment) made me think it. Should it be named appHistory?

Perhaps appSession would reflect things a tiny bit better? (I guess the one potential confusing thing here is that it's not 1:1 with sessionStorage, but appHistory is not 1:1 with history either.)

Activity

  1. domenic commented on Mar 19, 2021

    @domenic
    Collaborator

    Yeah, app history is more of a "least bad" name. The predecessor proposal was called "navigator" and lived on window.history.navigator, but I thought that was pretty confusing.

    "Session" seems like it might be the right spec-level concept to encompass "history and navigation", but it feels like the wrong web-dev-facing concept. When web devs talk about "sessions" it's mostly about user sessions, being logged in and out, etc., and not about history and navigation.

    Between "history" and "navigation" I think most of the complexity (for web developers) comes in with history, so that's why I went with window.appHistory instead of window.appNavigator or window.historyAndNavigation or something. That does lead to confusion like #82 (comment) but that seems like an OK-ish price...

    I'm happy to leave this open in case we come up with something brilliant. But my instincts are to stick with the inertia behind the current name, despite it not being perfect.

  2. added
    surface apiMinor tweaks or additions to the API surface to make it nicer (without changing the model)
    on Mar 19, 2021
  3. kidwm commented on Mar 21, 2021

    @kidwm

    How about window.navigator.navigation or window.navigator.history?

  4. kenchris commented on Mar 24, 2021

    @kenchris

    navigationHistory? navigationStack?

  5. tbondwilkinson commented on Mar 24, 2021

    @tbondwilkinson
    Contributor
    • appSession: For me this is confusing, because it doesn't necessarily indicate it has to do with history or navigation or the URL, which are things that I think of when I think of this API.
    • window.navigator.navigation and window.navigator.history: I'm shaking my fist at the folks who got to navigator, because I think it has more to do with the User Agent than "navigation." But given that the existing window.navigator has little to do with navigation or history, I don't think it's right to hang this new API off that object.
    • navigationHistory: I think this is largely equivalent to appHistory, but not better.
    • navigationStack: People have quibbled about whether history is in fact a 'stack' (technically from a data structure POV, it's not), so I think I'd like to get away from this nomenclature.
  6. kenchris commented on Mar 24, 2021

    @kenchris

    in appHistory, I am not sure what value "app" provides :-) at least "navigation history" provides a bit more clarification

  7. tbondwilkinson commented on Mar 24, 2021

    @tbondwilkinson
    Contributor

    Well, I suppose the "app" part is signifying to importance of same-origin history for this API - most of the new functionality has to do with enabling an "app" to inspect and modify its own history. So I'm not totally opposed to "app" being in the name.

    But I do agree that if I had to pick one word to represent all this, it would be "navigation". Navigation to me represents the action that the API enables, "history" represents the state left behind by that action.

    Not to throw another wrench, but other good words: "page", "view," "site". For instance, pageHistory (or pageNavigation), as opposed to appHistory, if no one likes the word app.

  8. Yay295 commented on Mar 24, 2021

    @Yay295

    In that case it would be siteHistory, not pageHistory. A website can be composed of many webpages.

  9. uasan commented on Mar 26, 2021

    @uasan

    Better - window.navigator.router

  10. domenic commented on May 12, 2021

    @domenic
    Collaborator

    @jakearchibald, @annevk, @smaug---- and I discussed this today. @smaug---- especially was of the opinion that this API is largely about navigation, and less so history. We tentatively thought that maybe just the name window.navigation (and spec title "Navigation API") would work:

    await navigation.navigate(url);
    
    const entries = navigation.entries();
    const currentEntry = navigation.current; // or currentEntry? or now?
    
    await navigation.transition.finished;
    
    await navigation.back();
    await navigation.goTo(key);

    This seems pretty OK to me. What do other folks think?

  11. frehner commented on May 12, 2021

    @frehner

    I like it.

    Are there any chances of library/global conflicts? I tried doing some searching to see if anything puts navigation onto global/window but at first glance couldn't find anything.

  12. domenic commented on May 12, 2021

    @domenic
    Collaborator

    It's always hard to say, but generally on the web platform we haven't had many such conflicts. (The only one I'm aware of is when TC39 tried to introduce global, resulting in the current globalThis name.) We could also minimize the risk by making the global [Replaceable].

  13. bathos commented on May 12, 2021

    @bathos

    Navigation is not a bad name, though it seem a lot more natural to call the-stateful-thing-you-call-navigate-on navigator, which — oh, wait, it seems that’s taken? perhaps this is not such a good name. :)

    Can’t say I would look forward much to mistyping and misreading this all the time, and I’m a native speaker, so it may be more troublesome for others. AppHistory seemed fine to me — FWIW, the moment I saw that name, I knew what it was gonna be about, though I couldn’t nec explain why?

    Of course this won’t make or break it but I do hope folks land on anything-but-navigation (because of navigator I mean — it seems fine conceptually).

    (ActualNavigator?)

  14. Yay295 commented on May 12, 2021

    @Yay295

    Unfortunately, I agree that "Navigation" may be too similar to the existing Navigator object (which ironically doesn't seem to have much to do with navigating). Perhaps "ApplicationState"?

  15. uasan commented on May 12, 2021

    @uasan

    Maybe - window.navigator.app?

  16. 59 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feedback wantedsurface apiMinor tweaks or additions to the API surface to make it nicer (without changing the model)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions