Git Product home page Git Product logo

replique-pedestal's Introduction

Replique-pedestal

This an example project for using replique with pedestal.

  • Clone the project
  • Start a REPL (M-x replique/repl ) in the directory where the project was cloned
  • Load the replique-pedestal.core namespace. From the replique-pedestal.core namespace, start the server (http/start server). The server is started on port 8080.
  • Turn the REPL into a cljs REPL: M-x replique/cljs-repl
  • Open a browser tab at localhost:8080
  • Notice that the HTML markup references a main.js file. The main.js file already exists in the directory resources/public/. resources/public/ is the assets folder of the web server started by pedestal.
  • At this point, the cljs REPL should be fully functional. The browser has successfully connected to it.
  • Open the browser web console. You should see that the browser is complaining that it cannot load the replique-pedestal.front namespace. The reason is that main.js tries to load the replique-pedestal.front namespace, but this namespace has not yet been compiled. Let's fix it.
  • Open the front.cljs file and load it: M-x replique/load-file. The replique-pedestal.front has been loaded in the browser and compiled to disk.
  • Reload the browser page, notice how the replique-pedestal.front namespace is executed again.

The main.js file was already there when you cloned the repository. Let's see how this file was generated.

  • Quit the cljs REPL: :cljs/quit
  • From the replique-pedestal.core namespace, change the script included in the index page to be: <script src=\"/main2.js\"></script>. Reload the namespace: M-x replique/load-file
  • Turn the REPL into a cljs REPL: M-x replique/cljs-repl
  • Reload the browser page. Notice that the browser complains that the main2.js cannot be found
  • Try to type something in the cljs REPL. Nothing happens because the REPL is waiting for a browser to connect. Let's fix it.
  • Execute the following command: M-x replique/output-main-js-file. Enter the following path on the first prompt: resources/public/main2.js. Enter the following namespace on the second prompt: replique-pedestal.front.
  • Reload the browser page ... it works !

replique-pedestal's People

Contributors

eweng 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.