junkcode  Check-in [b702f3bb19]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Hack around with importing Svelte into CLJS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:b702f3bb19dbcf74b29e547e1e0870918ab0e56f3fe67f21aca19800e0f359e7
User & Date: jaccarmac 2019-04-24 15:06:12
Context
2019-05-12
03:51
Update deps. check-in: e97715fafb user: jaccarmac tags: trunk
2019-04-24
15:06
Hack around with importing Svelte into CLJS. check-in: b702f3bb19 user: jaccarmac tags: trunk
14:24
Move Svelte sources into subdir. check-in: dd2a5a6c8c user: jaccarmac tags: trunk
Changes

Changes to svelte-cljs/public/index.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!doctype html>
<html>
<head>
	<meta charset='utf8'>
	<meta name='viewport' content='width=device-width'>

	<title>Svelte app</title>

	<link rel='stylesheet' href='global.css'>
	<link rel='stylesheet' href='bundle.css'>
</head>

<body>
	<script src='bundle.js'></script>
</body>
</html>






|






|

|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!doctype html>
<html>
<head>
	<meta charset='utf8'>
	<meta name='viewport' content='width=device-width'>

	<title>CLJS/Svelte app</title>

	<link rel='stylesheet' href='global.css'>
	<link rel='stylesheet' href='bundle.css'>
</head>

<body>
	<script src='js/main.js'></script>
</body>
</html>

Changes to svelte-cljs/shadow-cljs.edn.

1
2
3
4
5
6

{:source-paths ["src/cljs"]
 :dependencies []
 :builds {:app {:target :browser
                :output-dir "public/js"
                :asset-path "/js"
                :modules {:main {:init-fn app.main/main!}}}}}





<
|
>
1
2
3
4

5
6
{:source-paths ["src/cljs"]
 :dependencies []
 :builds {:app {:target :browser
                :output-dir "public/js"

                :modules {:main {:init-fn app.main/main!}}}}
 :dev-http {8080 "public"}}

Changes to svelte-cljs/src/cljs/app/main.cljs.

1







(ns app.main)







|
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
(ns app.main
  #_(:require ["/App" :default App])
  (:require ["svelte/compiler" :as svelte]))

#_(new App {:target js/document.body})

(defn main! []
  (.log js/console (.-VERSION svelte)))

Changes to svelte-cljs/src/svelte/main.js.