jblomo / cljs-boilerplate Goto Github PK
View Code? Open in Web Editor NEWAn attempt to bring together the best practices of Clojure, ClojureScript, HTML5 Boilerplate, and Google Closure
An attempt to bring together the best practices of Clojure, ClojureScript, HTML5 Boilerplate, and Google Closure
As @scottjad points out, keeping the jars in the source repo is inefficient. Ideally we should use config/project.properties
to set the path of the jars to lib/dev
or even modify build.xml
if needed. This will also require uploading or finding the maven dependencies for the jars in build/tools.
The initializer code, based on the "Garber-Irish implementation" of page init scripts, should be its own project so it can stay general and be useful to other people not using cljs-boilerplate.
Right now, running ant
in build/
is the way to compile and compact the resources needed for the app. Ideally, this would be done with a lein command. I want to avoid rewriting the build script as a lein plugin so that we can keep pace with the H5BP project. Is there a way to call ant build steps from lein?
To support production mode, the .soy templates need to be updated to refer to the compressed assets, which typically are named by the sha1 of their contents at build time. The relevant build sections are around the replaceregexp elements.
While running the default ant build, I get these strange FNFE:
.../> lein deps
...
.../build> ant
...
-htmlclean:
[echo] Run htmlcompressor on the HTML
[echo] - maintaining whitespace
[echo] - removing html comments
[echo] - compressing inline style/script tag contents
[apply] java.io.FileNotFoundException: /Users/danieljomphe/dev/cljs-boilerplate/resources/public/../resources/public/404.html (No such file or directory)
[apply] at java.io.FileOutputStream.open(Native Method)
[apply] at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
[apply] at java.io.FileOutputStream.<init>(FileOutputStream.java:84)
[apply] at com.googlecode.htmlcompressor.CmdLineCompressor.main(CmdLineCompressor.java:346)
[apply] Result: 1
[apply] java.io.FileNotFoundException: /Users/danieljomphe/dev/cljs-boilerplate/resources/public/../resources/public/index.html (No such file or directory)
[apply] at java.io.FileOutputStream.open(Native Method)
[apply] at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
[apply] at java.io.FileOutputStream.<init>(FileOutputStream.java:84)
[apply] at com.googlecode.htmlcompressor.CmdLineCompressor.main(CmdLineCompressor.java:346)
[apply] Result: 1
[apply] java.io.FileNotFoundException: /Users/danieljomphe/dev/cljs-boilerplate/resources/public/../resources/public/soy/cljs_boilerplate/core.soy (No such file or directory)
[apply] at java.io.FileOutputStream.open(Native Method)
[apply] at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
[apply] at java.io.FileOutputStream.<init>(FileOutputStream.java:84)
[apply] at com.googlecode.htmlcompressor.CmdLineCompressor.main(CmdLineCompressor.java:346)
[apply] Result: 1
...
Moreover, when I open the index.html
file, it displays as a blank page, although it's got some html source code in it.
When using a tomcat adapter, the ring.util.route/not-found handler appears to send the 404.html file without the right MIME or Content-Type, so it just shows up as plain text. Write a new route or figure out how one is supposed to use not-found with files.
There are probably many instances in which you'd like to share settings between server side and client side code. Right now settings.clj
and settings/custom.clj
are only used by server side clojure. All settings should probably not be shared: you don't want to ship your database settings to the client side.
One way to do this might be to use the Closure compiler's @define / --define semantics.
In dev mode, we'd like to compile and serve clojurescript inline, that means the rest stack needs to be moved to 1.3.
Right now build/build.xml
uses tools.cljsc to build the advanced optimized clojurescript. tools.cljsc points to ../clojurescript/bin/cljsc
by default, ie a side build of clojurescript. It should point to a script inside the repository that uses lib/
for its jar dependencies on clojurescript.
One way to do this is to make a lein plugin for compiling clojurescript. Another would be to simply copy the bin/cljsc
script into the repository, and modify it to use the lib/
jar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.