home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 719809259

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/1072#issuecomment-719809259 https://api.github.com/repos/simonw/datasette/issues/1072 719809259 MDEyOklzc3VlQ29tbWVudDcxOTgwOTI1OQ== 9599 2020-10-30T21:31:10Z 2020-10-30T21:31:10Z OWNER

How can we tell what template Jinja will need to render?

One approach that could work:

  1. Set up a dummy template loader which records the name of the template that was requested
  2. Load the template
  3. Now we know the list of templates that were requested. Async load those
  4. The dummy template loader can now return the ones we have loaded. Load the template again.
  5. Did it request any more templates? If so, load those, and repeat.
  6. Keep on with this loop until a template load (which might even have to be a render) fails to request any templates that we have not yet loaded.
  7. Render the template.

This is GROSS. It feels like a huge waste of CPU, and it could lead to very weird behaviour if any template variables have side effects.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
733499930  
Powered by Datasette · Queries took 0.995ms · About: github-to-sqlite