Skip to content

Commit

Permalink
fix defcomp decorating; tag 0.16.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Mar 25, 2024
1 parent 48b2d9a commit 2015763
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: calcit-lang/[email protected]
with:
version: '0.8.43'
version: '0.8.44'

- name: "load deps"
run: caps --ci && yarn
Expand Down
133 changes: 80 additions & 53 deletions calcit.cirru

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions compact.cirru
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

{} (:package |respo)
:configs $ {} (:init-fn |respo.main/main!) (:reload-fn |respo.main/reload!) (:version |0.16.8)
:configs $ {} (:init-fn |respo.main/main!) (:reload-fn |respo.main/reload!) (:version |0.16.9)
:modules $ [] |memof/ |lilac/ |calcit-test/
:entries $ {}
:files $ {}
Expand Down Expand Up @@ -678,22 +678,27 @@
event $ pick-event props
%{} schema/Element (:name tag-name) (:coord nil) (:attrs attrs) (:style styles) (:event event)
:children $ map child-map confirm-child-pair
|decorate-defcomp $ %{} :CodeEntry (:doc "|detect root element under component and add `data-defcomp` mark")
:code $ quote
defn decorate-defcomp (c name)
update c :tree $ fn (tree)
if (&record:matches? tree schema/Element)
update tree :attrs $ fn (attrs)
conj attrs $ [] :data-comp name
, tree
|defcomp $ %{} :CodeEntry (:doc |)
:code $ quote
defmacro defcomp (comp-name params & body)
assert "\"expected symbol of comp-name" $ symbol? comp-name
assert "\"expected list for params" $ list? params
assert "\"some component retured" $ &> (count body) 0
quasiquote $ defn ~comp-name (~ params)
->
decorate-defcomp
extract-effects-list $ %{} schema/Component
:effects $ []
:name $ ~ (turn-tag comp-name)
:tree $ do (~@ body)
update-in ([] :tree :attrs)
fn (attrs)
conj attrs $ [] :data-comp
~ $ turn-string comp-name
~ $ turn-string comp-name
|defeffect $ %{} :CodeEntry (:doc |)
:code $ quote
defmacro defeffect (effect-name args params & body)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "0.16.8",
"version": "0.16.9",
"dependencies": {
"@calcit/procs": "^0.8.43"
"@calcit/procs": "^0.8.44"
},
"scripts": {
"test": "cr --once --emit-js --init-fn=respo.test.main/main! && node test.mjs"
},
"devDependencies": {
"bottom-tip": "^0.1.5",
"vite": "^5.2.2"
"vite": "^5.2.6"
}
}
22 changes: 11 additions & 11 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2015763

Please sign in to comment.