Giter VIP home page Giter VIP logo

re-find.web's Introduction

re-find.web

CircleCI

Web interface to re-find hosted here.

Development

To get an interactive development environment run:

clojure -A:fig:dev

or with local checkouts of re-find and speculative:

clojure -A:fig:local-deps:dev

This will auto compile and send all changes to the browser without the need to reload. After the compilation process is complete, you will get a Browser Connected REPL. An easy way to try it is:

(js/alert "Am I connected?")

and you should see an alert in the browser window.

To clean all compiled files:

rm -rf target/public

To co-develop integration tests while developing:

PORT=9500 clojure -A:test:cider-nrepl

The cider-nrepl alias is coming from my ~/.clojure/deps.edn:

:cider-nrepl {:extra-deps {nrepl/nrepl {:mvn/version "0.4.5"}
                           refactor-nrepl {:mvn/version "2.4.0"}
                           cider/cider-nrepl {:mvn/version "0.18.0"}}
              :main-opts ["-m" "nrepl.cmdline" "--middleware"
                          "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]"]}

Tests

Build a production version of re-find.web:

script/build

This will write some files to the dist directory.

If you haven't, install the drivers to automate your browsers (currently only Chrome is used in the tests, probably more to come).

Now start the browser tests:

SERVE=dist PORT=8000 clojure -A:test

Release

Static files including compiled JS are hosted on Github. This is set up like described here:

All the commands below assume that you already have a git project initialized and that you are in its root folder.

# Create an orphan branch named gh-pages
git checkout --orphan gh-pages
# Remove all files from staging
git rm -rf .
# Create an empty commit so that you will be able to push on the branch next
git commit --allow-empty -m "Init empty branch"
# Push the branch
git push origin gh-pages

Now that the branch is created and pushed to origin, let’s configure the worktree correctly:

# Come back to master
git checkout master
# Add dist to .gitignore
echo "dist/" >> .gitignore
git worktree add dist gh-pages

That’s it, you can now build your app as usual with npm run build . If you cd to the dist folder, you will notice that you are now in the gh-pages branch and if you go back to the root folder, you will go back to master .

To deploy to Github Pages:

cd dist
git add .
git commit -m "update build"
git push

License

Copyright © 2018 Michiel Borkent

Distributed under the EPL License, same as Clojure. See LICENSE.

re-find.web's People

Contributors

borkdude avatar akeboshiwind avatar

Stargazers

Vladislav Botvin avatar Roger Lam avatar Dainius Jocas avatar Avi Drucker avatar Rangel Spasov avatar Adam Thalhammer avatar Vincent Cantin avatar  avatar Dominik Engelhardt avatar Martin Mariano avatar Michael Salihi avatar Sameer Kolhar avatar 洪盟翔 avatar Denis Yermakov avatar Jeremie Pelletier avatar Bobbi Towers avatar Narendra Joshi avatar Aleksei Sotnikov avatar Julien Rousé avatar Dima avatar Andrea Crotti avatar  avatar Brian Scaturro avatar Henrik Kjerringvåg avatar

Watchers

 avatar James Cloos avatar Roger Lam avatar  avatar

re-find.web's Issues

Prettify URLS

It might be nice to have a general library which can encode clojure expressions as pretty url query params.
E.g. we could encode parens as ~l and ~r, brackets as ~L and ~R, + as ~p, etc. For (+ 1 2 [3 4 5]) this would yield: ~l~p~_1~_2~_~L4~_5~R~r instead of %28%2B%201%202%20%5B4%205%5D%29 which is only marginally better.

Other mapping to try:

< > => ~< ~>
_ => ~_
space => _
( ) => < >
, => ~,
: => ,

This would yield:

<%2B_1_2%5B3_4_5%5D>

Note: < and > still get url encoded, but some browsers (Chrome and Firefox at least) show them as the literal.

Some ideas in this SO answer: https://stackoverflow.com/a/21976900/6264
http://xahlee.info/js/js_encodeURIComponent.html

Using + instead of %20 already seems to be supported and seems a quick win:
https://stackoverflow.com/a/1211261/6264

Use datafy to render data to prevent infinite loops

Currently infinite collections like (range) in args crash the website. Maybe I could use datafy to prevent this.

(extend-type LazySeq
  p/Datafiable
  (datafy [x] (take 10 x)))

(datafy (map inc (range 100)))

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.