Skip to content

Commit 19b8ace

Browse files
author
ChenYong
committed
add defer; fix validation; alpha release
1 parent 638307c commit 19b8ace

File tree

4 files changed

+86
-21
lines changed

4 files changed

+86
-21
lines changed

calcit.cirru

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@
5656
|v $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758609827)
5757
:data $ {}
5858
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758610098) (:text |[]) (:id |P13hLmeFJ4)
59+
|yr $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794995092) (:text |boolean+) (:id |vxpsg6y3yH)
60+
|yT $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758811999) (:text |or+) (:id |p-m2wdLPsp)
5961
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758611787) (:text |dev-check) (:id |G-NLhNqFKE)
60-
|r $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758633805) (:text |record+) (:id |ZttyBa6g_n)
61-
|v $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758635682) (:text |string+) (:id |hGHy5h7wv)
6262
|x $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758647627) (:text |vector+) (:id |qLauNV7n3)
63-
|y $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758690845) (:text |optional+) (:id |XqH_w2OUad)
64-
|yT $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758811999) (:text |or+) (:id |p-m2wdLPsp)
63+
|v $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758635682) (:text |string+) (:id |hGHy5h7wv)
6564
|yj $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758847119) (:text |keyword+) (:id |yC2Bhu0jt-)
65+
|r $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758633805) (:text |record+) (:id |ZttyBa6g_n)
66+
|y $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758690845) (:text |optional+) (:id |XqH_w2OUad)
6667
:id |lVeDoVeDxK
6768
:id |0Datg9luSo
6869
:defs $ {}
@@ -361,6 +362,21 @@
361362
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592743069148) (:text |:type) (:id |8V3_HjnUHM)
362363
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592743077144) (:text "|\"module") (:id |UOodW0-ZCY)
363364
:id |NKBPhjntGQ
365+
|r $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794680158)
366+
:data $ {}
367+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794693343) (:text |:defer) (:id |9o1LNSPRVleaf)
368+
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794687990)
369+
:data $ {}
370+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794688987) (:text |if) (:id |Ckv3ViFg9)
371+
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794689312)
372+
:data $ {}
373+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794690679) (:text |:defer?) (:id |IR7ambHY_)
374+
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794700364) (:text |path) (:id |TNS5Fvwis)
375+
:id |Qu4byjf2Wl
376+
|r $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794702008) (:text |true) (:id |otu8SeaTp1)
377+
|v $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794792095) (:text |false) (:id |Cfw1mGHZm)
378+
:id |jQUrPhGUC
379+
:id |9o1LNSPRV
364380
:id |pvdfGLuY2N
365381
:id |PxkeGboM6m
366382
|L $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592739595629)
@@ -400,6 +416,21 @@
400416
|D $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592739617192) (:text |:src) (:id |E9jfEHQ7Pt)
401417
:id |pQO0NouE7Q
402418
:id |UIQaFSpRN4
419+
|r $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794709133)
420+
:data $ {}
421+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794709133) (:text |:defer) (:id |3dzAu-CqT8)
422+
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794709133)
423+
:data $ {}
424+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794709133) (:text |if) (:id |TEHrsPoZ-T)
425+
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794709133)
426+
:data $ {}
427+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794709133) (:text |:defer?) (:id |wYl7mba09U)
428+
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794709133) (:text |path) (:id |l0KZXrrkT9)
429+
:id |hmz3IjOhms
430+
|r $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794709133) (:text |true) (:id |C8hd1YQ--0)
431+
|v $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794709133) (:text |false) (:id |QXDksF3HL0)
432+
:id |nSHRj0apHK
433+
:id |fLPUW-z_rV
403434
:id |pvdfGLuY2N
404435
:id |PxkeGboM6m
405436
|L $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592739595629)
@@ -664,7 +695,24 @@
664695
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758838763) (:text |string+) (:id |8XRWSWEMqB)
665696
:id |bUuNAGL83A
666697
:id |NII_VnhEF
698+
|v $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758834516)
699+
:data $ {}
700+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794987933) (:text |:defer?) (:id |NII_VnhEFleaf)
701+
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758837688)
702+
:data $ {}
703+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794985146) (:text |boolean+) (:id |8XRWSWEMqB)
704+
:id |bUuNAGL83A
705+
:id |Q4Piqg0hi
667706
:id |g-bv-a6rL7
707+
|r $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794966735)
708+
:data $ {}
709+
|T $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794890323)
710+
:data $ {}
711+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794890323) (:text |:exact-keys?) (:id |rEdajZlIrn)
712+
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794890323) (:text |true) (:id |g0DQkwYFf3)
713+
:id |tDflazWTeR
714+
|D $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794967209) (:text |{}) (:id |MBjG50JQdA)
715+
:id |4bCjvVnCYz
668716
:id |XT8OCQamIc
669717
:id |NgBU_f1W07
670718
|D $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758817053) (:text |or+) (:id |YsAZ4WykNx)
@@ -695,18 +743,14 @@
695743
|v $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758666091)
696744
:data $ {}
697745
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758683858) (:text |:ssr) (:id |2-od6jvugZ)
698-
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758685063)
746+
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758675729)
699747
:data $ {}
700-
|T $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758675729)
701-
:data $ {}
702-
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758676831) (:text |string+) (:id |DBQbfxVguO)
703-
:id |xoPHkEW28y
704-
|D $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758687947) (:text |optional+) (:id |poaUX4Mt_n)
705-
:id |FX9a6e7n7
748+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758676831) (:text |string+) (:id |DBQbfxVguO)
749+
:id |xoPHkEW28y
706750
:id |gv-g9KsDPg
707751
|yj $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758666091)
708752
:data $ {}
709-
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758730471) (:text |:inner-html) (:id |2-od6jvugZ)
753+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794937325) (:text |:inline-html) (:id |2-od6jvugZ)
710754
|j $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592758745553)
711755
:data $ {}
712756
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758745553) (:text |string+) (:id |mPvY6c6wYW)
@@ -749,6 +793,11 @@
749793
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758768969) (:text |:all-optional?) (:id |dmt45nHL8H)
750794
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592758769559) (:text |true) (:id |yh0I0biy_)
751795
:id |8J721FxYb3
796+
|r $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794879407)
797+
:data $ {}
798+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794884961) (:text |:exact-keys?) (:id |gkD8WPqiQleaf)
799+
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794885774) (:text |true) (:id |gBirnnhzd)
800+
:id |gkD8WPqiQ
752801
:id |ZJUqzvvSi
753802
:id |S5IaGUFMwF
754803
:id |sNB_I3lh7P
@@ -840,6 +889,11 @@
840889
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592740112279) (:text |:src) (:id |JUgNAE2XMeleaf)
841890
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592740116453) (:text "|\"main.js") (:id |KCDGrUcwJj)
842891
:id |JUgNAE2XMe
892+
|v $ {} (:type :expr) (:by |UI0sFmATo) (:at 1592794734803)
893+
:data $ {}
894+
|T $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794737943) (:text |:defer?) (:id |70rAbeuAXwleaf)
895+
|j $ {} (:type :leaf) (:by |UI0sFmATo) (:at 1592794787775) (:text |false) (:id |g7W96Z1HN)
896+
:id |70rAbeuAXw
843897
:id |IAm-LZvgZg
844898
|xT $ {} (:type :expr) (:id |HyeOnfvJ1M) (:by |root) (:at 1510073008262)
845899
:data $ {}

release.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{:version "0.1.12",
1+
{:version "0.1.13-a1",
22
:group-id "mvc-works",
33
:artifact-id "shell-page",
44
:skip-tag true,

src/shell_page/core.cljs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
:refer
55
[html <> head title script style meta' div link body style list->])
66
[respo.render.html :refer [make-string]]
7-
[lilac.core :refer [dev-check record+ string+ vector+ optional+ or+ keyword+]]
7+
[lilac.core
8+
:refer
9+
[dev-check record+ string+ vector+ optional+ or+ keyword+ boolean+]]
810
["fs" :as fs]))
911

1012
(defn get-indexed [xs]
@@ -14,14 +16,19 @@
1416
(record+
1517
{:title (string+),
1618
:icon (string+),
17-
:ssr (optional+ (string+)),
19+
:ssr (string+),
1820
:styles (vector+ (string+)),
1921
:inline-styles (vector+ (string+)),
20-
:scripts (vector+ (or+ [(string+) (record+ {:type (keyword+), :src (string+)})])),
21-
:inner-html (string+),
22+
:scripts (vector+
23+
(or+
24+
[(string+)
25+
(record+
26+
{:type (keyword+), :src (string+), :defer? (boolean+)}
27+
{:exact-keys? true})])),
28+
:inline-html (string+),
2229
:append-html (string+),
2330
:manifest (string+)}
24-
{:all-optional? true}))
31+
{:all-optional? true, :exact-keys? true}))
2532

2633
(defn make-page [html-content resources]
2734
(assert (string? html-content) "1st argument should be string")
@@ -53,8 +60,12 @@
5360
(cond
5461
(string? path) (script {:src path})
5562
(and (map? path) (= :module (:type path)))
56-
(script {:type "module", :src (:src path)})
57-
(and (map? path) (= :script (:type path))) (script {:src (:src path)})
63+
(script
64+
{:type "module",
65+
:src (:src path),
66+
:defer (if (:defer? path) true false)})
67+
(and (map? path) (= :script (:type path)))
68+
(script {:src (:src path), :defer (if (:defer? path) true false)})
5869
:else (println "[Shell Page]: unknown path" path))))))))
5970
(body
6071
{}

src/shell_page/main.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
:ssr "respo-ssr",
1212
:styles ["/main.css"],
1313
:inline-styles [".app{color:#aaa;}"],
14-
:scripts ["/main.js" {:type :module, :src "main.js"}],
14+
:scripts ["/main.js" {:type :module, :src "main.js", :defer? false}],
1515
:inline-html "<script>console.log('nothing')</script>",
1616
:append-html "<script>console.log('appended');</script>",
1717
:manifest "manifest.json"})))

0 commit comments

Comments
 (0)