{"id":18994918,"url":"https://github.com/wevre/transit-cljd","last_synced_at":"2025-09-06T06:31:48.687Z","repository":{"id":165413237,"uuid":"619283310","full_name":"wevre/transit-cljd","owner":"wevre","description":"Transit for ClojureDart","archived":false,"fork":false,"pushed_at":"2023-05-15T15:43:43.000Z","size":64,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T17:40:59.387Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wevre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-03-26T19:40:08.000Z","updated_at":"2024-10-21T01:02:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb20d50f-c045-4842-a2a8-13be5acf0b7a","html_url":"https://github.com/wevre/transit-cljd","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wevre%2Ftransit-cljd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wevre%2Ftransit-cljd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wevre%2Ftransit-cljd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wevre%2Ftransit-cljd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wevre","download_url":"https://codeload.github.com/wevre/transit-cljd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232098370,"owners_count":18472318,"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-11-08T17:27:35.951Z","updated_at":"2025-09-06T06:31:48.676Z","avatar_url":"https://github.com/wevre.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# transit-cljd\n\nTransit is a data format and set of libraries for conveying values between\napplications written in different languages. This library provides support for\nmarshalling Transit data to/from ClojureDart.\n\n* [Transit Rationale](https://blog.cognitect.com/blog/2014/7/22/transit)\n* [Transit Specification](https://github.com/cognitect/transit-format)\n* [transit-cljd API docs] coming soon\n\nThis implementation's major.minor version number corresponds to the version of\nthe Transit specification it supports.\n\n_NOTE: Transit is intended primarily as a wire protocol for transferring data\nbetween applications. If storing Transit data durably, readers and writers are\nexpected to use the same version of Transit and you are responsible for\nmigrating/transforming/re-storing that data when and if the transit format\nchanges._\n\n## Releases and Dependency Information\n\n* Latest release: 0.8.36 \u003c!--TRANSIT_CLJD_VERSION--\u003e\n\nIn deps.edn:\n\n\u003c!--TRANSIT_CLJD_DEPS--\u003e\n```\nio.github.wevre/transit-cljd {:git/tag \"v0.8.36\" :git/sha \"d9541d0\"}\n```\n\n## Usage\n\nThe example below shows the use of custom read/write handlers. See more examples\nin the various test files.\n\n```\n(ns main\n  (:require [\"dart:async\" :as async]\n            [wevre.transit-cljd :as transit]\n            [\"package:transit_dart/transit_dart.dart\" :as td]))\n\n(defrecord Point [x y])\n\n(def point-write-handler (reify :extends #/(td/WriteHandler Point dynamic)\n                           (tag [_ l] \"point\")\n                           (rep [_ obj .tag] [(:x obj) (:y obj)])))\n\n(def point-read-handler (reify :extends #/(td/ReadHandler Point dynamic)\n                          (fromRep [_ o] (-\u003ePoint (first o) (second o)))))\n\n(defn main []\n  (let [codec (transit/json :custom-read-handlers {\"point\" point-read-handler}\n                            :custom-write-handlers {(#/(td/Class Point)) point-write-handler})\n        objects [\"foo\" :bar {:a [1 2]}\n                 #inst \"2023-11-03T14:23:51.010-00:00\"\n                 (-\u003ePoint 1.2 3.4)]\n        _ (println \"Object: \" objects)\n        encoded (await\n                 (-\u003e (async/Stream.fromIterable objects)\n                     (.transform (.-encoder codec))\n                     .toList))\n        _ (println \"Encoded: \" encoded)\n        decoded (await\n                 (-\u003e (async/Stream.fromIterable encoded)\n                     (. #/(cast String))\n                     (.transform (.-decoder codec))\n                     .toList))\n        _ (println \"Decoded: \" decoded)]))\n```\n\n## Default Type Mapping\n\nAll the types supported by [transit-dart](github.com/wevre/transit-dart) are\nsupported here with additional types, specific to ClojureDart, listed in the\ntable below. This implementation also uses native ClojureDart collections for\narrays, maps, and sets.\n\n|Transit Type   |Write accepts           |Read produces           |\n|------         |------                  |------                  |\n|keyword        |cljd/Keyword            |cljd/Keyword            |\n|symbol         |cljd/Symbol             |cljd/Symbol             |\n\n## Testing\n\nTo run the roundtrip verification tests in `transit-format`, first ensure\nDart\u003e=2.19.4 and Java 8 are installed, then do the following:\n\n1. Set up a testing directory where `transit-format` and `transit-cljd` can be\n   cloned side-by-side. We have a fork `transit-format` that has support for\n   testing `transit-cljd` all ready to go. Clone this to your test directory.\n\n```sh\nmkdir transit-test\ncd transit-test\ngit clone https://github.com/wevre/transit-format.git\n# Do something similar to the following to ensure Java 8.\njenv local 1.8\n```\n\n2. From the `transit-format` directory, run the verify command.\n\n```sh\nbin/verify -impls cljd\n```\n\n_NOTE: The above instructions might not quite work because of incompatibilities\nbetween Java 8 and later versions. ClojureDart has until very recently required\nJava 11. You might need to manually compile the 'wevre.roundtrip' namespace in\nJava 11, and then run verify with Java 8._\n\n```sh\n# Do this in the transit-test directory with Java 11.\ngit clone git@github.com:wevre/transit-cljd\ncd transit-cljd\nclj -M:cljd compile wevre.roundtrip\ncd ../transit-format\nbin/verify -impls cljd\n```\n\n## Copyright and License\n\nCopyright © 2023 Michael J. Weaver\n\nThis library is a ClojureDart port of the Clojure version created and maintained\nby Cognitect.\n\nCopyright © 2014-2020 Cognitect\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at https://www.apache.org/licenses/LICENSE-2.0. Unless required by\napplicable law or agreed to in writing, software distributed under the License\nis distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwevre%2Ftransit-cljd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwevre%2Ftransit-cljd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwevre%2Ftransit-cljd/lists"}