{"action":"created","issue":{"url":"https://api.github.com/repos/ckirkendall/kioo/issues/72","repository_url":"https://api.github.com/repos/ckirkendall/kioo","labels_url":"https://api.github.com/repos/ckirkendall/kioo/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/ckirkendall/kioo/issues/72/comments","events_url":"https://api.github.com/repos/ckirkendall/kioo/issues/72/events","html_url":"https://github.com/ckirkendall/kioo/pull/72","id":185263043,"number":72,"title":"Compile time transforms","user":{"login":"alesguzik","id":209175,"avatar_url":"https://avatars.githubusercontent.com/u/209175?v=3","gravatar_id":"","url":"https://api.github.com/users/alesguzik","html_url":"https://github.com/alesguzik","followers_url":"https://api.github.com/users/alesguzik/followers","following_url":"https://api.github.com/users/alesguzik/following{/other_user}","gists_url":"https://api.github.com/users/alesguzik/gists{/gist_id}","starred_url":"https://api.github.com/users/alesguzik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alesguzik/subscriptions","organizations_url":"https://api.github.com/users/alesguzik/orgs","repos_url":"https://api.github.com/users/alesguzik/repos","events_url":"https://api.github.com/users/alesguzik/events{/privacy}","received_events_url":"https://api.github.com/users/alesguzik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-25T23:50:49Z","updated_at":"2016-11-04T15:52:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ckirkendall/kioo/pulls/72","html_url":"https://github.com/ckirkendall/kioo/pull/72","diff_url":"https://github.com/ckirkendall/kioo/pull/72.diff","patch_url":"https://github.com/ckirkendall/kioo/pull/72.patch"},"body":"This allows having transforms that should be performed during compile-time. Main reason for this were that when you have components that are containers for other components you have great level of markup duplication when you'll never actually need it. Think of page with container with list of files. list container will contain all markup with sample files, it's container also will contain it, and page layout container will also contain it. With this changes you may have it like this:\n\n``` clojure\n(defsnippet file-component' \"templates/profile.html\" [:section.profile-main-section :#tab-files [:.col-xs-3.file-outer first-of-type]]\n [file local-state owner folder stats]\n {[:.file-content-type] {(kioo.common/content)\n                         (kioo/substitute [category-label/category-label-component file])}\n```\n\nAbove will apply `(kioo.common/content)` at compile-time, so resulting clojurescript for the component won't contain markup that would always be replaced by `(kioo/substitute [category-label/category-label-component file])` at runtime.\n\n`(kioo.common/content)` is the most immediatelly useful compile-time transform, so I've also added shorthand syntax for it (notice square brackets):\n\n``` clojure\n(defsnippet file-component' \"templates/profile.html\" [:section.profile-main-section :#tab-files [:.col-xs-3.file-outer first-of-type]]\n[file local-state owner folder stats]\n{[:.file-content-type] [kioo/substitute [category-label/category-label-component file]]\n```\n\nThis does exactly the same thing as above, but arguably much cleaner.\n\nUsing above in our codebase have shrunk total compiled clojurescript from 14 MB to 7.3 MB.\n"},"comment":{"url":"https://api.github.com/repos/ckirkendall/kioo/issues/comments/258469883","html_url":"https://github.com/ckirkendall/kioo/pull/72#issuecomment-258469883","issue_url":"https://api.github.com/repos/ckirkendall/kioo/issues/72","id":258469883,"user":{"login":"alesguzik","id":209175,"avatar_url":"https://avatars.githubusercontent.com/u/209175?v=3","gravatar_id":"","url":"https://api.github.com/users/alesguzik","html_url":"https://github.com/alesguzik","followers_url":"https://api.github.com/users/alesguzik/followers","following_url":"https://api.github.com/users/alesguzik/following{/other_user}","gists_url":"https://api.github.com/users/alesguzik/gists{/gist_id}","starred_url":"https://api.github.com/users/alesguzik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alesguzik/subscriptions","organizations_url":"https://api.github.com/users/alesguzik/orgs","repos_url":"https://api.github.com/users/alesguzik/repos","events_url":"https://api.github.com/users/alesguzik/events{/privacy}","received_events_url":"https://api.github.com/users/alesguzik/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T15:52:44Z","updated_at":"2016-11-04T15:52:44Z","body":"The thing you've referenced is a way to change whole html snippet, not a way to apply kioo transformations to snippet's subtree by selectors at compile time. "}}
{"actor":{"display_login":"alesguzik"}}