Skip to content

Commit a1b7e5e

Browse files
authored
Update installation.md
1 parent ebc1fac commit a1b7e5e

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

docs/installation/installation.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rails new MyApp -T
2727

2828
which will create a new directory called `MyApp`. *Be sure to cd into the new directory when done.*
2929

30-
> The -T option prevents Rails from installing the minitest directories. Hyperstack uses the alternate rspec test framework for testing.
30+
> The -T option prevents Rails from installing the minitest directories. Hyperstack uses the alternate rspec test framework for testing. If you are installing in an existing Rails app and already using mini-test that's okay.
3131
3232
## Adding the Hyperstack gem
3333

@@ -71,16 +71,18 @@ At this point you're fully installed.
7171

7272
> **Note the first time you run you app it will take 1-2 minutes to compile all the system libraries.**
7373
74-
If you installed into a new rails app, you can run bundle exec foreman start
75-
to start the server, and **App** will display on the top left hand side of the page. You will find the `App` component in the `app/hyperstack/components/app.rb` file. If you edit this file and save you should see the changes reflected in the browser.
74+
If you installed into a new rails app, you can run
7675

77-
If you installed into an existing Rails apps, you can run bundle exec foreman start
78-
to start the server, and your app should function exactly as it always has. From here, you'll need to start adding components and
79-
and mounting them from either a view or a controller. See [How to add components](#adding-a-single-component-to-your-application) and [mount them](#mounting-components) for details.
76+
`bundle exec foreman start`
77+
78+
to start the server, and **App** will display on the top left hand side of the page. You will find the `App` component in the `app/hyperstack/components/app.rb` file. If you edit this file and save it you will see the changes reflected immediately in the browser.
79+
80+
If you installed into an existing Rails app, your app should function exactly as it always has. You can also use `bundle exec foreman start` to start the server and the hotloader. From here, you'll need to start adding components and
81+
and using them from either a view or a controller. See [How to add components](#adding-a-single-component-to-your-application) and [mount them](#mounting-components) for details.
8082

8183
## Summary of Installers and Generators
8284

83-
The following sections details the installers and generators you can use for for full control of the installation process. Details are also given on exactly what each installer and generator does if you want to manually apply the step or modify it to your needs.
85+
The following sections details the installers and generators you can use for full control of the installation process. Details are also given on exactly what each installer and generator does if you want to manually apply the step or modify it to your needs.
8486

8587
```
8688
bundle exec ... # for best results always use bundle exec!
@@ -92,11 +94,11 @@ rails hyperstack:install:skip-hyper-model # all but hyper-model
9294
rails hyperstack:install:hotloader # just add the hotloader
9395
rails hyperstack:install:skip-hotloader # skip the hotloader
9496
95-
# rails g is short for rails generate
96-
9797
rails g hyper:component CompName # adds a component named CompName
9898
rails g hyper:router CompName # adds a router component
9999
100+
# Note: rails g ... is short for rails generate
101+
100102
# Both generators can take a list of components. Component names can be
101103
# any legal Ruby class name. For example Module1::ComponentA will work.
102104
@@ -112,18 +114,18 @@ rails g hyper:router CompName # adds a router component
112114
# HyperComponent as the base class
113115
# --no-help # don't add helper comments
114116
115-
# Note --add-route switch will not work if multiple components are generated.
117+
# Note: the --add-route switch will not work if multiple components are generated.
116118
117-
# Note you can override the component base class for the entire application
119+
# Note: you can override the component base class for the entire application
118120
# by setting the Hyperstack `component_base_class` config option. See config options in the
119121
# last section.
120122
121-
# Note that hyperstack:install is the same as running:
123+
# Note: that hyperstack:install is the same as running:
122124
123125
rails g hyper:component App --add-route
124126
rails hyperstack:install:webpack
125127
rails hyperstack:install:hyper-model
126-
rails hyperstack:install:hotloader-only
128+
rails hyperstack:install:hotloader
127129
```
128130

129131
## The `app/hyperstack` Directory
@@ -136,16 +138,17 @@ The following subdirectories are standard:
136138
app/
137139
...
138140
hyperstack/
139-
components/
140-
models/
141-
operations/
142-
stores/
143-
shared/
144-
lib/
141+
components/ <- runs on client/prerendering
142+
models/ <- isomorphic
143+
operations/ <- isomorphic
144+
stores/ <- runs on client/prerendering
145+
shared/ <- isomorphic
146+
lib/ <- runs on client/prerendering
147+
<- others are client/prerendering
145148
```
146149

147150
The `models`, `operations`, and `shared` directories are *isomorphic*. That is the code will
148-
be run on both the Rails server and on the client. All other directories (regardless of the name)
151+
be run on both the Rails server, on the client and during prerendering. All other directories (regardless of the name)
149152
will only be visible on the client and during prerendering.
150153

151154
These directories will be created as required by the installers and generators, or you can create them yourself as needed.
@@ -193,7 +196,7 @@ bundle exec rails g hyper:component Test --base-class=ApplicationComponent
193196

194197
Components render (or *mount*) other components in a tree-like fashion. You can mount the top level component of the tree in three different ways:
195198
+ Render it from a controller using the `render_component` method
196-
+ Mount it from within a view using the `react_component` view helper
199+
+ Mount it from within a view using the `mount_component` view helper
197200
+ Route to it from the Rails router
198201

199202
#### Rendering from a Controller Action
@@ -324,12 +327,12 @@ want to try webpacker - use the `hyperstack:install:webpack` task:
324327
bundle exec rails hyperstack:install:webpack
325328
```
326329
This will do the following:
327-
+ Insure yarn is installed
330+
+ Insure node and yarn are installed
328331
+ Install the Webpacker gem
329332
+ Add the Hyperstack Webpacker manifests
330333
+ Manage the Hyperstack dependencies with yarn
331334

332-
These steps are explained in detailed below.
335+
You can manually perform the above steps following the instructions below.
333336

334337
#### Yarn and Node
335338

@@ -342,9 +345,9 @@ Node can be installed following these instructions: [Node Install Instructions](
342345
#### The Webpacker Gem
343346

344347
The Webpacker Gem uses a node package called Webpack to manage NPM assets instead of sprockets. So once you have webpacker installed you will want to bring in any javascript
345-
libraries using Yarn, and let webpacker manage them instead of the including them as wrapped Ruby gems, or as files in the rails assets directory.
348+
libraries using Yarn, and let webpacker manage them instead of including them as wrapped Ruby gems or as files in the rails assets directory.
346349

347-
To install webpacker manually add the `webpacker` gem to you gem file and run `bundle install` or simply run
350+
To install webpacker manually add the `webpacker` gem to your gem file and run `bundle install` or simply run
348351
```
349352
bundle add webpacker
350353
```
@@ -491,7 +494,7 @@ As your application develops you can begin defining more restrictive policies (o
491494
> Note: The policy mechanism does not depend on [Pundit](https://github.com/varvet/pundit) but is compatible with it. You can add pundit style
492495
policies for legacy parts of your system.
493496
>
494-
> For details on creating policies see the [policy documentation](https://github.com/hyperstack-org/hyperstack/blob/edge/docs/dsl-isomorphic/hyper-policy.md).
497+
> For details on creating policies see the [policy documentation](https://hyperstack.org/edge/docs/dsl-isomorphic/policies).
495498
496499
#### Moving the `application_record.rb` File.
497500

0 commit comments

Comments
 (0)