Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise Animation example #77

Open
balupton opened this issue Jan 19, 2021 · 11 comments
Open

Revise Animation example #77

balupton opened this issue Jan 19, 2021 · 11 comments

Comments

@balupton
Copy link

balupton commented Jan 19, 2021

Reading the paper I had two questions about the animation example:

https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-braid-http-02#section-5.1

https://github.com/braid-work/braid-spec/blob/bf179d8c84ea48b5cb1ea4faf23c6ea9bfc28416/draft-toomim-httpbis-braid-http-03.txt#L580-L608

  1. That the paper on IETF should use PNG or JPEG as GIF has native animation built into it, so it conflates the purpose of the feature. I can see however the github version uses PNG, so good work there.

  2. How come the example responds with only subsequent data (patches to ranges), and not initial data (the whole data for the latest server-side version). Shouldn't it behave like https://github.com/braid-work/braid-spec/blob/bf179d8c84ea48b5cb1ea4faf23c6ea9bfc28416/draft-toomim-httpbis-braid-http-03.txt#L406-L472 which does respond with the initial data, and the subsequent data. As doing <img src="/animated-braid.png"/> doesn't seem valuable if it is fetching changes without any initial data to base those changes on. Otherwise, the example should have a Version header in the request to indicate why initial data is not being returned.

@balupton balupton changed the title Animation Subscribe Response: Shouldn't it include that starting point? Animation Subscribe Response: Shouldn't it include the initial data? Jan 19, 2021
@canadaduane
Copy link
Member

Good point! I agree the animation example should first respond with a complete version before continuing with streaming patched versions.

@toomim toomim added this to the Braid-HTTP 03 milestone Feb 13, 2021
@josephg
Copy link
Contributor

josephg commented Feb 16, 2021

Yes, and in general this should be something we talk about in the specification.

Different implementations may want to:

  • Send the complete set of changes since the start of time (eg automerge)
  • Send a current snapshot of the data with no history
  • (This is already specified) Send information from some point in time

The "send current snapshot" case shows up a lot when you aren't using a merge type. (Is there a standard way to specify that a patch is just a copy of the data, and not a patch?)

@toomim
Copy link
Member

toomim commented Feb 22, 2021

Notes from https://braid.org/meeting-3:

  • Yes, let's include the initial version first in this example
  • There's also ambiguity in the different ways to respond with initial data:
    • With a snapshot
    • With sequence of versions
    • With just the versions since the last connection

@canadaduane
Copy link
Member

Comment from Phoenix on Discord:

the streaming png example feels a bit weak since last i checked every web browser already supports a way of doing that, and has done so for around 20-30 years. multipart/x-mixed-replace is how a bunch of old JPEG webcams stream out their “video”

@toomim
Copy link
Member

toomim commented Feb 22, 2021

Another use-case could be to implement progressive loading of images (like how images used to load over dialup), that don't natively support it.

@toomim
Copy link
Member

toomim commented Feb 22, 2021

Another use-case is animating HTML from the server, rather than the client. So you could have a dynamic web app without Javascript.

@toomim
Copy link
Member

toomim commented Apr 26, 2021

New ideas for examples:

  • Mutate a PNG via snapshots instead of patches
  • Mutate a text marquee
  • Mutate an HTML file over time
  • Subscribe to a CPU temperature or bitcoin price
  • Document editing:
    • Editing and publishing this spec itself through the IETF
    • Subscribing to a git branch and seeing each commit as a new version
  • Chat
  • RSS feed

Consensus:

  • We want to publish draft 03 before writing new examples.
  • We are split on whether to remove this example or keep it for draft 03, but nobody really seems to care a lot. We remember Ben(?) once said he thought the basic idea of this example was good, but wanted it improved.

@balupton
Copy link
Author

balupton commented Apr 28, 2021

A web component that takes a url as an attribute or content, and then braid subscribes to the url, embedding the (svg/txt/html) result into its element would probably work today, allowing for a demo repo to be cited. This would offer some really interesting nesting options for dynamically updating websites.

There could be a json or parser variant of it too, where you tell it which json var in the response to embed, or give it a parser function.

@balupton
Copy link
Author

The closest example I can think of to the image while avoiding which image format complexity and logistics, would be the same example but for css stylesheet link hrefs

@toomim toomim changed the title Animation Subscribe Response: Shouldn't it include the initial data? Revise Animation example Aug 21, 2023
@toomim
Copy link
Member

toomim commented Aug 21, 2023

I've updated the example with an initial snapshot in 7589df1.

@toomim toomim removed this from the Braid-HTTP 03 milestone Aug 21, 2023
@toomim
Copy link
Member

toomim commented Aug 21, 2023

More discussion here: #94 (comment)

  • Its almost impossible to figure out a binary patch to a PNG because the content is internally gzipped iirc. (if you do, you'll probably end up with a patch that just replaces the entire contents of the file)
  • Its unclear whether this overwrites the specified bytes or truncates? Like, what happens if the new content is smaller than the old content? (And I might be revealing my ignorance of the content-range: bytes= header by asking this, but how does this format indicate the size of the file should be truncated?

The example might be better either:

  • Using a bitmap instead of a PNG - because then the byte ranges at least make a bit of sense, and the file size will stay constant
  • Or don't use patches in this example, and simply re-send the content with each change
    • And we can write a second example which uses patches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants