Giter Site home page Giter Site logo

bfcache-guide's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

qpc-github

bfcache-guide's Issues

Missing guidance for handling steps that are run "in parallel"

Copied from @annevk's #1 (review) and #1 (comment) :

I'm missing some guidance around "in parallel".
At least abstractly it seems that whenever you do "in parallel" followed by "queue a global task" there's an opportunity for a document to become inactive.
However, HTML will block task processing in that case until the document is active again so you can't really know.
I'm also vaguely reminded of an issue around promises here.
E.g., if we consider https://storage.spec.whatwg.org/#dom-storagemanager-persisted. Should that just work as-is or will any changes be needed?

Maybe the better example would be the persist() method in the same document. It's rather unclear whether or not the state ends up changing or the user gets prompted (or is still prompted when going back if they had not answered yet) depending on when the fully active transition happens. I mean, there is a certainly a way to read it that answers these questions, kinda, but I doubt it's accurate.

So I'm not sure I fully understand the problem here, but I think the main concern is that between the steps listed under "in parallel" blocks, the document could've navigated away and put into BFCache and navigated to again and restored from bfcache, so each step can be separated by multiple navigations and a long gap in time, potentially with some changes to the state of the world happening during that time period.

I think for the latter concern (changes happening during that time period), it's not unique to BFCache? As far as I understand it, steps that are run in parallel can already have long time gaps between them, potentially with some changes that happen between them (either from within that document or from another document). If so, then the steps should already be resilient to that or can't be affected by changes that happen in between the steps? (CMIIW)

For the first concern (each step can be separated by multiple navigations), it is touched a little bit by the "Be aware that per-document state/data might persist after navigation" section, but I guess that is more about states that are saved in the document instead of states within parallel steps. We should probably expand that section to be "Be aware that state/data might persist after navigation" and mention "in parallel" explicitly. Does that sound OK?

Also, for what happens with the user prompt in https://storage.spec.whatwg.org/#dom-storagemanager-persist and https://w3c.github.io/permissions/#dfn-request-permission-to-use, I think that's not really a problem with "in parallel" but more of a general problem with prompts and other UI-triggering things right? If the UI doesn't block navigation/running other tasks, I guess they should be able to add a "fully active" state change listener and decide to hide/re-show the UI or just cancel/fail the request? Maybe we can call out these cases specifically in the "Listen for changes to fully active status" section?

(Thanks again for calling this out @annevk, and sorry if I misunderstand the concern here, I am quite unfamiliar with this part of the spec)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.