Skip to content

Commit

Permalink
Merge pull request #65 from Respo/defcomp
Browse files Browse the repository at this point in the history
fix defcomp mark on component root
  • Loading branch information
NoEgAm authored Mar 22, 2024
2 parents feaad95 + 3a61495 commit 48b2d9a
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 242 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/setup-cr@0.0.3
with:
version: '0.8.41'
version: '0.8.43'

- name: "load deps"
run: caps --ci && yarn
Expand Down
114 changes: 62 additions & 52 deletions calcit.cirru

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

22 changes: 12 additions & 10 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.7)
:configs $ {} (:init-fn |respo.main/main!) (:reload-fn |respo.main/reload!) (:version |0.16.8)
:modules $ [] |memof/ |lilac/ |calcit-test/
:entries $ {}
:files $ {}
Expand Down Expand Up @@ -52,7 +52,7 @@
comp-inspect |Task task $ {} (:left 200)
button $ {} (:class-name style-done)
:style $ {}
"\"background-color" $ if (:done? task) (hsl 200 20 80) (hsl 200 80 70)
:background-color $ if (:done? task) (hsl 200 20 80) (hsl 200 80 70)
:on-click $ fn (e d!)
d! $ : toggle (:id task)
=< 8 nil
Expand Down Expand Up @@ -89,7 +89,7 @@
|style-done $ %{} :CodeEntry (:doc |)
:code $ quote
defstyle style-done $ {}
:& $ {} (:width 32) (:height 32) (:outline :none) (:border :none) (:vertical-align :middle)
:& $ {} (:width 32) (:height 32) (:outline :none) (:border :none) (:vertical-align :middle) (:cursor :pointer)
|style-task $ %{} :CodeEntry (:doc |)
:code $ quote
defstyle style-task $ {}
Expand Down Expand Up @@ -685,10 +685,15 @@
assert "\"expected list for params" $ list? params
assert "\"some component retured" $ &> (count body) 0
quasiquote $ defn ~comp-name (~ params)
extract-effects-list $ %{} schema/Component
:effects $ []
:name $ ~ (turn-tag comp-name)
:tree $ do (~@ body)
->
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
|defeffect $ %{} :CodeEntry (:doc |)
:code $ quote
defmacro defeffect (effect-name args params & body)
Expand Down Expand Up @@ -1237,7 +1242,6 @@
make-element (&record:get virtual-element :tree) listener-builder $ conj coord (&record:get virtual-element :name)
let
tag-name $ turn-string (&record:get virtual-element :name)
comp-mark $ last coord
attrs $ &record:get virtual-element :attrs
style $ &record:get virtual-element :style
children $ &record:get virtual-element :children
Expand All @@ -1250,8 +1254,6 @@
when (nil? k) (js/console.warn "\"nil key is bad for Respo")
when (some? child)
make-element child listener-builder $ conj coord k
if (tag? comp-mark)
aset (.-dataset element) "\"defcomp" $ turn-string comp-mark
&doseq (entry attrs)
let
prop-str $ turn-string (first entry)
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.7",
"version": "0.16.8",
"dependencies": {
"@calcit/procs": "^0.8.41"
"@calcit/procs": "^0.8.43"
},
"scripts": {
"test": "cr --once --emit-js --init-fn=respo.test.main/main! && node test.mjs"
},
"devDependencies": {
"bottom-tip": "^0.1.5",
"vite": "^5.1.6"
"vite": "^5.2.2"
}
}
Loading

0 comments on commit 48b2d9a

Please sign in to comment.