{"html_url": "https://github.com/simonw/datasette/pull/1170#issuecomment-754002859", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1170", "id": 754002859, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NDAwMjg1OQ==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2021-01-04T14:22:52Z", "updated_at": "2021-01-04T14:22:52Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1170?src=pr&el=h1) Report\n> Merging [#1170](https://codecov.io/gh/simonw/datasette/pull/1170?src=pr&el=desc) (a5761cc) into [main](https://codecov.io/gh/simonw/datasette/commit/1e8fa3ac7cb2d6e516c47c306c86ed2334fc3dc0?el=desc) (1e8fa3a) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/1170/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/1170?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## main #1170 +/- ##\n=======================================\n Coverage 91.55% 91.55% \n=======================================\n Files 32 32 \n Lines 3932 3932 \n=======================================\n Hits 3600 3600 \n Misses 332 332 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1170?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `\u0394 = absolute (impact)`, `\u00f8 = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/simonw/datasette/pull/1170?src=pr&el=footer). Last update [1e8fa3a...a5761cc](https://codecov.io/gh/simonw/datasette/pull/1170?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 778126516, "label": "Install Prettier via package.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/983#issuecomment-754181647", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 754181647, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NDE4MTY0Nw==", "user": {"value": 11941245, "label": "jussiarpalahti"}, "created_at": "2021-01-04T19:52:40Z", "updated_at": "2021-01-04T19:52:40Z", "author_association": "NONE", "body": "I was thinking JavaScript plugins going with server side template extensions custom HTML. Attach my own widgets on there and listen for Datasette events to refresh when user interacts with main UI. Like a map view or table that updates according to selected column. There's certainly other ways to look at this. Perhaps you could list possible hooks or high level design doc on what would be possible with the plugin system?\n\nRe: modules. I would like to see modules supported at least in development. The developer experience is so much better than what JavaScript coding has been in the past. With large parts of NPM at your disposal I\u2019d imagine even less experienced coder can whisk a custom plugin in no time. Proper production build system (like one you get with Pika or Parcel) could package everything up into bundles that older browsers can understand. Though that does come with performance and size penalties alongside the added complexity. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 712260429, "label": "JavaScript plugin hooks mechanism similar to pluggy"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/983#issuecomment-754210356", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 754210356, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NDIxMDM1Ng==", "user": {"value": 222245, "label": "carlmjohnson"}, "created_at": "2021-01-04T20:49:05Z", "updated_at": "2021-01-04T20:49:05Z", "author_association": "NONE", "body": "For reasons [I've written about elsewhere](https://blog.carlmjohnson.net/post/2020/time-to-kill-ie11/), I'm in favor of modules. It has several beneficial effects. One, old browsers just ignore it all together. Two, if you include the same plain script on the page more than once, it will be executed twice, but if you include the same module script on a page twice, it will only execute once. Three, you get a module local namespace, instead of having to use the global window namespace or a function private namespace.\r\n\r\nOTOH, if you are going to use an old style script, the code from before isn't ideal, because you wipe out your registry if the script it included more than once. Also you may as well use object methods and splat arguments.\r\n\r\nThe event based architecture probably makes more sense though. Just make up some event names prefixed with `datasette:` and listen for them on the root. The only concern with that approach is it can sometimes be tricky to make sure your plugins are run after datasette has run. Maybe \r\n\r\n```js\r\nfunction mycallback(){\r\n // whatever\r\n}\r\n\r\nif (window.datasette) {\r\n window.datasette.init(mycallback);\r\n} else {\r\n document.addEventListener('datasette:init', mycallback);\r\n}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 712260429, "label": "JavaScript plugin hooks mechanism similar to pluggy"}, "performed_via_github_app": null}