Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f72c1c163a | ||
|
|
93cb7874bf | ||
|
|
c449f55a9b | ||
|
|
a9b58a3c82 | ||
|
|
5b3a3acb54 | ||
|
|
4ec8026b51 |
15 changed files with 68 additions and 47 deletions
|
|
@ -9,6 +9,9 @@
|
|||
<!-- - Create Github release with updated links from `doc/links.md` -->
|
||||
<!-- - `bb gh-pages` -->
|
||||
|
||||
- [#114](https://github.com/babashka/scittle/issues/114): Enable source maps ([@jeroenvandijk](https://github.com/jeroenvandijk))
|
||||
- [#140](https://github.com/babashka/scittle/issues/140): Enable customizing the nrepl websocket port ([@PEZ](https://github.com/PEZ))
|
||||
|
||||
## v0.7.28 (2025-09-13)
|
||||
|
||||
- [#137](https://github.com/babashka/scittle/issues/137): fix JS interop with reserved JS keyword (incorrectly munged) by bumping SCI
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ release Updates Github pages with new release build.
|
|||
## Credits
|
||||
|
||||
Idea by Arne Brasseur a.k.a [plexus](https://github.com/plexus).
|
||||
Name by Alessandra Sierra (the name occurs first in [this](https://stuartsierra.com/2019/12/21/clojure-start-time-in-2019/) blog post).
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
10
doc/dev.md
10
doc/dev.md
|
|
@ -90,20 +90,20 @@ To create a new NPM release:
|
|||
|
||||
- Prepare version `package.json`, except patch (if anything should change here)
|
||||
- Run `bb npm-publish`: this will compile, bump patch version, create tag and and push to npm and Github
|
||||
- `bb replace-version 0.6.16 0.7.27`
|
||||
- `bb replace-version 0.6.16 0.7.28`
|
||||
- Create Github release with updated links from `doc/links.md`
|
||||
- `bb gh-pages`
|
||||
|
||||
<!-- To upgrade examples: -->
|
||||
|
||||
<!-- ``` -->
|
||||
<!-- rg '0.0.1' --files-with-matches | xargs sed -i '' 's/0.0.7.27.1.0/g' -->
|
||||
<!-- rg '0.0.1' --files-with-matches | xargs sed -i '' 's/0.0.7.28.1.0/g' -->
|
||||
<!-- bb release -->
|
||||
<!-- cd gh-pages -->
|
||||
<!-- git checkout -b v0.7.27 -->
|
||||
<!-- git push --set-upstream origin v0.7.27 -->
|
||||
<!-- git checkout -b v0.7.28 -->
|
||||
<!-- git push --set-upstream origin v0.7.28 -->
|
||||
<!-- git checkout gh-pages -->
|
||||
<!-- cd .. -->
|
||||
<!-- ``` -->
|
||||
|
||||
<!-- Then make a new release on Github with the `v0.7.27` tag. -->
|
||||
<!-- Then make a new release on Github with the `v0.7.28` tag. -->
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Loading JS libraries
|
||||
|
||||
Since `v0.7.27` scittle allows to load libraries from the global enviroment.
|
||||
Since `v0.7.28` scittle allows to load libraries from the global enviroment.
|
||||
This means you can load a library in a `<script>` tag and use it via `:require` in scittle.
|
||||
|
||||
An example:
|
||||
|
|
@ -8,7 +8,7 @@ An example:
|
|||
``` html
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/js-confetti@latest/dist/js-confetti.browser.js"></script>
|
||||
<script type="application/x-scittle">
|
||||
(require '["JSConfetti" :as confetti])
|
||||
|
|
@ -31,7 +31,7 @@ can then load ES modules, attach them to the global object and manually invoke
|
|||
``` html
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js" type="application/javascript"></script>
|
||||
<script>scittle.core.disable_auto_eval()</script>
|
||||
<script type="module">
|
||||
import confetti from "https://esm.sh/canvas-confetti@1.6.0"
|
||||
|
|
|
|||
38
doc/links.md
38
doc/links.md
|
|
@ -1,20 +1,20 @@
|
|||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js-interop.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.cljs-ajax.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.reagent.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.re-frame.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.replicant.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.promesa.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.pprint.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.nrepl.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js-interop.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.cljs-ajax.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.reagent.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.re-frame.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.replicant.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.promesa.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.pprint.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.nrepl.js
|
||||
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.js-interop.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.cljs-ajax.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.reagent.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.re-frame.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.replicant.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.promesa.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.pprint.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.nrepl.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/dev/scittle.cljs-devtools.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.js-interop.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.cljs-ajax.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.reagent.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.re-frame.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.replicant.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.promesa.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.pprint.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.nrepl.js
|
||||
https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/dev/scittle.cljs-devtools.js
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ the normal routine:
|
|||
|
||||
``` html
|
||||
<script>var SCITTLE_NREPL_WEBSOCKET_PORT = 1340;</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.nrepl.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.nrepl.js" type="application/javascript"></script>
|
||||
```
|
||||
|
||||
Also include the CLJS file that you want to evaluate with nREPL:
|
||||
|
|
@ -42,6 +42,16 @@ you should be able evaluate expressions in `playground.cljs`. See a demo
|
|||
Note that the nREPL server connection stays alive even after the browser window
|
||||
refreshes.
|
||||
|
||||
### Custom host address
|
||||
|
||||
By default, the browser will connect to a websocket on the same host as it is loaded
|
||||
from, using `window.location.hostname`. If you need something else you can specify
|
||||
that setting the window variable `SCITTLE_NREPL_WEBSOCKET_HOST` like so:
|
||||
|
||||
``` html
|
||||
<script>var SCITTLE_NREPL_WEBSOCKET_HOST = 'localhost';</script>
|
||||
```
|
||||
|
||||
### CIDER
|
||||
|
||||
Choose `cider-connect-cljs`, select port `1339`, followed by the `nbb` REPL
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js" type="application/javascript"></script>
|
||||
<script>var SCITTLE_NREPL_WEBSOCKET_PORT = 1340;</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.nrepl.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.nrepl.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle" src="playground.cljs"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<html>
|
||||
<head>
|
||||
<script async src="https://ga.jspm.io/npm:es-module-shims@1.6.1/dist/es-module-shims.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js"></script>
|
||||
<script>scittle.core.disable_auto_eval();</script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"></script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.reagent.js"> </script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.re-frame.js"> </script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.promesa.js"> </script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.reagent.js"> </script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.re-frame.js"> </script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.promesa.js"> </script>
|
||||
|
||||
<script type="importmap">
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.cljs-ajax.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.cljs-ajax.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(require '[ajax.core :refer [GET]])
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(defn my-alert []
|
||||
(js/alert "You clicked!"))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js" type="application/javascript"></script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"></script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.reagent.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.reagent.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(require '[reagent.core :as r]
|
||||
'[reagent.dom :as rdom])
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
|
||||
To embed scittle in your website, it is recommended to use the links
|
||||
published to
|
||||
the <a href="https://github.com/babashka/scittle/releases/tag/v0.7.27">releases
|
||||
the <a href="https://github.com/babashka/scittle/releases/tag/v0.7.28">releases
|
||||
page</a>.
|
||||
|
||||
Include <tt>scittle.js</tt> and write a <tt>script</tt> tag
|
||||
|
|
|
|||
|
|
@ -6,10 +6,13 @@
|
|||
|
||||
:builds
|
||||
{:main
|
||||
{;; for dev build
|
||||
#_#_:compiler-options {:optimizations :simple
|
||||
:pretty-print true
|
||||
:pseudo-names true}
|
||||
{;:compiler-options {:source-map true}
|
||||
;; for dev build
|
||||
#_#_
|
||||
:compiler-options {:optimizations :simple
|
||||
:pretty-print true
|
||||
:pseudo-names true
|
||||
:source-map true}
|
||||
:target :browser
|
||||
:js-options
|
||||
{:resolve {"react" {:target :global
|
||||
|
|
@ -37,4 +40,5 @@
|
|||
:depends-on #{:scittle}}}
|
||||
:build-hooks [(shadow.cljs.build-report/hook)]
|
||||
:output-dir "resources/public/js" ;; + "/dev" for dev build
|
||||
:devtools {:repl-pprint true}}}}
|
||||
:devtools {:repl-pprint true}
|
||||
}}}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
'NaN? (sci/copy-var NaN? cljns)
|
||||
'infinite? (sci/copy-var infinite? cljns)
|
||||
'iteration (sci/copy-var iteration cljns)
|
||||
'abs (sci/copy-var abs cljns)}
|
||||
'abs (sci/copy-var abs cljns)
|
||||
'Cons cljs.core/Cons}
|
||||
'goog.object {'set gobject/set
|
||||
'get gobject/get}
|
||||
'goog.string {'format gstring/format
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
(when-let [ws-port (.-SCITTLE_NREPL_WEBSOCKET_PORT js/window)]
|
||||
(set! (.-ws_nrepl js/window)
|
||||
(new js/WebSocket (ws-url (.-hostname (.-location js/window)) ws-port "_nrepl"))))
|
||||
(new js/WebSocket (ws-url (or (.-SCITTLE_NREPL_WEBSOCKET_HOST js/window)
|
||||
(.-hostname (.-location js/window)))
|
||||
ws-port "_nrepl"))))
|
||||
|
||||
(when-let [ws (nrepl-server/nrepl-websocket)]
|
||||
(set! (.-onmessage ws)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue