{"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-754182058", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 754182058, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NDE4MjA1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-04T19:53:31Z", "updated_at": "2021-01-04T19:53:31Z", "author_association": "OWNER", "body": "This will be helped by the new `package.json` added in #1170.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-753221362", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 753221362, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIyMTM2Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T22:55:57Z", "updated_at": "2020-12-31T22:55:57Z", "author_association": "OWNER", "body": "I had to add this as the first line in `table.min.js` for the source mapping to work:\r\n```\r\n//# sourceMappingURL=/-/static/table.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": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-753220665", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 753220665, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIyMDY2NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T22:49:36Z", "updated_at": "2020-12-31T22:49:36Z", "author_association": "OWNER", "body": "I started with a 7K `table.js` file.\r\n\r\n`npx uglifyjs table.js --source-map -o table.min.js` gave me a 5.6K `table.min.js` file. \r\n\r\n`npx uglifyjs table.js --source-map -o table.min.js --compress --mangle` gave me 4.5K.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-753220412", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 753220412, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIyMDQxMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T22:47:36Z", "updated_at": "2020-12-31T22:47:36Z", "author_association": "OWNER", "body": "I'm trying to minify `table.js` and I ran into a problem:\r\n\r\n Uglification failed. Unexpected character '`'\r\n\r\nIt turns out `uglify-js` doesn't support ES6 syntax!\r\n\r\nBut `uglify-es` does:\r\n\r\n npm install uglify-es\r\n\r\nAnnoyingly it looks like `uglify-es` uses the same CLI command, `uglifyjs`. So after installing it this seemed to work:\r\n\r\n npx uglifyjs table.js --source-map -o table.min.js\r\n\r\nI really don't like how `npx uglifyjs` could mean different things depending on which package was installed.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-752769452", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 752769452, "node_id": "MDEyOklzc3VlQ29tbWVudDc1Mjc2OTQ1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-30T21:50:16Z", "updated_at": "2020-12-30T21:50:16Z", "author_association": "OWNER", "body": "If I implement this I can automate the CodeMirror minification and remove the bit about running `uglify-js` against it from the documentation here: https://docs.datasette.io/en/0.53/contributing.html#upgrading-codemirror", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-752768785", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 752768785, "node_id": "MDEyOklzc3VlQ29tbWVudDc1Mjc2ODc4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-30T21:47:06Z", "updated_at": "2020-12-30T21:47:06Z", "author_association": "OWNER", "body": "If I'm going to minify `table.js` I'd like to offer a source map for it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-752768652", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 752768652, "node_id": "MDEyOklzc3VlQ29tbWVudDc1Mjc2ODY1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-30T21:46:29Z", "updated_at": "2020-12-30T21:46:29Z", "author_association": "OWNER", "body": "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.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-752757075", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 752757075, "node_id": "MDEyOklzc3VlQ29tbWVudDc1Mjc1NzA3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-30T21:01:27Z", "updated_at": "2020-12-30T21:01:27Z", "author_association": "OWNER", "body": "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.\r\n\r\nI think I'm going to do this with a unit test that runs only if `upglify-js` is available on the path and confirms that the `*.min.js` version of each script in the repository correctly matches the results from running `uglify-js` against it.\r\n\r\nThat way if anyone checks in a change to JavaScript but forgets to run the minifier the tests will fail in CI.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1164#issuecomment-752756612", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1164", "id": 752756612, "node_id": "MDEyOklzc3VlQ29tbWVudDc1Mjc1NjYxMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-30T20:59:54Z", "updated_at": "2020-12-30T20:59:54Z", "author_association": "OWNER", "body": "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.\r\n\r\nSo I think I'll need to rely on a Node.js tool for this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 776634318, "label": "Mechanism for minifying JavaScript that ships with Datasette"}, "performed_via_github_app": null}