TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Developing mobile digital key applications with ClojureScript

101 点作者 swannodette将近 4 年前

6 条评论

swannodette将近 4 年前
Some technical points about Krell. It leverages the ClojureScript `:bundle` target which was released last year <a href="https:&#x2F;&#x2F;clojurescript.org&#x2F;news&#x2F;2020-04-24-bundle-target" rel="nofollow">https:&#x2F;&#x2F;clojurescript.org&#x2F;news&#x2F;2020-04-24-bundle-target</a>. By simply producing output that is JS bundler friendly we can just piggieback on Facebook&#x27;s Metro just like we piggieback on Webpack etc. when targeting the web.<p>We simply reuse the debug loader provided by Google Closure and load ClojureScript and Google Closure JavaScript files through the Metro server. But this is the core of ClojureScript&#x27;s hot-reloading capabilities without caveats. In Google Closure namespaces can be represented as nested JavaScript objects which delivers pervasive late-binding - which simply cannot be done with ES6 modules because imports will be captured (early bound).<p>The REPL bit (which is an independent piece from the hot-reloader) just runs on top of react-native-tcp-socket.<p>The only tricky part is that we need to be able to require Node libraries and assets into ClojureScript during development. This is done by a compiler pass - first we start at the entry point of the ClojureScript React Native project and follow the dep graph collecting all libraries required from `node_modules`. This is dumped to a file that is required transitively by `index.js`.<p>Asset handling is done as a simple compiler pass over every AST node searching for JavaScript `require` statements in the ClojureScript.<p>The end result is that we have an extremely rapid development workflow that simply is not possible with other existing technologies - not React Native, not Flutter, not SwiftUI. All of our apps are built via live-coding from our text editor of choice + REPL (either embedded in IDE or via shell).<p>Happy to answer any further questions!
评论 #27310234 未加载
smokeonline将近 4 年前
It&#x27;s a very good example of a front-end REPL. I used to think hot reloading was good, but to keep the state between reloads is a whole new level.
评论 #27302238 未加载
schmudde将近 4 年前
Krell looks pretty cool. The article talks about using storybook.js, but I&#x27;d love to see it used with clojure.spec. The latter is such a nice way to vet business logic with domain experts.
评论 #27279208 未加载
slifin将近 4 年前
Who should I be sponsoring on Github to help get documentation for Krell with <a href="https:&#x2F;&#x2F;microsoft.github.io&#x2F;react-native-windows&#x2F;" rel="nofollow">https:&#x2F;&#x2F;microsoft.github.io&#x2F;react-native-windows&#x2F;</a> ?
mark_l_watson将近 4 年前
I read this article recently and tried Krell, cool stuff.<p>I just finished writing a Clojure AI book (free PDF download on my web site) and the idea of writing iOS apps in ClojureScript is enticing. Anyone have Apple App Store issues?
评论 #27283269 未加载
dwiamo将近 4 年前
This is great, really interesting