{"id":13524436,"url":"https://github.com/chenyan2002/ic-elm","last_synced_at":"2025-04-01T02:31:33.642Z","repository":{"id":42743387,"uuid":"281456761","full_name":"chenyan2002/ic-elm","owner":"chenyan2002","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-07T20:20:02.000Z","size":792,"stargazers_count":5,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-21T12:54:16.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenyan2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-21T17:03:59.000Z","updated_at":"2023-10-18T22:24:37.000Z","dependencies_parsed_at":"2023-02-08T00:30:34.649Z","dependency_job_id":null,"html_url":"https://github.com/chenyan2002/ic-elm","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenyan2002%2Fic-elm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenyan2002%2Fic-elm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenyan2002%2Fic-elm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenyan2002%2Fic-elm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenyan2002","download_url":"https://codeload.github.com/chenyan2002/ic-elm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222693039,"owners_count":17024034,"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-08-01T06:01:10.056Z","updated_at":"2024-11-02T08:31:48.889Z","avatar_url":"https://github.com/chenyan2002.png","language":"JavaScript","funding_links":[],"categories":["Candid"],"sub_categories":["Candid implementations"],"readme":"# ic-elm\n\nA template for using Elm to develop frontend user interface for the Internet Computer.\n\n# Overview\n\nElm --\u003e JSON --\u003e JS Candid Encoder --\u003e IC canister --\u003e JS Candid Decoder --\u003e JSON --\u003e Elm\n\nCurrently Candid methods is untyped to Elm. The error only happens on the JS side in the runtime.\nEventually, we want to generate method bindings in Elm via the Candid compiler.\n\n# Design choices\n\nThere are several options for the `port` function type in Elm:\n\n* JSON value: It's the recommended way for Elm-JS interop. To transfer JS objects, mainly BigNumber and CanisterId, we need to convert objects/classes into a JSON representation, which can be done via the visitor pattern. The downside is that Elm needs to understand the JS specific representation of the Candid values. We can provide a codegen from candid file to hide the representation detail from the user.\n* Variant type: JS doesn't have variant types, and Elm cannot transfer native variant types directly. So we need to design a JSON encoding for variant types, which requires work in both JS and Elm.\n* String (Candid text format): This is language agnostic, and we can build a library for parsing and stringify the Candid values completely in Elm. On the JS side, there is little work required. Conceptually, this is better than JSON, as the format is in the spec and language agnostic, but it requires more work in Elm.\n* Blob (Candid binary format): Also language agnostic, but a bit heavy weight (building type tables, skipping unused fields, etc), and we don't get any code reuse from the JS library.\n\nOverall, it seems the easiest approach is to use JSON for Elm-JS interop.\n\n# Usage \n\n```bash\ncd ic-elm\nnpm install\ndfx canister create --all\ndfx build\ndfx canister install --all\n```\n\nTo learn more before you start working with elm, see the following documentation available online:\n\n- [Quick Start](https://sdk.dfinity.org/docs/quickstart/quickstart.html)\n- [SDK Developer Tools](https://sdk.dfinity.org/docs/developers-guide/sdk-guide.html)\n- [Motoko Programming Language Guide](https://sdk.dfinity.org/docs/language-guide/motoko.html)\n- [Motoko Language Quick Reference](https://sdk.dfinity.org/docs/language-guide/language-manual.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenyan2002%2Fic-elm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenyan2002%2Fic-elm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenyan2002%2Fic-elm/lists"}