issue_comments
8,358 rows where author_association = "OWNER" sorted by updated_at descending
This data as json, CSV (advanced)
user 1
- simonw 3,886
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
753392102 | https://github.com/simonw/datasette/issues/1168#issuecomment-753392102 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM5MjEwMg== | simonw 9599 | 2021-01-01T22:06:33Z | 2021-01-01T22:06:33Z | OWNER | Some SQLite databases include SQL comments in the schema definition which tell you what each column means:
I had an idea to build a plugin that could return these. That would be easy with a "get metadata for this column" plugin hook - in the absence of one a plugin could still run that reads the schemas on startup and uses them to populate a metadata database table somewhere. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753391869 | https://github.com/simonw/datasette/issues/1168#issuecomment-753391869 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM5MTg2OQ== | simonw 9599 | 2021-01-01T22:04:30Z | 2021-01-01T22:04:30Z | OWNER | The sticking point here seems to be the plugin hook. Allowing plugins to over-ride the way the question "give me the metadata for this database/table/column" is answered makes the database-backed metadata mechanisms much more complicated to think about. What if plugins didn't get to over-ride metadata in this way, but could instead update the metadata in a persistent Datasette-managed storage mechanism? Then maybe Datasette could do the following:
If database files were optionally allowed to store metadata about tables that live in another database file this could perhaps solve the plugin needs - since an "edit metadata" plugin would be able to edit records in a separate, dedicated |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753390791 | https://github.com/simonw/datasette/issues/1168#issuecomment-753390791 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM5MDc5MQ== | simonw 9599 | 2021-01-01T22:00:42Z | 2021-01-01T22:00:42Z | OWNER | Here are the requirements I'm currently trying to satisfy:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753390262 | https://github.com/simonw/datasette/issues/1168#issuecomment-753390262 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM5MDI2Mg== | simonw 9599 | 2021-01-01T21:58:11Z | 2021-01-01T21:58:11Z | OWNER | One possibility: plugins could write directly to that in-memory database table. But how would they know to write again should the server restart? Maybe they would write to it once when called by the Also: if I want to support metadata optionally living in a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753389938 | https://github.com/simonw/datasette/issues/1168#issuecomment-753389938 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM4OTkzOA== | simonw 9599 | 2021-01-01T21:54:15Z | 2021-01-01T21:54:15Z | OWNER | So what if the These columns could be populated by Datasette on startup through reading the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753389477 | https://github.com/simonw/datasette/issues/1168#issuecomment-753389477 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM4OTQ3Nw== | simonw 9599 | 2021-01-01T21:49:57Z | 2021-01-01T21:49:57Z | OWNER | What if metadata was stored in a JSON text column in the existing The downside of JSON columns generally is that they're harder to run indexed queries against. For metadata I don't think that matters - even with 10,000 tables each with their own metadata a SQL query asking for e.g. "everything that has Apache 2 as the license" would return in just a few ms. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753388809 | https://github.com/simonw/datasette/issues/1168#issuecomment-753388809 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM4ODgwOQ== | simonw 9599 | 2021-01-01T21:47:51Z | 2021-01-01T21:47:51Z | OWNER | A database that exposes metadata will have the same restriction as the new As such, I'd rather bundle any metadata tables into the existing |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753366024 | https://github.com/simonw/datasette/issues/1168#issuecomment-753366024 | https://api.github.com/repos/simonw/datasette/issues/1168 | MDEyOklzc3VlQ29tbWVudDc1MzM2NjAyNA== | simonw 9599 | 2021-01-01T18:48:34Z | 2021-01-01T18:48:34Z | OWNER | Also: in #188 I proposed bundling metadata in the SQLite database itself alongside the data. This is a great way of ensuring metadata travels with the data when it is downloaded as a SQLite |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for storing metadata in _metadata tables 777333388 | |
753224351 | https://github.com/simonw/datasette/issues/1166#issuecomment-753224351 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzIyNDM1MQ== | simonw 9599 | 2020-12-31T23:23:29Z | 2020-12-31T23:23:29Z | OWNER | I should configure the action to only run if changes have been made within the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
753221646 | https://github.com/simonw/datasette/issues/983#issuecomment-753221646 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MzIyMTY0Ng== | simonw 9599 | 2020-12-31T22:58:47Z | 2020-12-31T22:58:47Z | OWNER | https://github.com/mishoo/UglifyJS/issues/1905#issuecomment-300485490 says:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
753221362 | https://github.com/simonw/datasette/issues/1164#issuecomment-753221362 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1MzIyMTM2Mg== | simonw 9599 | 2020-12-31T22:55:57Z | 2020-12-31T22:55:57Z | OWNER | I had to add this as the first line in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
753220665 | https://github.com/simonw/datasette/issues/1164#issuecomment-753220665 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1MzIyMDY2NQ== | simonw 9599 | 2020-12-31T22:49:36Z | 2020-12-31T22:49:36Z | OWNER | I started with a 7K
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
753220412 | https://github.com/simonw/datasette/issues/1164#issuecomment-753220412 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1MzIyMDQxMg== | simonw 9599 | 2020-12-31T22:47:36Z | 2020-12-31T22:47:36Z | OWNER | I'm trying to minify
It turns out But
Annoyingly it looks like
I really don't like how |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
753219521 | https://github.com/simonw/datasette/issues/983#issuecomment-753219521 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MzIxOTUyMQ== | simonw 9599 | 2020-12-31T22:39:52Z | 2020-12-31T22:39:52Z | OWNER | For inlining the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
753219407 | https://github.com/simonw/datasette/issues/983#issuecomment-753219407 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MzIxOTQwNw== | simonw 9599 | 2020-12-31T22:38:45Z | 2020-12-31T22:39:10Z | OWNER | You'll be able to add JavaScript plugins using a bunch of different mechanisms:
|
{ "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 1, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
753217917 | https://github.com/simonw/datasette/issues/983#issuecomment-753217917 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MzIxNzkxNw== | simonw 9599 | 2020-12-31T22:23:29Z | 2020-12-31T22:23:36Z | OWNER | If I'm going to do that, it would be good if subsequent plugins that register against the Maybe the tiny bootstrap code could define a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
753217714 | https://github.com/simonw/datasette/issues/983#issuecomment-753217714 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MzIxNzcxNA== | simonw 9599 | 2020-12-31T22:21:33Z | 2020-12-31T22:21:33Z | OWNER | Eventually I'd like to provide a whole bunch of other But I don't want to inline those into the page. So... I think the basic plugin system remains inline - maybe from an inlined file called If a plugin wants to take advantage of those APIs, maybe it registers itself using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
753217127 | https://github.com/simonw/datasette/issues/987#issuecomment-753217127 | https://api.github.com/repos/simonw/datasette/issues/987 | MDEyOklzc3VlQ29tbWVudDc1MzIxNzEyNw== | simonw 9599 | 2020-12-31T22:16:46Z | 2020-12-31T22:16:46Z | OWNER | I'm going to use |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Documented HTML hooks for JavaScript plugin authors 712984738 | |
753215761 | https://github.com/simonw/datasette/issues/983#issuecomment-753215761 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MzIxNTc2MQ== | simonw 9599 | 2020-12-31T22:07:31Z | 2020-12-31T22:07:31Z | OWNER | I think I need to keep the mechanism whereby a plugin can return I'll write some example plugins to help me decide if the filtering-out-of-undefined mechanism is needed or not. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
753215545 | https://github.com/simonw/datasette/issues/983#issuecomment-753215545 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MzIxNTU0NQ== | simonw 9599 | 2020-12-31T22:05:41Z | 2020-12-31T22:05:41Z | OWNER | Using object destructuring like that is a great idea. I'm going to play with your version - it's delightfully succinct. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
753214664 | https://github.com/simonw/datasette/issues/1166#issuecomment-753214664 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzIxNDY2NA== | simonw 9599 | 2020-12-31T21:58:04Z | 2020-12-31T21:58:04Z | OWNER | Wrote a TIL about this: https://til.simonwillison.net/github-actions/prettier-github-actions |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
753211535 | https://github.com/simonw/datasette/issues/1166#issuecomment-753211535 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzIxMTUzNQ== | simonw 9599 | 2020-12-31T21:46:04Z | 2020-12-31T21:46:04Z | OWNER | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | ||
753210536 | https://github.com/simonw/datasette/issues/1166#issuecomment-753210536 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzIxMDUzNg== | simonw 9599 | 2020-12-31T21:45:19Z | 2020-12-31T21:45:19Z | OWNER | Oops, committed that bad formatting test to |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
753209192 | https://github.com/simonw/datasette/issues/1166#issuecomment-753209192 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzIwOTE5Mg== | simonw 9599 | 2020-12-31T21:44:22Z | 2020-12-31T21:44:22Z | OWNER | Tests passed in https://github.com/simonw/datasette/runs/1631677726?check_suite_focus=true I'm going to try submitting a pull request with badly formatted JavaScript to see if it gets caught. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
753200580 | https://github.com/simonw/datasette/issues/1166#issuecomment-753200580 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzIwMDU4MA== | simonw 9599 | 2020-12-31T21:38:06Z | 2020-12-31T21:38:06Z | OWNER | I think this should work:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
753197957 | https://github.com/simonw/datasette/issues/1166#issuecomment-753197957 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzE5Nzk1Nw== | simonw 9599 | 2020-12-31T21:36:14Z | 2020-12-31T21:36:14Z | OWNER | Maybe not that action actually - I wanted to use a pre-built action to avoid installing Prettier every time, but that's what it seems to do: https://github.com/creyD/prettier_action/blob/bb361e2979cff283ca7684908deac8f95400e779/entrypoint.sh#L28-L37 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
753195905 | https://github.com/simonw/datasette/issues/1166#issuecomment-753195905 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzE5NTkwNQ== | simonw 9599 | 2020-12-31T21:34:46Z | 2020-12-31T21:34:46Z | OWNER | This action looks good - tag 3.2 is equivalent to this commit hash: https://github.com/creyD/prettier_action/tree/bb361e2979cff283ca7684908deac8f95400e779 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
753193475 | https://github.com/simonw/datasette/issues/1166#issuecomment-753193475 | https://api.github.com/repos/simonw/datasette/issues/1166 | MDEyOklzc3VlQ29tbWVudDc1MzE5MzQ3NQ== | simonw 9599 | 2020-12-31T21:33:00Z | 2020-12-31T21:33:00Z | OWNER | I want a CI check that confirms that files conform to prettier - but only This seems to do the job:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Adopt Prettier for JavaScript code formatting 777140799 | |
752846267 | https://github.com/simonw/datasette/issues/1165#issuecomment-752846267 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1Mjg0NjI2Nw== | simonw 9599 | 2020-12-31T05:10:41Z | 2020-12-31T05:13:14Z | OWNER | https://github.com/PostHog/posthog/tree/master/cypress/integration has some useful examples, linked from this article: https://posthog.com/blog/cypress-end-to-end-tests Also useful: their workflow https://github.com/PostHog/posthog/blob/master/.github/workflows/e2e.yml |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752839433 | https://github.com/simonw/datasette/issues/1165#issuecomment-752839433 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1MjgzOTQzMw== | simonw 9599 | 2020-12-31T04:29:40Z | 2020-12-31T04:29:40Z | OWNER | Important to absorb the slightly bizarre assertion syntax from Chai - docs here https://www.chaijs.com/api/bdd/ |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752828851 | https://github.com/simonw/datasette/issues/1165#issuecomment-752828851 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1MjgyODg1MQ== | simonw 9599 | 2020-12-31T03:19:38Z | 2020-12-31T03:19:38Z | OWNER | I got Cypress working! I added the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752780000 | https://github.com/simonw/datasette/issues/1165#issuecomment-752780000 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1Mjc4MDAwMA== | simonw 9599 | 2020-12-30T22:41:25Z | 2020-12-30T22:41:25Z | OWNER | Jest works with Puppeteer: https://jestjs.io/docs/en/puppeteer |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752779820 | https://github.com/simonw/datasette/issues/1165#issuecomment-752779820 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1Mjc3OTgyMA== | simonw 9599 | 2020-12-30T22:40:28Z | 2020-12-30T22:40:28Z | OWNER | I don't know if Jest on the command-line is the right tool for this. It works for the So maybe I should just find a browser testing solution and figure out how to run that under CI in GitHub Actions. Maybe https://www.cypress.io/ ? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752779490 | https://github.com/simonw/datasette/issues/1165#issuecomment-752779490 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1Mjc3OTQ5MA== | simonw 9599 | 2020-12-30T22:38:43Z | 2020-12-30T22:38:43Z | OWNER | Turned that into a TIL: https://til.simonwillison.net/javascript/jest-without-package-json |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752777744 | https://github.com/simonw/datasette/issues/1165#issuecomment-752777744 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1Mjc3Nzc0NA== | simonw 9599 | 2020-12-30T22:30:24Z | 2020-12-30T22:30:24Z | OWNER | https://www.valentinog.com/blog/jest/ was useful. I created a ```javascript const datasette = require("../plugins.js"); describe("Datasette Plugins", () => { test("it should have datasette.plugins", () => { expect(!!datasette.plugins).toEqual(true); }); test("registering a plugin should work", () => { datasette.plugins.register("numbers", (a, b) => a + b, ["a", "b"]); var result = datasette.plugins.call("numbers", { a: 1, b: 2 }); expect(result).toEqual([3]); datasette.plugins.register("numbers", (a, b) => a * b, ["a", "b"]); var result2 = datasette.plugins.call("numbers", { a: 1, b: 2 }); expect(result2).toEqual([3, 2]); }); }); ``` In module.exports = datasette;
Then inside ``` % npx jest -c '{}' PASS tests/plugins.spec.js Datasette Plugins ✓ it should have datasette.plugins (3 ms) ✓ registering a plugin should work (1 ms) Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 1.163 s
Ran all test suites.
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752773508 | https://github.com/simonw/datasette/issues/983#issuecomment-752773508 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc3MzUwOA== | simonw 9599 | 2020-12-30T22:10:08Z | 2020-12-30T22:11:34Z | OWNER | https://twitter.com/dracos/status/1344402639476424706 points out that plugins returning 0 will be ignored. This should probably check for |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752770488 | https://github.com/simonw/datasette/issues/983#issuecomment-752770488 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc3MDQ4OA== | simonw 9599 | 2020-12-30T21:55:35Z | 2020-12-30T21:58:26Z | OWNER | This one minifies to 241:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752770133 | https://github.com/simonw/datasette/issues/983#issuecomment-752770133 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc3MDEzMw== | simonw 9599 | 2020-12-30T21:53:45Z | 2020-12-30T21:54:22Z | OWNER | FixMyStreet inlines some JavaScript, and it's always a good idea to copy what they're doing when it comes to web performance: https://github.com/mysociety/fixmystreet/blob/23e9564b58a86b783ce47f3c0bf837cbd4fe7282/templates/web/base/common_header_tags.html#L19-L25 Note |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752769452 | https://github.com/simonw/datasette/issues/1164#issuecomment-752769452 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1Mjc2OTQ1Mg== | simonw 9599 | 2020-12-30T21:50:16Z | 2020-12-30T21:50:16Z | OWNER | If I implement this I can automate the CodeMirror minification and remove the bit about running |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
752768785 | https://github.com/simonw/datasette/issues/1164#issuecomment-752768785 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1Mjc2ODc4NQ== | simonw 9599 | 2020-12-30T21:47:06Z | 2020-12-30T21:47:06Z | OWNER | If I'm going to minify |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
752768652 | https://github.com/simonw/datasette/issues/1164#issuecomment-752768652 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1Mjc2ODY1Mg== | simonw 9599 | 2020-12-30T21:46:29Z | 2020-12-30T21:46:29Z | OWNER | Running https://skalman.github.io/UglifyJS-online/ against https://github.com/simonw/datasette/blob/0.53/datasette/static/table.js knocks it down from 7810 characters to 4643. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
752767500 | https://github.com/simonw/datasette/issues/983#issuecomment-752767500 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc2NzUwMA== | simonw 9599 | 2020-12-30T21:42:07Z | 2020-12-30T21:42:07Z | OWNER | Another option: have both "dev" and "production" versions of the plugin mechanism script. Make it easy to switch between the two. Build JavaScript unit tests that exercise the "production" APIs against the development version, and have extra tests that just work against the features in the development version. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752767174 | https://github.com/simonw/datasette/issues/983#issuecomment-752767174 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc2NzE3NA== | simonw 9599 | 2020-12-30T21:40:44Z | 2020-12-30T21:40:44Z | OWNER | Started a Twitter thread about this here: https://twitter.com/simonw/status/1344392603794477056 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752751490 | https://github.com/simonw/datasette/issues/983#issuecomment-752751490 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc1MTQ5MA== | simonw 9599 | 2020-12-30T20:40:04Z | 2020-12-30T21:34:22Z | OWNER | This one is 683 bytes with Uglify - I like how https://skalman.github.io/UglifyJS-online/ shows you the minified character count as you edit the script: ```javascript window.datasette = window.datasette || {}; window.datasette.plugins = (() => { var registry = {}; var definitions = {}; var stringify = JSON.stringify;
})();
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752760815 | https://github.com/simonw/datasette/issues/983#issuecomment-752760815 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc2MDgxNQ== | simonw 9599 | 2020-12-30T21:15:41Z | 2020-12-30T21:15:41Z | OWNER | I'm going to write a few example plugins and try them out against the longer and shorter versions of the script, to get a better feel for how useful the longer versions with the error handling and explicit definition actually are. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752760054 | https://github.com/simonw/datasette/issues/983#issuecomment-752760054 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc2MDA1NA== | simonw 9599 | 2020-12-30T21:12:36Z | 2020-12-30T21:14:05Z | OWNER | I gotta admit that 262 byte version is pretty tempting, if it's going to end up in the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752759885 | https://github.com/simonw/datasette/issues/983#issuecomment-752759885 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc1OTg4NQ== | simonw 9599 | 2020-12-30T21:11:52Z | 2020-12-30T21:14:00Z | OWNER | 262 bytes if I remove the parameter introspection code, instead requiring plugin authors to specify the arguments they take:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752758802 | https://github.com/simonw/datasette/issues/983#issuecomment-752758802 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc1ODgwMg== | simonw 9599 | 2020-12-30T21:07:33Z | 2020-12-30T21:10:10Z | OWNER | Removing the
})();
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752757910 | https://github.com/simonw/datasette/issues/1165#issuecomment-752757910 | https://api.github.com/repos/simonw/datasette/issues/1165 | MDEyOklzc3VlQ29tbWVudDc1Mjc1NzkxMA== | simonw 9599 | 2020-12-30T21:04:18Z | 2020-12-30T21:04:18Z | OWNER | https://jestjs.io/ looks worth trying here. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for executing JavaScript unit tests 776635426 | |
752757289 | https://github.com/simonw/datasette/issues/983#issuecomment-752757289 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc1NzI4OQ== | simonw 9599 | 2020-12-30T21:02:20Z | 2020-12-30T21:02:20Z | OWNER | I'm going to need to add JavaScript unit tests for this new plugin system. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752757075 | https://github.com/simonw/datasette/issues/1164#issuecomment-752757075 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1Mjc1NzA3NQ== | simonw 9599 | 2020-12-30T21:01:27Z | 2020-12-30T21:01:27Z | OWNER | I don't want Datasette contributors to need a working Node.js install to run the tests or work on Datasette unless they are explicitly working on the JavaScript. I think I'm going to do this with a unit test that runs only if That way if anyone checks in a change to JavaScript but forgets to run the minifier the tests will fail in CI. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
752756612 | https://github.com/simonw/datasette/issues/1164#issuecomment-752756612 | https://api.github.com/repos/simonw/datasette/issues/1164 | MDEyOklzc3VlQ29tbWVudDc1Mjc1NjYxMg== | simonw 9599 | 2020-12-30T20:59:54Z | 2020-12-30T20:59:54Z | OWNER | I tried a few different pure-Python JavaScript minifying libraries and none of them produced results as good as https://www.npmjs.com/package/uglify-js for the plugin code I'm considering in #983. So I think I'll need to rely on a Node.js tool for this. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Mechanism for minifying JavaScript that ships with Datasette 776634318 | |
752750551 | https://github.com/simonw/datasette/issues/983#issuecomment-752750551 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc1MDU1MQ== | simonw 9599 | 2020-12-30T20:36:38Z | 2020-12-30T20:37:48Z | OWNER | This version minifies to 702 characters: ```javascript window.datasette = window.datasette || {}; window.datasette.plugins = (() => { var registry = {}; var definitions = {}; var stringify = JSON.stringify;
})(); ``` Or 701 characters using https://skalman.github.io/UglifyJS-online/ |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752749189 | https://github.com/simonw/datasette/issues/983#issuecomment-752749189 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc0OTE4OQ== | simonw 9599 | 2020-12-30T20:31:28Z | 2020-12-30T20:31:28Z | OWNER | Using raw string exceptions, |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752748496 | https://github.com/simonw/datasette/issues/983#issuecomment-752748496 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc0ODQ5Ng== | simonw 9599 | 2020-12-30T20:28:48Z | 2020-12-30T20:28:48Z | OWNER | If I'm going to minify it I'll need to figure out a build step in Datasette itself so that I can easily work on that minified version. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752747999 | https://github.com/simonw/datasette/issues/983#issuecomment-752747999 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc0Nzk5OQ== | simonw 9599 | 2020-12-30T20:27:00Z | 2020-12-30T20:27:00Z | OWNER | I need to decide how this code is going to be loaded. Putting it in a blocking Running it through https://javascript-minifier.com/ produces this, which is 855 characters - so maybe I could inline that into the header of the page?
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752747169 | https://github.com/simonw/datasette/issues/983#issuecomment-752747169 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc0NzE2OQ== | simonw 9599 | 2020-12-30T20:24:07Z | 2020-12-30T20:24:07Z | OWNER | This version adds
})();
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752744311 | https://github.com/simonw/datasette/issues/983#issuecomment-752744311 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc0NDMxMQ== | simonw 9599 | 2020-12-30T20:12:50Z | 2020-12-30T20:13:02Z | OWNER | This could work to define a plugin hook:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752744195 | https://github.com/simonw/datasette/issues/983#issuecomment-752744195 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc0NDE5NQ== | simonw 9599 | 2020-12-30T20:12:26Z | 2020-12-30T20:12:26Z | OWNER | This implementation doesn't have an equivalent of "hookspecs" which can identify if a registered plugin implementation matches a known signature. I should add that, it will provide a better developer experience if someone has a typo. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752742669 | https://github.com/simonw/datasette/issues/983#issuecomment-752742669 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1Mjc0MjY2OQ== | simonw 9599 | 2020-12-30T20:07:05Z | 2020-12-30T20:07:18Z | OWNER | Initial prototype: ```javascript window.datasette = {}; window.datasette.plugins = (function() { var registry = {};
})();
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752729035 | https://github.com/simonw/datasette/issues/983#issuecomment-752729035 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MjcyOTAzNQ== | simonw 9599 | 2020-12-30T19:15:56Z | 2020-12-30T19:16:44Z | OWNER | The
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752722863 | https://github.com/simonw/datasette/issues/983#issuecomment-752722863 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MjcyMjg2Mw== | simonw 9599 | 2020-12-30T18:52:39Z | 2020-12-30T18:52:39Z | OWNER | Then to call the plugins:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752721840 | https://github.com/simonw/datasette/issues/983#issuecomment-752721840 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MjcyMTg0MA== | simonw 9599 | 2020-12-30T18:48:53Z | 2020-12-30T18:51:51Z | OWNER | Potential design:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752721069 | https://github.com/simonw/datasette/issues/983#issuecomment-752721069 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MjcyMTA2OQ== | simonw 9599 | 2020-12-30T18:46:10Z | 2020-12-30T18:46:10Z | OWNER | Pluggy does dependency injection by introspecting the named arguments to the Python function, which I really like. That's tricker in JavaScript. It looks like the only way to introspect a function is to look at the Even more challenging: JavaScript developers love minifying their code, and minification can shorten the function parameter names. From https://code-maven.com/dependency-injection-in-angularjs it looks like Angular.js does dependency injection and solves this by letting you optionally provide a separate list of the arguments your function uses:
I can copy that approach: I'll introspect by default, but provide a documented mechanism for explicitly listing your parameter names so that if you know your plugin code will be minified you can use that instead. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752715412 | https://github.com/simonw/datasette/issues/983#issuecomment-752715412 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MjcxNTQxMg== | simonw 9599 | 2020-12-30T18:25:31Z | 2020-12-30T18:25:31Z | OWNER | I'm going to introduce a global |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752715236 | https://github.com/simonw/datasette/issues/983#issuecomment-752715236 | https://api.github.com/repos/simonw/datasette/issues/983 | MDEyOklzc3VlQ29tbWVudDc1MjcxNTIzNg== | simonw 9599 | 2020-12-30T18:24:54Z | 2020-12-30T18:24:54Z | OWNER | I think I'm going to try building a very lightweight clone of the core API design of Pluggy - not the advanced features, just the idea that plugins can register and a call to |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
JavaScript plugin hooks mechanism similar to pluggy 712260429 | |
752714747 | https://github.com/simonw/datasette/issues/987#issuecomment-752714747 | https://api.github.com/repos/simonw/datasette/issues/987 | MDEyOklzc3VlQ29tbWVudDc1MjcxNDc0Nw== | simonw 9599 | 2020-12-30T18:23:08Z | 2020-12-30T18:23:20Z | OWNER | In terms of "places to put your plugin content", the simplest solution I can think of is something like this: ```html ``` Alternative designs:
I think the original option - an empty |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Documented HTML hooks for JavaScript plugin authors 712984738 | |
752697279 | https://github.com/simonw/datasette/issues/987#issuecomment-752697279 | https://api.github.com/repos/simonw/datasette/issues/987 | MDEyOklzc3VlQ29tbWVudDc1MjY5NzI3OQ== | simonw 9599 | 2020-12-30T17:23:27Z | 2020-12-30T17:23:32Z | OWNER | Related problem: right now if you're writing custom template it's not at all obvious how to write them such that visualization plugins like |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Documented HTML hooks for JavaScript plugin authors 712984738 | |
752696499 | https://github.com/simonw/datasette/issues/987#issuecomment-752696499 | https://api.github.com/repos/simonw/datasette/issues/987 | MDEyOklzc3VlQ29tbWVudDc1MjY5NjQ5OQ== | simonw 9599 | 2020-12-30T17:21:08Z | 2020-12-30T17:21:08Z | OWNER | More generally, I need to document certain areas of the page that JavaScript plugins are invited to append their content to - such that plugin authors can use them and feel confident that future changes to the Datasette templates won't break their plugins. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Documented HTML hooks for JavaScript plugin authors 712984738 | |
752275611 | https://github.com/simonw/datasette/issues/1160#issuecomment-752275611 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI3NTYxMQ== | simonw 9599 | 2020-12-29T23:32:04Z | 2020-12-29T23:32:04Z | OWNER | If I can get this working for CSV, TSV, JSON and JSON-NL that should be enough to exercise the API design pretty well across both streaming and non-streaming formats. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752274509 | https://github.com/simonw/datasette/issues/1160#issuecomment-752274509 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI3NDUwOQ== | simonw 9599 | 2020-12-29T23:26:02Z | 2020-12-29T23:26:02Z | OWNER | The documentation for this plugin hook is going to be pretty detailed, since it involves writing custom classes. I'll stick it all on the existing hooks page for the moment, but I should think about breaking up the plugin hook documentation into a page-per-hook in the future. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752274340 | https://github.com/simonw/datasette/issues/1163#issuecomment-752274340 | https://api.github.com/repos/simonw/datasette/issues/1163 | MDEyOklzc3VlQ29tbWVudDc1MjI3NDM0MA== | simonw 9599 | 2020-12-29T23:25:02Z | 2020-12-29T23:25:02Z | OWNER | This will be built on top of |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert data.db url-to-csv" 776128565 | |
752274078 | https://github.com/simonw/datasette/issues/1160#issuecomment-752274078 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI3NDA3OA== | simonw 9599 | 2020-12-29T23:23:39Z | 2020-12-29T23:23:39Z | OWNER | If I design this right I can ship a full version of the command-line |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752273873 | https://github.com/simonw/datasette/issues/1160#issuecomment-752273873 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI3Mzg3Mw== | simonw 9599 | 2020-12-29T23:22:30Z | 2020-12-29T23:22:30Z | OWNER | How much of this should I get done in a branch before merging into The challenge here is the plugin hook design: ideally I don't want an incomplete plugin hook design in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752273400 | https://github.com/simonw/datasette/issues/1160#issuecomment-752273400 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI3MzQwMA== | simonw 9599 | 2020-12-29T23:19:46Z | 2020-12-29T23:19:46Z | OWNER | I'm going to break out some separate tickets. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752273306 | https://github.com/simonw/datasette/issues/1160#issuecomment-752273306 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI3MzMwNg== | simonw 9599 | 2020-12-29T23:19:15Z | 2020-12-29T23:19:15Z | OWNER | It would be nice if this abstraction could support progress bars as well. These won't necessarily work for every format - or they might work for things loaded from files but not things loaded over URLs (if the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752267905 | https://github.com/simonw/datasette/issues/1160#issuecomment-752267905 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI2NzkwNQ== | simonw 9599 | 2020-12-29T22:52:09Z | 2020-12-29T22:52:09Z | OWNER | What's the simplest thing that could possible work? I think it's |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752266076 | https://github.com/simonw/datasette/issues/1160#issuecomment-752266076 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI2NjA3Ng== | simonw 9599 | 2020-12-29T22:42:23Z | 2020-12-29T22:42:59Z | OWNER | Aside: maybe This would be useful for import mechanisms that are likely to need their own custom set of command-line options unique to that source. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752265600 | https://github.com/simonw/datasette/issues/1160#issuecomment-752265600 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI2NTYwMA== | simonw 9599 | 2020-12-29T22:39:56Z | 2020-12-29T22:39:56Z | OWNER | Does it definitely make sense to break this operation up into the code that turns the incoming format into a iterator of dictionaries, then the code that inserts those into the database using That seems right for simple imports, where the incoming file represents a sequence of records in a single table. But what about more complex formats? What if a format needs to be represented as multiple tables? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752259345 | https://github.com/simonw/datasette/issues/1160#issuecomment-752259345 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI1OTM0NQ== | simonw 9599 | 2020-12-29T22:11:54Z | 2020-12-29T22:11:54Z | OWNER | Important detail from https://docs.python.org/3/library/csv.html#csv.reader
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752257666 | https://github.com/simonw/datasette/issues/1160#issuecomment-752257666 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjI1NzY2Ng== | simonw 9599 | 2020-12-29T22:09:18Z | 2020-12-29T22:09:18Z | OWNER | Figuring out the API designI want to be able to support different formats, and be able to parse them into tables either streaming or in one go depending on if the format supports that. Ideally I want to be able to pull the first 1,024 bytes for the purpose of detecting the format, then replay those bytes again later. I'm considering this a stretch goal though. CSV is easy to parse as a stream - here’s how sqlite-utils does it:
Problem: using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752253095 | https://github.com/simonw/datasette/issues/1161#issuecomment-752253095 | https://api.github.com/repos/simonw/datasette/issues/1161 | MDEyOklzc3VlQ29tbWVudDc1MjI1MzA5NQ== | simonw 9599 | 2020-12-29T21:49:57Z | 2020-12-29T21:49:57Z | OWNER | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Update a whole bunch of links to datasette.io instead of datasette.readthedocs.io 776101101 | ||
752236520 | https://github.com/simonw/datasette/issues/1160#issuecomment-752236520 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjIzNjUyMA== | simonw 9599 | 2020-12-29T20:48:51Z | 2020-12-29T20:48:51Z | OWNER | It would be neat if |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751925934 | https://github.com/simonw/datasette/issues/1160#issuecomment-751925934 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTkyNTkzNA== | simonw 9599 | 2020-12-29T02:40:13Z | 2020-12-29T20:25:57Z | OWNER | Basic command design:
The options can include:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752208036 | https://github.com/simonw/datasette/issues/1160#issuecomment-752208036 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjIwODAzNg== | simonw 9599 | 2020-12-29T19:06:35Z | 2020-12-29T19:06:35Z | OWNER | If I'm going to execute 1000s of writes in an https://stackoverflow.com/a/36648102 and https://github.com/python/asyncio/issues/284 confirm that |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
752203909 | https://github.com/simonw/datasette/issues/1160#issuecomment-752203909 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MjIwMzkwOQ== | simonw 9599 | 2020-12-29T18:54:19Z | 2020-12-29T18:54:19Z | OWNER | More thoughts on this: the key mechanism that populates the tables needs to be an |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751947991 | https://github.com/simonw/datasette/issues/1160#issuecomment-751947991 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTk0Nzk5MQ== | simonw 9599 | 2020-12-29T05:06:50Z | 2020-12-29T05:07:03Z | OWNER | Given the URL option could it be possible for plugins to "subscribe" to URLs that keep on streaming?
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751946262 | https://github.com/simonw/datasette/issues/1160#issuecomment-751946262 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTk0NjI2Mg== | simonw 9599 | 2020-12-29T04:56:12Z | 2020-12-29T04:56:32Z | OWNER | Potential design for this: a
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751945094 | https://github.com/simonw/datasette/issues/1160#issuecomment-751945094 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTk0NTA5NA== | simonw 9599 | 2020-12-29T04:48:11Z | 2020-12-29T04:48:11Z | OWNER | It would be pretty cool if you could launch Datasette directly against an insert-compatible file or URL without first having to load it into a SQLite database file. Or imagine being able to tail a log file and like that directly into a new Datasette process, which then runs a web server with the UI while simultaneously continuing to load new entries from that log into the in-memory SQLite database that it is serving... Not quite sure what that CLI interface would look like. Maybe treat that as a future stretch goal for the moment. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751943837 | https://github.com/simonw/datasette/issues/1160#issuecomment-751943837 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTk0MzgzNw== | simonw 9599 | 2020-12-29T04:40:30Z | 2020-12-29T04:40:30Z | OWNER | The It should accept more than one file name at a time for bulk inserts. if using a URL that URL will be passed to the method that decides if a plugin implementation can handle the import or not. This will allow plugins to register themselves for specific websites. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751926437 | https://github.com/simonw/datasette/issues/1160#issuecomment-751926437 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTkyNjQzNw== | simonw 9599 | 2020-12-29T02:43:21Z | 2020-12-29T02:43:37Z | OWNER | Default formats to support:
Each of these will be implemented as a default plugin. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751926218 | https://github.com/simonw/datasette/issues/1160#issuecomment-751926218 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTkyNjIxOA== | simonw 9599 | 2020-12-29T02:41:57Z | 2020-12-29T02:41:57Z | OWNER | Other names I considered:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751926095 | https://github.com/simonw/datasette/issues/1160#issuecomment-751926095 | https://api.github.com/repos/simonw/datasette/issues/1160 | MDEyOklzc3VlQ29tbWVudDc1MTkyNjA5NQ== | simonw 9599 | 2020-12-29T02:41:15Z | 2020-12-29T02:41:15Z | OWNER | The UI can live at
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"datasette insert" command and plugin hook 775666296 | |
751826749 | https://github.com/simonw/datasette/issues/675#issuecomment-751826749 | https://api.github.com/repos/simonw/datasette/issues/675 | MDEyOklzc3VlQ29tbWVudDc1MTgyNjc0OQ== | simonw 9599 | 2020-12-28T18:49:21Z | 2020-12-28T18:49:21Z | OWNER | That |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
--cp option for datasette publish and datasette package for shipping additional files and directories 567902704 | |
751826621 | https://github.com/simonw/datasette/issues/675#issuecomment-751826621 | https://api.github.com/repos/simonw/datasette/issues/675 | MDEyOklzc3VlQ29tbWVudDc1MTgyNjYyMQ== | simonw 9599 | 2020-12-28T18:48:51Z | 2020-12-28T18:48:51Z | OWNER | I could make
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
--cp option for datasette publish and datasette package for shipping additional files and directories 567902704 | |
751127485 | https://github.com/simonw/datasette/issues/417#issuecomment-751127485 | https://api.github.com/repos/simonw/datasette/issues/417 | MDEyOklzc3VlQ29tbWVudDc1MTEyNzQ4NQ== | simonw 9599 | 2020-12-24T22:58:05Z | 2020-12-24T22:58:05Z | OWNER | That's a great idea. I'd ruled that out because working with the different operating system versions of those is tricky, but if |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Datasette Library 421546944 | |
750390741 | https://github.com/simonw/datasette/pull/1158#issuecomment-750390741 | https://api.github.com/repos/simonw/datasette/issues/1158 | MDEyOklzc3VlQ29tbWVudDc1MDM5MDc0MQ== | simonw 9599 | 2020-12-23T17:05:32Z | 2020-12-23T17:05:32Z | OWNER | Thanks for this! I'm fine keeping the |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Modernize code to Python 3.6+ 773913793 | |
750373603 | https://github.com/simonw/datasette/pull/1158#issuecomment-750373603 | https://api.github.com/repos/simonw/datasette/issues/1158 | MDEyOklzc3VlQ29tbWVudDc1MDM3MzYwMw== | simonw 9599 | 2020-12-23T16:26:21Z | 2020-12-23T16:26:21Z | OWNER | Did you use a tool to find these or are they all from manual code inspection? They look good - I particularly like the set/dict literals. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Modernize code to Python 3.6+ 773913793 | |
749845797 | https://github.com/simonw/datasette/issues/1099#issuecomment-749845797 | https://api.github.com/repos/simonw/datasette/issues/1099 | MDEyOklzc3VlQ29tbWVudDc0OTg0NTc5Nw== | simonw 9599 | 2020-12-23T00:13:29Z | 2020-12-23T00:14:25Z | OWNER | Also need to solve displaying these links in the opposite direction: https://latest.datasette.io/_internal/tables/fixtures,facet_cities That page should link to lists of records in columns, foreign_keys and indexes - like this example: https://latest.datasette.io/fixtures/roadside_attractions/1 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Support linking to compound foreign keys 743371103 | |
748206874 | https://github.com/simonw/datasette/issues/1152#issuecomment-748206874 | https://api.github.com/repos/simonw/datasette/issues/1152 | MDEyOklzc3VlQ29tbWVudDc0ODIwNjg3NA== | simonw 9599 | 2020-12-18T17:03:00Z | 2020-12-22T23:58:04Z | OWNER | Another permissions thought: what if ALL Datasette permissions were default-deny, and plugins could only grant permission to things, not block permission? Right now a plugin can reply If everything in Datasette was default-deny then the user could use More importantly: plugins could return SQL statements that select a list of databases/tables the user is allowed access to. These could then be combined with |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Efficiently calculate list of databases/tables a user can view 770598024 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [issue] INTEGER REFERENCES [issues]([id]) , [performed_via_github_app] TEXT); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
issue >30