Veritula – Meta
Showing only ideas leading to #2646 and its comments.
See full discussion·See most recent related ideasLog in or sign up to participate in this discussion.
With an account, you can revise, criticize, and comment on ideas.Discussions are getting slower to render as they grow. It’s a rendering issue (not a db issue).
I could use ActionController::Live to stream ideas to the page one by one. Instant page load.
Changing the view logic so that the controller can stream each deeply nested idea separately sounds non-trivial. It’s not clear to me how to do that currently. It may be possible someday if I adjust Hiccdown to allow the use of enumerators or something like that.
Including that module significantly slows down hot reloads on all pages. I need a tight feedback loop in dev.
Replacing a raw SQL query in Idea.tree with a standard ActiveRecord query solves this issue.
Fast UX is more important than fast developer experience.
A slow developer experience will slow down all further development, including bug fixes and feature rollouts, which hurts UX as well.
After resetting my working directory and beginning to implement streams a second time, I can no longer reproduce this issue, despite reasonable attempts to reproduce it.
I’ve since been able to reproduce the issue after all. Running a raw SQL query in Idea.tree in combination with the inclusion of the Live module seems to mess with Rails’s reloader.
I could cache ideas so deeply nested trees can be rendered at once.
Cache invalidation for user-based caching sounds like a nightmare.
A single new idea somewhere down the tree could invalidate the cache and slow things down again.
I could lazy load ideas: only load the parts of the page that would be visible on the current viewport. Then load more parts as the user scrolls.
Complex, requires non-trivial scroll listeners correlated to deeply nested ideas.
On initial page load, I could just load the first ten or so top-level ideas and their immediate children, just to reduce wait times and populate the page. Then load the rest asynchronously.
I could have a separate route at /ideas/:id/isolated which renders only the idea without any parents or children. And then a discussion could render a bunch of deeply nested turbo frames loading that route.
For large discussions, wouldn’t that flood the server with requests?
The top level ideas could be rendered as turbo frames of ideas#show.
Too many requests when there are enough top-level ideas.
I just tried this. Seemed promising at first but sometimes ideas load out of order. Looks horrible.
I could render the first ~10 top-level ideas immediately and only render the rest as turbo frames off screen. By the time the user scrolls down, they should all be loaded.