Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flesh out the Getting Started instructions in the README #564

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,42 @@ Reagent provides a way to write efficient React components using (almost) nothin
* [purelyfunctional.tv ](https://purelyfunctional.tv/guide/reagent/)
* [Lambda Island Videos](https://lambdaisland.com/collections/react-reagent-re-frame)

### Usage
## Getting Started

To create a new Reagent project using [Leiningen](http://leiningen.org/) template simply run:
__Pre-requisite:__ Install [Leiningen](http://leiningen.org/) if you haven't already

To create a new Reagent project, run:

lein new reagent myproject

<details>
<summary>Don't need a Clojure backend?</summary>

If you wish to only create the assets for ClojureScript without a Clojure backend then do the following instead:

lein new reagent-frontend myproject

This will setup a new Reagent project with some reasonable defaults, see here for more [details](https://github.com/reagent-project/reagent-template).
</details>

This will setup a new Reagent project with some reasonable defaults. See the [reagent-template project](https://github.com/reagent-project/reagent-template) for the different options you can configure.

To run the project for the first time:

```
cd myproject
npm install
npx shadow-cljs watch app
```

Now open your web browser to: http://localhost:3000

And you should see:

![screenshot](doc/reagent-screenshot.png)

Congratulations! You are now ready to start hacking. See the [Examples](#examples) below for an introduction.

### In An Existing Project

To use Reagent in an existing project you add this to your dependencies in `project.clj`:

Expand Down Expand Up @@ -163,7 +188,7 @@ But you can still use them if you want to, either using `reagent.core/create-cla
(reset! my-html (.-innerHTML (rd/dom-node this))))}))
```

See the examples directory for more examples.
See the [examples](./examples) directory for more examples. See also the [Reagent website](https://reagent-project.github.io/) for a more thorough introduction.


## Performance
Expand Down
Binary file added doc/reagent-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.