{"html_url": "https://github.com/simonw/datasette/issues/983#issuecomment-766536076", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 766536076, "node_id": "MDEyOklzc3VlQ29tbWVudDc2NjUzNjA3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-25T04:43:53Z", "updated_at": "2021-01-25T04:43:53Z", "author_association": "OWNER", "body": "... actually not going to include this in 0.54, I need to write a couple of plugins myself using it before I even make it available in preview.", "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-766484915", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 766484915, "node_id": "MDEyOklzc3VlQ29tbWVudDc2NjQ4NDkxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-25T01:33:29Z", "updated_at": "2021-01-25T01:33:29Z", "author_association": "OWNER", "body": "I'm going to ship a version of this in Datasette 0.54 with a warning that the interface should be considered unstable (see #1202) so that we can start trying this out.", "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-753690280", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 753690280, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzY5MDI4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-03T23:13:30Z", "updated_at": "2021-01-03T23:13:30Z", "author_association": "OWNER", "body": "Oh that's interesting, I hadn't thought about plugins firing events - just responding to events fired by the rest of the application.", "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-753570710", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 753570710, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzU3MDcxMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-03T05:29:56Z", "updated_at": "2021-01-03T05:29:56Z", "author_association": "OWNER", "body": "I thought about using browser events, but they don't quite match the API that I'm looking to provide. In particular, the great thing about Pluggy is that if you have multiple handlers registered for a specific plugin hook each of those handlers can return a value, and Pluggy will combine those values into a list of replies.\r\n\r\nThis is great for things like plugin hooks that add extra menu items - each plugin can return a menu item (maybe as a label/URL/click-callback object) and the calling code can then add all of those items to the menu. See https://docs.datasette.io/en/stable/plugin_hooks.html#table-actions-datasette-actor-database-table for a Python example.\r\n\r\nI'm on the fence about relying on JavaScript modules. I need to think about browser compatibility for them - but I'm already commited to requiring support for `() => {}` arrow functions so maybe I'm committed to module support too already?", "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-753221646", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 753221646, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIyMTY0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T22:58:47Z", "updated_at": "2020-12-31T22:58:47Z", "author_association": "OWNER", "body": "https://github.com/mishoo/UglifyJS/issues/1905#issuecomment-300485490 says:\r\n\r\n> `sourceMappingURL` aren't added by default in `3.x` due to one of the feature requests not to - some users are putting them within HTTP response headers instead.\r\n> \r\n> So the command line for that would be:\r\n> \r\n> ```js\r\n> $ uglifyjs main.js -cmo main.min.js --source-map url=main.min.js.map\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} {"html_url": "https://github.com/simonw/datasette/issues/983#issuecomment-753219521", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 753219521, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIxOTUyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T22:39:52Z", "updated_at": "2020-12-31T22:39:52Z", "author_association": "OWNER", "body": "For inlining the `plugins.min.js` file into the Jinja templates I could use the trick described here: https://stackoverflow.com/a/41404611 - which adds a `{{ include_file('file.txt') }}` function to Jinja.", "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-753219407", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/983", "id": 753219407, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIxOTQwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T22:38:45Z", "updated_at": "2020-12-31T22:39:10Z", "author_association": "OWNER", "body": "You'll be able to add JavaScript plugins using a bunch of different mechanisms:\r\n\r\n- In a custom template, dropping the code in to a `