Skip to content

Feedback #1

@christianalfoni

Description

@christianalfoni

Hi @hallgren !

Just wanted to first tell you that this is a very creative and cool idea. It is very interesting how you give all the responsibility to the server and still have optimized DOM handling. The feedback here will be more questions about challenges that I think might occur, but that is not to take the motivation out of the project. It is very cool :-) And in advance you have to excuse me if I have misunderstood anything.

  1. All frameworks, tools an solutions have different areas of use, but there is one very common concept on the web and that is: "optimistic updates". I do not quite see how you would be able to pre-update the browser to give that "instant feel" which is kind of a big deal these days
  2. When updating a list I believe that the backend will always send the complete HTML of the list whenever an element is added/removed/changed? That will be quite a bit of traffic over the wire if you have like a table
  3. One good thing about the modern web is that the backend becomes stateless. The backend does not have to know that f.ex. "user1" is currently at this page. I do not have any examples, but I fear that you would have to bring back a lot of state to the backend
  4. When f.ex. clicking the "select all" you should both change the HTML of that checkbox and of course the list, to ensure the state of the application. What I try to point out is that a click might require rerender in different parts of the application, causing it to probably need a complete rerender on most changes
  5. To do a diff you seem to grab the html from the existing DOM. It would be better to keep a reference to the previously received HTML from the server and diff it with that instead?

This is what I got so far :-) I think this kind of solution definitely has its use, though as a general framework there is an issue with perceived performance, meaning that the GUI does no instantly update when you click etc. You are also not able to do all the good stuff with JavaScript in the browser to build a really nice UI it seems.

What could be even cooler is hooking this up to WebSockets and use a text diff algorithm (like GitHub code diff), creating this flow:

  1. I request the initial page and keep a reference to the HTML as a string
  2. I do some kind of form request
  3. The server has a reference to my previous HTML string and creates a new HTML string based on my request
  4. The server does a string diff and produces a small object that points to what text in the string has actually changed (index from, index to, String)
  5. The message is pushed on the websocket over to the client
  6. The client receives the message, changes its cached HTML string using the diff-object and then does what you basically do now in your library

Now there is a lot less going over the wire, also due to limited overhead on websockets, and you do not have to set up HTTP requests all the time. More importantly you could actually when posting the form first pass a message from the server producing a loading indication and disabling the input. Then a message would arrive later opening up the input and adding the todo to the list.

Sorry if this is just annoying suggestions, hehe, but I think you need to speed up the perceived performance of the tool or it will be hard to adopt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions