Skip to content

Optimizing responses on tables #91

@thinkwelltwd

Description

@thinkwelltwd

In the Server Protocol docs, under Optimizing responses, it says that:

Server-side code is free to optimize its response by only returning HTML that matches the selector. For example, you might prefer to not render an expensive sidebar if the sidebar is not targeted.

I have large tables where I need to swap out table rows; each tr tag has an ID. The server response includes only the tr tag, so the entire response contents match the ID selector. However, unpoly can't find the ID in the response and updates the body instead of the table row.

If the server returns the entire table, then unpoly correctly updates the table. I also tried having the server return the tbody tag of the table, but unpoly couldn't extract the table row.

Then also tried assigning the ID to the tbody tag, and same result as tr - the content loads in the body tag.

The only way that I've encountered to get a tbody or tr tag swapped is to send the entire table from the server. That's still more efficient than the entire page, but it seems like a bug to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions