Git Product home page Git Product logo

tools-deps-poc's Introduction

Run in dev mode

clj -A:revolt:dev:nrepl:cljs:slf4j -p watch,nrepl-piggyback,figwheel,rebel -t clean,sass,test

or

bin/dev

Uberjar

clj -A:revolt:pack:cljs:slf4j: -t clean,info,sass,cljs:compiler.optimizations=advanced,capsule
java -jar dist/app.jar

or

bin/prod

graalvm native-image

  -A:native-image --graalvm-home ~/opt/graalvm

Run shadow-cljs and revolt together

NOTE: checkout shadow-cljs branch.

Resolving require by shadow-cljs is fundamentally different. It looks for js index.js files in the same name named node_modules subdir. So (:require [react]) will resolve to node_modules/react/index.js. for a subdir in the npm module dir you will have to quote the namespace, so: (:require ["material-ui/styles"]). Since it tries to resolve symbol namespaces (not just string namespaces) to the node_modules dir this makes it incompatible with regular (closure) resolution and compilation, using foreign-libs. Which is the real showstopper because shadow-cljs does not honour the compiler :foreign-libs opt. So it's not possible to keep both open and postpone the choice. And see which tool works better, native and figwheel or shadow-cljs.

Since shadow-cljs might not live beyond a few years this would make all code incompatible in the long run, unless the shadow-cljs resolution method gets officially adopted. You'd have to add all foreign libs again. Including externs. Native tooling by cognitect is getting better and better, which will make shadow-cljs obsolete, but you might end up stuck with uncompilable code. Otoh using normal compilation I had no trouble adding material-ui and react. Another thing, I get, even in the simplest app stack overflow errors on reload :-(. You would have to debug another tool to fix this.

This will run the backend server and compile scss:

clj -A:revolt:nrepl:dev:slf4j -p watch,rebel -t sass

The app's backend serves at http://localhost:333/index.html

This will compile cljs:

shadow-cljs watch main

And shadow-cljs also serves the app at http://localhost:9001 with a bare ring server.

cljs repl

Connect to the nrepl server from the editor. Then (user/cljs-repl) in when using revolt only. If also using shadow-cljs then https://shadow-cljs.github.io/docs/UsersGuide.html#_connect_the_javascript_environment

webpack

See entries under :revolt.task/cljs.foreign-libs in revolt.edn, webpack.config.js and src/js/index.js.

npm install
npx webpack

TODO

  • Using a (private?) git repo seems to not go down well with capsule task ;; ERROR | Error while creating a jar file: Some of dependecies have no :mvn/version assigned! ;;Perhaps it's needs a deps.edn?

  • Exclude weasel from js prod build somehow

tools-deps-poc's People

Contributors

michieljoris avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.