{"id":16862397,"url":"https://github.com/dave/jsgo","last_synced_at":"2025-04-08T03:14:26.154Z","repository":{"id":39380630,"uuid":"117643550","full_name":"dave/jsgo","owner":"dave","description":"GopherJS compiler, serving framework and CDN.","archived":false,"fork":false,"pushed_at":"2023-02-24T23:33:05.000Z","size":1088,"stargazers_count":271,"open_issues_count":8,"forks_count":11,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-31T18:21:18.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://jsgo.io/\u003cpath\u003e","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dave.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-16T06:49:37.000Z","updated_at":"2024-09-29T11:24:47.000Z","dependencies_parsed_at":"2024-06-18T18:17:26.158Z","dependency_job_id":"91af3b27-74ca-40d8-96e0-67a9d0c6d300","html_url":"https://github.com/dave/jsgo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fjsgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fjsgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fjsgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fjsgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dave","download_url":"https://codeload.github.com/dave/jsgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T14:35:23.370Z","updated_at":"2025-04-08T03:14:26.130Z","avatar_url":"https://github.com/dave.png","language":"Go","funding_links":["https://patreon.com/davebrophy"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://patreon.com/davebrophy\" title=\"Help with my hosting bills using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\n# 2020 Update\n\n* The compile.jsgo.io and play.jsgo.io services have been shut down.   \n* Anything deployed to jsgo.io or pkg.jsgo.io will continue to work fine.  \n\nI created the jsgo.io system several years ago, and it costs about $150/month to host which I pay \npersonally. I'm tightening up my finances right now, so this outgoing had to stop.\n\nIf anyone would like to host it for me (it runs on a single GKE `n1-standard-2` instance), please \nlet me know and we can get it back online!\n\nI had a plan for a big rewrite that would make is possible to run on App Engine, thus reduce the \ncost to almost zero. Unfortunately this is something I'm hesitant to start, because it seems that \nGo on the client is moving away from GopherJS and towards WASM.  \n\n# jsgo.io\n\n[GopherJS](https://github.com/gopherjs/gopherjs) is an amazing tool, but I've always been frustrated \nby the size of the output. All the packages in the dependency tree (including the standard library) \nare compiled to a single JS file. This can cause the resultant file to be several megabytes. \n\nI've always thought a better solution would be to split the JS up by package and store it in a centralized \nCDN. This architecture would then allow aggressive caching: If you import `fmt`, it'll be delivered as \na separate file `fmt.js`, and there's a good chance some of your visitors will already have it in their \nbrowser cache. Additionally, incremental updates to your app will only change the package you're updating, \nso your visitors won't have to download the entire dependency tree again.\n\n`jsgo.io` makes this simple. \n\n\u003cimg width=\"75%\" src=\"https://user-images.githubusercontent.com/925351/36342450-1595a85a-13ff-11e8-9ebe-7019c3f4d1af.png\"\u003e\n\n### Features\n\n* Compiles Go to JS using [GopherJS](https://github.com/gopherjs/gopherjs).  \n* Splits the JS up by Go package.  \n* Stores the JS in a CDN for you (GCP / Cloudflare).  \n* Aggressively caches the JS.  \n* Creates a page on `jsgo.io` that runs the JS.  \n* Creates a single `loader JS` file you can use on your site.\n\n### How it works\n\nVisit `https://compile.jsgo.io/\u003cpath\u003e` to compile or re-compile your package. Here's a [very simple \nhello world](https://compile.jsgo.io/github.com/dave/jstest). Just click `Compile`.\n\nAfter it's finished, you'll be shown a link to a [page that runs the code](https://jsgo.io/dave/jstest) \non `jsgo.io`. The compile page will also give you a link to a single JS file on `pkg.jsgo.io` - this \nis the `loader JS` for your package. Add this in a `\u003cscript\u003e` tag on your site and it will download \nall the dependencies and execute your package.\n\nURLs on `jsgo.io` that start `github.com` may be abbreviated: `github.com/foo/bar` will be available \nat `jsgo.io/foo/bar` and also `jsgo.io/github.com/foo/bar`. Package URLs on `pkg.jsgo.io` always use \nthe full path.  \n\n### Production ready?\n\nThe package CDN (everything on `pkg.jsgo.io`) should be considered relatively production ready - it's \njust static JS files in a Google Storage bucket behind a Cloudflare CDN so there's very little that can \ngo wrong. Additionally, the URL of each file contains a hash of it's contents, ensuring immutability.\n\nThe index pages (everything on `jsgo.io`) should only be used for testing and toy projects. Remember \nyou're sharing a domain with everyone else, so the browser environment (cookies, local storage etc.) \nshould be used with caution! For anything important, create your own index page on your site and add \nthe `loader JS` (on `pkg.jsgo.io`) to a `\u003cscript\u003e` tag.  \n\nThs compile server (everything on `compile.jsgo.io`) should be considered in beta... Please [add an issue](https://github.com/dave/jsgo/issues) \nif it's having trouble compiling your project. \n\n### Demos\n\n* https://jsgo.io/hajimehoshi/go-inovation\n* https://jsgo.io/hajimehoshi/ebiten/examples/2048\n* https://jsgo.io/shurcooL/tictactoe/cmd/tictactoe\n* https://jsgo.io/dave/todomvc\n* https://jsgo.io/gopherjs/vecty/example/markdown\n* https://jsgo.io/dave/html2vecty\n* https://jsgo.io/dave/zip\n* https://jsgo.io/dave/img\n\nThe power of aggressive caching is apparent when loading pages which share common packages... The examples\nin the [ebiten](https://github.com/hajimehoshi/ebiten) game library are a great demonstration of this:  \n\n* https://jsgo.io/hajimehoshi/ebiten/examples/blocks\n* https://jsgo.io/hajimehoshi/ebiten/examples/airship\n* https://jsgo.io/hajimehoshi/ebiten/examples/alphablending\n* https://jsgo.io/hajimehoshi/ebiten/examples/audio\n* https://jsgo.io/hajimehoshi/ebiten/examples/infinitescroll\n* https://jsgo.io/hajimehoshi/ebiten/examples/rotate\n* https://jsgo.io/hajimehoshi/ebiten/examples/sprites\n\n### Index\n\nYou can customize the HTML delivered by the `jsgo.io` page by adding a file named `index.jsgo.html` to \nyour package. Use `{{ .Script }}` as the script src. See [todomvc](https://github.com/dave/todomvc/blob/master/index.jsgo.html) \nfor an example.\n\n### Progress\n\nIf a function `window.jsgoProgress` exists, it will be called repeatedly as packages load. Two parameters \nare supplied: `count` (the number of packages loaded so far) and `total` (the total number of packages).\n\nThe default index page on `jsgo.io` is to display a simple `count / total` message in a span. However, \nby supplying a custom `index.jsgo.html`, more complex effects may be created - see the [html2vecty \nexample](https://jsgo.io/dave/html2vecty) for a [bootstrap progress bar](https://github.com/dave/html2vecty/blob/master/index.jsgo.html).\n\n### Limitations\n\nIf there's any non git repositories (e.g. hg, svn or bzr) in your dependency tree, it will fail. This \nis unlikely to change. Workaround: vendor the dependencies and it'll work fine.  \n\n### How to contact me\n\nIf you'd like to chat more about the project, feel free to [add an issue](https://github.com/dave/jsgo/issues), \nmention [@dave](https://github.com/dave/) in your PR, email me or post in the #gopherjs channel of the \nGophers Slack. I'm happy to help!\n\n### Run locally?\n\nIf you'd like to run jsgo locally, take a look at [these instructions](LOCAL.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave%2Fjsgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdave%2Fjsgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave%2Fjsgo/lists"}