GitHub ReleaseEvent at 2014-08-30 16:50:32
Repository: peripheral
Actor: xsc
Payload: {"action":"published","release":{"url":"https://api.github.com/repos/xsc/peripheral/releases/525628","assets_url":"https://api.github.com/repos/xsc/peripheral/releases/525628/assets","upload_url":"https://uploads.github.com/repos/xsc/peripheral/releases/525628/assets{?name}","html_url":"https://github.com/xsc/peripheral/releases/tag/clojars-0.4.0","id":525628,"tag_name":"clojars-0.4.0","target_commitish":"master","name":"Release 0.4.0","draft":false,"author":{"login":"xsc","id":198072,"avatar_url":"https://avatars.githubusercontent.com/u/198072?v=2","gravatar_id":"c561d73a500d88f41efa89d21368e7b2","url":"https://api.github.com/users/xsc","html_url":"https://github.com/xsc","followers_url":"https://api.github.com/users/xsc/followers","following_url":"https://api.github.com/users/xsc/following{/other_user}","gists_url":"https://api.github.com/users/xsc/gists{/gist_id}","starred_url":"https://api.github.com/users/xsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xsc/subscriptions","organizations_url":"https://api.github.com/users/xsc/orgs","repos_url":"https://api.github.com/users/xsc/repos","events_url":"https://api.github.com/users/xsc/events{/privacy}","received_events_url":"https://api.github.com/users/xsc/received_events","type":"User","site_admin":false},"prerelease":false,"created_at":"2014-08-30T16:24:05Z","published_at":"2014-08-30T16:50:31Z","assets":[],"tarball_url":"https://api.github.com/repos/xsc/peripheral/tarball/clojars-0.4.0","zipball_url":"https://api.github.com/repos/xsc/peripheral/zipball/clojars-0.4.0","body":"This release incorporates changes to `defcomponent`.\r\n\r\n### Breaking Changes\r\n\r\nIf the value returned by an active lifecycle handler (`:peripheral/start`, `:peripheral/started`, ...) has a different class than the component passed to it, an exception is thrown. This prevents simple-to-overlook bugs like the following:\r\n\r\n```clojure\r\n...\r\n:peripheral/started\r\n(fn [{:keys [state-atom]}]\r\n  (swap! state-atom assoc :started (System/currentTimeMillis)))\r\n...\r\n```\r\n\r\nUp until now, this had the component replaced with the content of `state-atom`; since f2745040b1a2912e91d8dcd37237a5f65d0cd745 it'll throw an exception.\r\n\r\n### Field Access in Lifecycle\r\n\r\nFields can now be directly accessed from within lifecycle handlers via their symbol (af70ebc3441c634ed02162284a4d1745fbe2902b), i.e. this:\r\n\r\n```clojure\r\n...\r\n:state-atom (atom {})\r\n:peripheral/started\r\n(fn [{:keys [state-atom]}]\r\n  (swap! state-atom ...)\r\n  ...)\r\n...\r\n```\r\n\r\ncan become:\r\n\r\n```clojure\r\n...\r\n:state-atom (atom {})\r\n:peripheral/started\r\n(fn [this]\r\n  (swap! state-atom ...)\r\n...\r\n```\r\n\r\n### Passive Lifecycle Handlers\r\n\r\nThe `:on/...` prefix marks a passive lifecycle handler (af52e0bebbaa1ff8e717bff44209aa2c321dc9a1), consisting of a form that's executed as-is at the respective point in time. Purposes could include logging, i.e. this:\r\n\r\n```clojure\r\n...\r\n:peripheral/started\r\n(fn [{:keys [state-atom] :as this}]\r\n  (debug \"initial state:\" @state-atom)\r\n  this)\r\n...\r\n```\r\n\r\ncould be expressed as:\r\n\r\n```clojure\r\n...\r\n:on/started (debug \"initial state:\" @state-atom)\r\n...\r\n```\r\n\r\n### Artifact\r\n\r\n```clojure\r\n[peripheral \"0.4.0\"]\r\n```"}}