Skip to content

Commit

Permalink
Merge pull request #3 from socketstream/feature/robert-edits
Browse files Browse the repository at this point in the history
Feature/robert edits
  • Loading branch information
arxpoetica committed Nov 6, 2015
2 parents 990ccd8 + cccf456 commit 28c5fb7
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 50 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
##### Viewing this from GitHub? Visit the SocketStream GitBook website for the full experience. **[SocketStream Documentation →](https://arxpoetica.gitbooks.io/gs-css-rules/content/index.html)**

----

# SocketStream

> The Future is Real Time
Expand Down Expand Up @@ -38,4 +42,17 @@ So what does SocketStream do? Here are some of the basics, but we'll go into dep
* Web Workers
* Compatibility with Connect Middleware

Before we get into the nuts and bolts, however, let's get started.
Before getting into the nuts and bolts, let's take a look at our [Quick Start guide →](quick-start.md)

<!-- * [HTML/CSS/JS code preprocessers](to_come.md)
* [Live reload (development)](to_come.md)
* [CSS/JS compilation and CDN asset pipeline management](to_come.md)
* [WebSocket management](to_come.md)
* [RPC APIs](to_come.md)
* [PubSub APIs](to_come.md)
* [Client-side code organization](to_come.md)
* [Session management (defaulted to REDIS)](to_come.md)
* [Custom WebSocket APIs](to_come.md)
* [HTML Templates (custom or default)](to_come.md)
* [Web Workers](to_come.md)
* [Compatibility with Connect Middleware](to_come.md) -->
51 changes: 19 additions & 32 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,23 @@

* [Introduction](README.md)
* [Quick Start](quick-start.md)
* [Client-side Development](server-side-development/README.md)
* [Client-side Code](client-side-code.md)
* [Client-side Templates](client-side-templates.md)
* [Defining multiple Single-Page Clients](multiple-single-page-clients.md)
* [Loading Assets On Demand](loading-assets-on-demand.md)
* [Live Reload](live-reload.md)
* [Web Workers](web-workers.md)
* [Server-side Development](server-side-development/README.md)
* [RPC Responder](rpc-responder.md)
* [Pub/Sub Events](pub-sub-events.md)
* [Sessions](sessions.md)
* [Request Middleware](request-middleware.md)
* [HTTP Middleware](http-middleware.md)
* [Authentication](authentication.md)
* [Testing Your App](testing-your-app.md)
* [Client-side Development](client-side/README.md)
* [Client-side Code](client-side/client-side-code.md)
* [Client-side Templates](client-side/client-side-templates.md)
* [Defining multiple Single-Page Clients](client-side/multiple-single-page-clients.md)
* [Loading Assets On Demand](client-side/loading-assets-on-demand.md)
* [Live Reload](client-side/live-reload.md)
* [Web Workers](client-side/web-workers.md)
* [Server-side Development](server-side/README.md)
* [RPC Responder](server-side/rpc-responder.md)
* [Pub/Sub Events](server-side/pub-sub-events.md)
* [Sessions](server-side/sessions.md)
* [Request Middleware](server-side/request-middleware.md)
* [HTTP Middleware](server-side/http-middleware.md)
* [Authentication](server-side/authentication.md)
* [Testing Your App](server-side/testing-your-app.md)
* [Best Practices](best-practices/README.md)
* [Hosting in Production](hosting-in-production.md) - Packing assets, CDNs, handling exceptions
* [Extending SocketStream](extending-socketstream/README.md)
* [Writing Template Engine Wrappers](writing-template-engine-wrappers.md) - support any of the gazillion template formats out there
* [Writing Request Responders](writing-request-responders.md) - experiment with models and low-level message protocols

<!-- * [HTML/CSS/JS code preprocessers](to_come.md)
* [Live reload (development)](to_come.md)
* [CSS/JS compilation and CDN asset pipeline management](to_come.md)
* [WebSocket management](to_come.md)
* [RPC APIs](to_come.md)
* [PubSub APIs](to_come.md)
* [Client-side code organization](to_come.md)
* [Session management (defaulted to REDIS)](to_come.md)
* [Custom WebSocket APIs](to_come.md)
* [HTML Templates (custom or default)](to_come.md)
* [Web Workers](to_come.md)
* [Compatibility with Connect Middleware](to_come.md) -->
* [Hosting in Production](best-practices/hosting-in-production.md) - Packing assets, CDNs, handling exceptions
* [Extending SocketStream](extending/README.md)
* [Writing Template Engine Wrappers](extending/writing-template-engine-wrappers.md) - support any of the gazillion template formats out there
* [Writing Request Responders](extending/writing-request-responders.md) - experiment with models and low-level message protocols
1 change: 0 additions & 1 deletion client-side-development/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions client-side/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Client-side Development

SocketStream provides modern asset management techniques, sensible file organization, auto-precompilation of scripts, templates, and stylesheets, and a development live reload environment.

Let's start by looking at authoring [client-side code →](client-side-code.md)
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
@ngdoc overview
@name Client-Side Code

@description
# Client-Side Code

SocketStream allows you to write and structure client-side Javascript in exactly the same way as server-side code, allowing you to easily share modules between both.


### How to use Modules

All files which aren't `libs` (see below) are treated as modules. You have exactly the same ability to export functions, `require()` other modules, and cache values within modules as you do when writing server-side code in Node.js.
Expand All @@ -15,19 +10,16 @@ Client-side code lives in `/client/code`. Create as many subdirectories as you w

Top tip: Type `require.modules` in the browser console to see a list of all modules you can `require()` in your app


### Special Exceptions

While we try to keep the experience between browser and server as similar as possible, there are a few special cases to be aware of:


#### 'libs' - Legacy (non Common JS) Libraries

Any file which lives in a directory called 'libs' will NOT be served as a module. Instead these files will be sent as-is without any modification. Typically you'll want to ensure jQuery and other libraries which use the `window` variable are always placed in a `/client/code` directory called 'libs'.

As load order is critically important for non Common JS libraries **either** name your files alphanumerically within the `libs` directory **or** list each file explicitly in your `ss.client.define()` command - your choice.


#### 'system' - System Modules

System modules are similar to regular modules but with one important difference: they are accessed without a leading slash - just like you would `require('url')` or `require('querystring')` in Node.js.
Expand All @@ -38,7 +30,6 @@ As SocketStream uses code from [Browserify](https://github.com/substack/node-bro

Tip: If you're making a new folder called `/client/code/system`, don't forget to add `system` to the list of code directores to serve in the `ss.client.define()` statement within `app.js`.


#### '/entry.js' - A single point of entry

The `entry` module has a special distinction: it is the only module to be required automatically once all files have been
Expand Down Expand Up @@ -74,14 +65,12 @@ Within client view code you should generally require another module by relative
If you use absolute path it will be relative to the client directory, so if you want to require a directory module within the default
code directory do something like,

require("/code/app/part1")
require("/code/app/part1")

This will load the module for the source file `/code/app/part1/index.js` or `/code/app/part1/index.coffee`. If part1 isn't a directory
it can also be used to load `/code/app/part1.js`. You could also do this explicitly using `require("/code/app/part1/index.js")`,
but this isn't advised as it locks you in to the exact source structure.



### Loading modules on demand

You don't necessarily have to send all modules to the browser at once, you can also [load them on demand](https://github.com/socketstream/socketstream/blob/master/doc/guide/en/loading_assets_on_demand.md).
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ npm install
npm start
```
Open your favorite development browser at `http://localhost:3000/` and start hacking! That’s it!
Open your favorite development browser at [http://localhost:3000/](http://localhost:3000/) and start hacking!
For a more comprehensive guide, see our [Getting Started](#) tutorial.
Let us know about your project(s). We're always looking to grow the community. More at:
For a more comprehensive guide, [continue with our documentation →](client-side-development/README.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 28c5fb7

Please sign in to comment.