Skip to content

Commit 2413199

Browse files
committed
added wip to all pages as needed
1 parent 57a7163 commit 2413199

File tree

16 files changed

+481
-88
lines changed

16 files changed

+481
-88
lines changed

docs/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Welcome
22

3-
## Hyperstack
4-
53
Hyperstack is a Ruby-based DSL and modern web toolkit for building spectacular, interactive web applications fast!
64

75
* **One language** throughout the client and server. All Ruby code is compiled by [Opal](https://opalrb.com/) into JavaScript automatically.
@@ -23,11 +21,14 @@ end
2321

2422
In the code above, if the `good_books` scope changed \(even on the server\), the UI would update automatically. That's the magic of React and Isomorphic Models with bi-directional data at work!
2523

26-
## Website and documentation
24+
## Website and Documentation
25+
26+
<img align="left" width="100" height="100" style="margin-right: 20px" src="https://github.com/hyperstack-org/hyperstack/blob/edge/docs/wip.png?raw=true">
2727

28-
* Website: [hyperstack.org](https://hyperstack.org)
28+
While we have over 1000 specs passing, in 3 different configurations, and several large apps using Hyperstack, documentation is a lagging. If you see this icon it means we are working hard to
29+
get the docs up to the same state as the code.
2930

30-
Our website serves as a Hyperstack example application. All the doc content is loaded dynamically from this repo and converted to HTML on the fly. It uses React Semantic UI and a client-side JavaScript full-text search engine. Its a Rails app hosted on Heroku.
31+
Chapters without the work-in-progress flag, are still draft, and any issues are greatly appreciated, or better yet follow the `Edit on Github` link make your propsed corrections, and submit a pull request.
3132

3233
## Setup and installation
3334

@@ -45,9 +46,9 @@ Hyperstack is supported by a friendly, helpful community, both for users, and co
4546

4647
## Roadmap
4748

48-
Hyperstack is evolving; we are improving it all the time. As much as we love Ruby today, we see ourselves embracing new languages in the future. [Crystal](https://crystal-lang.org/) perhaps? We are also watching [Wasm](https://webassembly.org/) carefully.
49+
We are currently driving towards our 1.0 release. Currently we are at 1.0.alpha1.5 release candidate. There is a list of 163 open issues including some bugs, many requested enhancements. The plan is to triage the issues, and do a weekly release until the issues are closed as deemed not needed for a 1.0 release.
4950

50-
Please see the [ROADMAP](https://github.com/hyperstack-org/hyperstack/blob/edge/ROADMAP.md) for more information.
51+
Please consider contributing by grabbing a "good first issue", or just adding your thoughts, thumbs up, or down on any issues that interest you.
5152

5253
## Contributing
5354

docs/SUMMARY.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,18 @@
2727
* [Further Reading](client-dsl/further-reading.md)
2828
* [HyperState](hyper-state/README.md)
2929
* [HyperRouter](hyper-router/README.md)
30-
* [HyperModel](isomorphic-dsl/README.md)
31-
* [Isomorphic Models](isomorphic-dsl/hyper-model.md)
32-
* [Isomorphic Operations](isomorphic-dsl/hyper-operation.md)
33-
* [Policies](isomorphic-dsl/hyper-policy.md)
34-
* [Internationalization](development-workflow/hyper-i18n.md)
35-
* [Development Workflow](development-workflow/README.md)
30+
* [HyperModel](hyper-model/README.md)
31+
* [Operations](operations/README.md)
32+
* [Policies](policies/README.md)
33+
* [Internationalization](internationalization/README.md)
34+
* [Development Workflow and Procedures](development-workflow/README.md)
3635
* [Debugging](development-workflow/debugging.md)
36+
* [HyperTrace](development-workflow/hyper-trace.md)
3737
* [HyperSpec](development-workflow/hyper-spec/README.md)
3838
* [Installation](development-workflow/hyper-spec/01-installation.md)
3939
* [Tutorial](development-workflow/hyper-spec/02-tutorial.md)
4040
* [Methods and Features](development-workflow/hyper-spec/03-methods-and-features.md)
4141
* [Using with Rack](development-workflow/hyper-spec/04-using-with-rack.md)
42-
* [Tools](development-workflow/tools.md)
4342
* [Deploy To Heroku](development-workflow/deploy-to-heroku.md)
4443
* [Tutorial](tutorial/README.md)
4544
* [TodoMVC Tutorial Part I](tutorial/todo.md)

docs/development-workflow/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# Development Workflow
2-
1+
# Development Tools and Procedures

docs/development-workflow/debugging.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
# Debugging
1+
Debugging any UI code is difficult. Hyperstack's declarative approach, and lack of redundant boilerplate helps a lot. Simply having 1/4 the code base
2+
to deliver the same functionality is going to make things easier.
23

3-
**Work in progress - ALPHA \(docs and code\)**
4+
However all that said, **Debugging UI Code is Difficult.** The UI's main job is to deal with events coming from multiple directions and unpredictable sources, this makes tracking down failures difficult as timing can become an issue.
45

5-
## Debugging tips
6-
7-
Tips, good practice will help you debugging your Hyperstack application.
6+
Here are few tips to go along with the other tools in this section (HyperSpec and HyperTrace) to make your life a bit easier.
87

98
### JavaScript Console
109

11-
At any time during program execution you can breakout into the JavaScript console by simply adding a line of back-ticked JavaScript to your ruby code:
10+
At any time during program execution you can breakout into the JavaScript console by simply adding the debugger keyword to your Ruby code.
1211

13-
`debugger;`
12+
If you have source maps turned on you will then be able to see your ruby code \(and the compiled JavaScript code\) and set browser breakpoints, examine values and continue execution.
1413

15-
If you have source maps turned on you will then be able to see your ruby code \(and the compiled JavaScript code\) and set browser breakpoints, examine values and continue execution. See Opal Source Maps if you are not seeing source maps.
14+
> Important Note: The Opal compiler will not handle the `debugger` keyword at the end of blocks, method definitions, or begin..end statements.
15+
```ruby
16+
def buggy_method
17+
...
18+
debugger # this will break add any expression on the next line to fix
19+
end
20+
```
1621

17-
You can also inspect ruby objects from the JavaScript console.
22+
You can also inspect Ruby objects from the JavaScript console. The mapping between the Javascript and Ruby is fairly easy to follow thanks to the great Opal team.
1823

1924
Here are some tips: [https://dev.mikamai.com/2014/11/19/3-tricks-to-debug-opal-code-from-your-browser/](https://dev.mikamai.com/2014/11/19/3-tricks-to-debug-opal-code-from-your-browser/)
2025

21-
### Puts is your friend
26+
### The `puts` method is your friend
2227

2328
Anywhere in your HyperReact code you can simply puts any\_value which will display the contents of the value in the browser console. This can help you understand React program flow as well as how data changes over time.
2429

@@ -51,3 +56,15 @@ class Thing < Hyperstack::Component
5156
end
5257
```
5358

59+
### HyperTrace
60+
61+
Sometimes popping in a trace can reveal a lot about what is going on. [HyperTrace](hyper-trace.md) wraps your selected method calls in
62+
a dump of incoming parameters, instance variable state, and return values. You can also setup conditional
63+
breakpoints. So keep HyperTrace handy in your tool belt.
64+
65+
### HyperSpec
66+
67+
IMHO the best debugging tool is a spec. As soon as you start creating a new feature, or find a bug, start
68+
writing a spec. Once you can reproduce the problem by running a spec, you are 90% of the way to fixing the problem,
69+
and you will have another spec to add to your tests, making your app more robust. [HyperSpec](hyper-spec/README.md) extends RSpec so that
70+
can control and interrogate the client from within your specs, using Ruby code.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
There are a number of issues and additional items that need to been done when deploying to Heroku (or other production environments.)
2+
Even if not deploying to Heroku these steps will cover most of the gotchas that you will encounter.
3+
4+
If you do find any problems please log an issue, or better yet do a pull request on this page.
5+
6+
1. **You need to use postgresql rather than sqlite or mysql.** You can find instructions on how to do this online, or better yet when you create your rails app, create it from the beginning with postgresql: https://www.digitalocean.com/community/tutorials/how-to-set-up-ruby-on-rails-with-postgres
7+
8+
2. **Remove `app/models/application_record.rb`** This is no longer needed due to a recent rails fix, and confuses Heroku.
9+
10+
3. **Use harmonly uglifier.** In config/environments/production.rb you need to change this line from:
11+
`config.assets.js_compressor = :uglifier`
12+
to
13+
`config.assets.js_compressor = Uglifier.new(harmony: true)`
14+
15+
4. **Insure webpacker:compile occurs before assets:precompile:** at the end of the `Rakefile` (in the root directory) add this line:
16+
`Rake::Task["assets:precompile"].enhance(['yarn:install', 'webpacker:compile'])`
17+
18+
5. **Setup your database** Make sure you run
19+
`Heroku run rake db:migrate`
20+
21+
6. **Update your production policies** By default the Hyperstack installer will leave your Policies wide open but **not** in production.
22+
For a production app you will want to add restrictive Policies to protect your data. If you just want to get things working on Heroku you can remove the guard from the end of the `policies/application.rb` file.
23+
24+
5. Add `stylesheet_pack_tag`s: Hyperstack does not automatically pull in the `.css` packs. Instead you have to add one or both these lines to your layouts, if you are requiring css assets in the pack files:
25+
`<%= stylesheet_pack_tag 'client_only' %>`
26+
If you are requiring css libraries in the `client_only.js` pack file
27+
and
28+
`<%= stylesheet_pack_tag 'client_and_server' %>`
29+
If you are requiring css libraries in the `client_and_server.js` pack file
30+
31+
6. Setup ActionCable (see [full instructions](https://blog.Heroku.com/real_time_rails_implementing_websockets_in_rails_5_with_action_cable#deploying-our-application-to-Heroku) for details)
32+
provision Redis on Heroku `Heroku addons:add redistogo`
33+
then get the Heroku url: `Heroku config --app action-cable-example | grep REDISTOGO_URL`
34+
use the url in config/cable.yml (in the production section)
35+
in config/environments/production.rb add these two lines:
36+
`config.web_socket_server_url = "wss://your-app.Herokuapp.com/cable" `
37+
`config.action_cable.allowed_request_origins = ['https://your-app.Herokuapp.com', 'http://action-your-app.Herokuapp.com']`
38+
39+
### On Going Development
40+
41+
After updating anything in the hyperstack initializer you will need to force Heroku to clear the cache:
42+
43+
First install the Heroku-repo plugin (on your console)
44+
`$ Heroku plugins:install Heroku-repo`
45+
46+
and then to clear the cache do:
47+
48+
`$ Heroku repo:purge_cache -a appname`
49+
`$ git commit --allow-empty -m "Purge cache"`
50+
`$ git push Heroku master`
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<img align="left" width="100" height="100" style="margin-right: 20px" src="https://github.com/hyperstack-org/hyperstack/blob/edge/docs/wip.png?raw=true">
2+
HyperTrace provides a simple way to log information to the Javascript console. You get a real time display of the parameters being passed to
3+
the traced methods, the state of their instance variables, and the return values. You can also set conditional breakpoints so you can stop execution
4+
and dig deeper from the Javascript console.
5+
6+
## This Page Under Construction

docs/development-workflow/tools.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/isomorphic-dsl/hyper-model.md renamed to docs/hyper-model/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Isomorphic Models
1+
<img align="left" width="100" height="100" style="margin-right: 20px" src="https://github.com/hyperstack-org/hyperstack/blob/edge/docs/wip.png?raw=true">
2+
HyperModel extends Rails ActiveRecord models so that you have direct access to them on the client, using the same ActiveRecord classes and methods as you
3+
would on the server. Nothing new to learn, or configure, just plug in and go.
4+
5+
## This Page Under Construction
26

3-
**Work in progress - ALPHA \(docs and code\)**
47

58
In Hyperstack, your ActiveRecord Models are available in your Isomorphic code.
69

@@ -694,4 +697,3 @@ You can of course simulate server side changes to your Models through this conso
694697
* **On page load you get a message about super class mismatch for `DummyValue`** You are still have the old `reactive-record` gem in your Gemfile, remove it from your gemfile and your components manifest.
695698
* **On page load you get a message about no method `session` for `nil`** You are still referencing the old reactive-ruby or reactrb gems either directly or indirectly though a gem like reactrb-router. Replace any gems like `reactrb-router` with `hyper-router`. You can also just remove `reactrb`, as `hyper-model` will be included by the `hyper-model` gem.
696699
* **You keep seeing the message `WebSocket connection to 'ws://localhost:3000/cable' failed: WebSocket is closed before the connection is established.`** every few seconds in the console. There are probably lots of reasons for this, but it means ActionCable can't get itself going. One reason is that you are trying to run with Passenger instead of Puma, and trying to use `async` mode in cable.yml file. `async` mode requires Puma.
697-

docs/hyper-router/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# Client-side Routing
21

3-
HyperRouter is a DSL wrapper for [ReactRouter v4.x](https://github.com/ReactTraining/react-router) to provide client-side routing for Single Page Applications (SPA).
2+
<img align="left" width="100" height="100" style="margin-right: 20px" src="https://github.com/hyperstack-org/hyperstack/blob/edge/docs/wip.png?raw=true">
3+
**HyperRouter is a DSL wrapper for [ReactRouter v4.x](https://github.com/ReactTraining/react-router) to provide
4+
client-side routing for Single Page Applications (SPA). As the user changes "pages" instead of reloading from the server your App will mount
5+
different components.**
6+
7+
## This Page Under Construction
8+
9+
410

511
## Usage
612

docs/hyper-state/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
<img align="left" width="100" height="100" style="margin-right: 20px" src="https://github.com/hyperstack-org/hyperstack/blob/edge/docs/wip.png?raw=true">
3-
**The `Hyperstack::State::Observable` module allows you to build
3+
**The `Hyperstack::State::Observable` module allows you to build
44
classes that share their state with Hyperstack Components, and have those components update when objects in those classes change state.**
55

66
## This Page Under Construction

0 commit comments

Comments
 (0)