Skip to content

Commit 22dfbaf

Browse files
authored
release: 1.0.0-rc (#185)
1 parent 81f52fc commit 22dfbaf

File tree

6 files changed

+196
-31
lines changed

6 files changed

+196
-31
lines changed

CHANGELOG.md

Lines changed: 175 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,172 @@
11
# Lux Changelog
22

3+
### 1.0.0-rc (June 25, 2016)
4+
5+
🔅🎊🎈 This is the final set of functionality that will be added in 1.0! The remainder of pull requests from now until the 1.0 release will just be bug fixes or adding polish (Dockerfile, Website, Quick Start Guide, API docs, etc.). These issues can be tracked in the [1.0 milestone](https://github.com/postlight/lux/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.0).
6+
7+
In addition to features, this release includes bug fixes and general performance improvements.
8+
9+
##### Features
10+
11+
###### Lux Console
12+
13+
You can now debug your application rails style with a custom repl that has your application built and loaded as global variables.
14+
15+
To start the repl, run `lux console` or `lux c` in your
16+
17+
```javascript
18+
> User.find(1).then(user => {
19+
console.log(`${user.name} is working as expected.`);
20+
});
21+
// => Promise
22+
// 'Stephen Curry is working as expected.'
23+
> PostsController.beforeAction
24+
// => [[Function], [Function], [Function]]
25+
> routes
26+
// => Router {...routes}
27+
```
28+
29+
###### Intelligent Responses
30+
31+
Lux now intelligently observes the return value (or resolved `Promise` value for async functions) of your applications middleware and controller actions to serialize and respond with the correct data and status codes. Throwing an error at any point in time will cause a `500` and will be caught and handled gracefully (stack traces included when running outside of production).
32+
33+
These are a few example edge cases where returning a Model or an Array of Models may not be what you want to do.
34+
35+
```javascript
36+
import { Controller } from 'lux-framework';
37+
38+
class ApplicationController extends Controller {
39+
beforeAction = [
40+
/**
41+
* If any request is sent to this application with `?bad=true` the server
42+
* will respond with 400 (Bad Request) and the latter actions will not be
43+
* called. Otherwise, the request will be handled normally.
44+
*/
45+
function isGood(req) {
46+
if (req.params.bad) {
47+
return 400;
48+
}
49+
}
50+
];
51+
52+
/**
53+
* This will return 204 (No Content) and is equivalent to `return 204`.
54+
*/
55+
health() {
56+
return true;
57+
}
58+
59+
/**
60+
* This will return 401 (Unauthorized) and is equivalent to `return 204`.
61+
*/
62+
topSecret() {
63+
return false;
64+
}
65+
66+
/**
67+
* This will return 200 (OK) with the string 'bar'.
68+
*/
69+
foo() {
70+
return 'bar';
71+
}
72+
73+
/**
74+
* This will return 200 (OK) with the following JSON.
75+
*
76+
* {
77+
* "foo": "bar"
78+
* }
79+
*/
80+
fooJSON() {
81+
return {
82+
foo: 'bar'
83+
};
84+
}
85+
86+
/**
87+
* This will return 404 (Not Found). Returning undefined will also result in
88+
* a 404 unless the function returning undefined is called from beforeAction.
89+
*/
90+
notFound() {
91+
return null;
92+
}
93+
}
94+
95+
export default ApplicationController;
96+
```
97+
98+
99+
###### Windows Support
100+
101+
Lux now is 100% compatible with Windows!
102+
103+
**NOTE:**
104+
Travis-CI does not enable us to run our test suite on Windows. This shouldn't be an issue for development but it is highly recommend that you run Lux in a Docker container if your a deploying to Windows in production.
105+
106+
##### Notable Changes
107+
108+
* `lux serve` does not start in cluster mode by default. To run your application as a cluster run `lux serve -c` or `lux serve --cluster`.
109+
110+
* Commands that require an application build (`serve`, `db:*`, etc) now prefer strict mode and require you to specify `--use-weak` if you do not want to run in strict mode (you should pretty much always use strict mode).
111+
112+
##### Upgrading
113+
114+
The Lux CLI in 1.0 is not backwards compatible with previous beta versions so please perform a local upgrade before upgrading Lux globally.
115+
116+
###### Routes
117+
118+
Route definitions now must call `this.route` and `this.resource` rather than having `route` and `resource` as arguments to the function in `./app/routes.js`. This is the initial ground work for implementing [router namespaces](https://github.com/postlight/lux/blob/master/ROADMAP.md#router-namespaces).
119+
120+
```javascript
121+
// ./app/routes.js
122+
123+
export default function routes() {
124+
this.resource('post');
125+
this.resource('users');
126+
127+
this.route('users/login', {
128+
action: 'login',
129+
method: 'POST'
130+
});
131+
132+
this.route('users/logout', {
133+
action: 'logout',
134+
method: 'DELETE'
135+
});
136+
}
137+
```
138+
139+
##### Commits
140+
141+
* [[`81f52fc1c8`](https://github.com/postlight/lux/commit/81f52fc1c8)] - **feat**: add luxify function for converting traditional middleware (#183) (Zachary Golba)
142+
* [[`39ce152574`](https://github.com/postlight/lux/commit/39ce152574)] - **fix**: index names sometimes exceed max length in generated migrations (#182) (Zachary Golba)
143+
* [[`fb5a71a897`](https://github.com/postlight/lux/commit/fb5a71a897)] - **feat**: add custom repl for debugging (#180) (Zachary Golba)
144+
* [[`c2b0b30d01`](https://github.com/postlight/lux/commit/c2b0b30d01)] - **feat**: do not cluster by default use -c || --cluster (#179) (Zachary Golba)
145+
* [[`785ebf1c39`](https://github.com/postlight/lux/commit/785ebf1c39)] - **fix**: regression from #177 local lux not being used in cli (#178) (Zachary Golba)
146+
* [[`67b9940e5c`](https://github.com/postlight/lux/commit/67b9940e5c)] - **feat**: add windows support (#177) (Zachary Golba)
147+
* [[`c4ab5e0b3b`](https://github.com/postlight/lux/commit/c4ab5e0b3b)] - **deps**: update rollup to version 0.33.0 (#176) (Greenkeeper)
148+
* [[`a7e860dd97`](https://github.com/postlight/lux/commit/a7e860dd97)] - **deps**: update rollup-plugin-babel to version 2.6.1 (#172) (Greenkeeper)
149+
* [[`68e7d8fafe`](https://github.com/postlight/lux/commit/68e7d8fafe)] - **deps**: update rollup-plugin-json to version 2.0.1 (#173) (Greenkeeper)
150+
* [[`7abf664c99`](https://github.com/postlight/lux/commit/7abf664c99)] - **deps**: update rollup-plugin-eslint to version 2.0.2 (#175) (Greenkeeper)
151+
* [[`f4e17aabf9`](https://github.com/postlight/lux/commit/f4e17aabf9)] - **deps**: update rollup-plugin-node-resolve to version 1.7.1 (#174) (Greenkeeper)
152+
* [[`c2a77c68d5`](https://github.com/postlight/lux/commit/c2a77c68d5)] - **deps**: update rollup to version 0.32.4 (#171) (Greenkeeper)
153+
* [[`b23873109b`](https://github.com/postlight/lux/commit/b23873109b)] - **deps**: update rollup-plugin-babel to version 2.6.0 (#169) (Greenkeeper)
154+
* [[`7ed59ab595`](https://github.com/postlight/lux/commit/7ed59ab595)] - **deps**: update rollup to version 0.32.2 (#168) (Greenkeeper)
155+
* [[`b25237a647`](https://github.com/postlight/lux/commit/b25237a647)] - **refactor**: use process.cwd() instead of process.env.PWD (#167) (Zachary Golba)
156+
* [[`5bab51a38b`](https://github.com/postlight/lux/commit/5bab51a38b)] - **deps**: update babel-eslint to version 6.1.0 (#165) (Greenkeeper)
157+
* [[`53cb1e53e2`](https://github.com/postlight/lux/commit/53cb1e53e2)] - **deps**: update rollup to version 0.32.1 (#164) (Greenkeeper)
158+
* [[`022b2e954c`](https://github.com/postlight/lux/commit/022b2e954c)] - **deps**: upgrade pg version in test-app (#166) (Zachary Golba)
159+
* [[`ef3f9ce8d3`](https://github.com/postlight/lux/commit/ef3f9ce8d3)] - **fix**: ensure lux is not an external dependency (#163) (Zachary Golba)
160+
* [[`fba8654d2e`](https://github.com/postlight/lux/commit/fba8654d2e)] - **deps**: update test-app dependencies (#162) (Zachary Golba)
161+
* [[`84160c9149`](https://github.com/postlight/lux/commit/84160c9149)] - **deps**: update babel-core to version 6.10.4 (#161) (Greenkeeper)
162+
* [[`7ee935afa1`](https://github.com/postlight/lux/commit/7ee935afa1)] - **deps**: update babel-eslint to version 6.0.5 (#160) (Greenkeeper)
163+
* [[`cd53552aca`](https://github.com/postlight/lux/commit/cd53552aca)] - **deps**: update eslint to version 2.13.1 (#159) (Greenkeeper)
164+
* [[`8e6a23dad3`](https://github.com/postlight/lux/commit/8e6a23dad3)] - **refactor**: improve build process and stack traces (#158) (Zachary Golba)
165+
* [[`6748638ca6`](https://github.com/postlight/lux/commit/6748638ca6)] - **refactor**: rename serializer methods and return objects (#155) (Zachary Golba)
166+
* [[`7597031076`](https://github.com/postlight/lux/commit/7597031076)] - **feat**: ensure Application#port is a number (#156) (Zachary Golba)
167+
* [[`2d83f30df6`](https://github.com/postlight/lux/commit/2d83f30df6)] - **deps**: update rollup to version 0.32.0 (#154) (Greenkeeper)
168+
* [[`64250ebe5b`](https://github.com/postlight/lux/commit/64250ebe5b)] - **refactor**: separate responsibilities in req/res flow (#153) (Zachary Golba)
169+
3170
### 0.0.1-beta.13 (June 18, 2016)
4171

5172
* [[`30a60c10ca`](https://github.com/postlight/lux/commit/30a60c10ca)] - **chore**: bump version to 0.0.1-beta.13 (Zachary Golba)
@@ -49,7 +216,7 @@ only contain a few more features geared towards application profiling.
49216

50217
##### Upgrading
51218

52-
##### Models
219+
###### Application
53220

54221
For the sake of proper namespacing, Lux no longer exports the `Application`
55222
class as a `default` export. To upgrade simply use a named import of
@@ -78,13 +245,13 @@ class MyApp extends Lux.Application {
78245
export default MyApp;
79246
```
80247

81-
##### Models
248+
###### Models
82249

83250
Models now support scopes and have a chainable query interface. More docs will
84251
soon be available on this but for now it should be as simple as replacing calls
85252
to `Model.findAll` with `Model.where`.
86253

87-
##### Controllers
254+
###### Controllers
88255

89256
Decorators are no longer used to declare custom actions on your controller. For
90257
an easy upgrade simply remove the `@action` at the top of your custom actions.
@@ -103,7 +270,7 @@ class PostsController extends Controller {
103270
export default PostsController;
104271
```
105272

106-
##### Routes
273+
###### Routes
107274

108275
Route declarations no longer support an arrow function export since arrow
109276
functions do not have a `name` property.
@@ -116,7 +283,7 @@ export default function routes(route, resource) {
116283
}
117284
```
118285

119-
##### Seed
286+
###### Seed
120287

121288
The db seed function no longer support an arrow function export since arrow
122289
functions do not have a `name` property.
@@ -129,7 +296,7 @@ export default function seed() {
129296
}
130297
```
131298

132-
##### Config
299+
###### Config
133300

134301
Config files found in `./config/environments` now only require a single option
135302
`log`.
@@ -142,7 +309,7 @@ export default {
142309
};
143310
```
144311

145-
##### .babelrc
312+
###### .babelrc
146313

147314
Lux now uses a special babel [preset](https://github.com/zacharygolba/babel-preset-lux)
148315
to only transpile features that are missing from Node 6.X. That means that ~95%
@@ -155,7 +322,7 @@ performance boost in this release 🐇.
155322
}
156323
```
157324

158-
##### package.json
325+
###### package.json
159326

160327
Update your `package.json` to only include the following base packages required
161328
for a Lux application (plus the ones you installed yourself).

examples/social-network/app/routes.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
export default function routes(route, resource) {
2-
resource('comments');
3-
resource('posts');
4-
resource('reactions');
5-
resource('tags');
6-
resource('users');
1+
export default function routes() {
2+
this.resource('comments');
3+
this.resource('posts');
4+
this.resource('reactions');
5+
this.resource('tags');
6+
this.resource('users');
77

8-
route('actions', {
8+
this.route('actions', {
99
method: 'GET',
1010
action: 'index'
1111
});
1212

13-
route('actions/:id', {
13+
this.route('actions/:id', {
1414
method: 'GET',
1515
action: 'show'
1616
});
1717

18-
route('notifications', {
18+
this.route('notifications', {
1919
method: 'GET',
2020
action: 'index'
2121
});
2222

23-
route('notifications/:id', {
23+
this.route('notifications/:id', {
2424
method: 'GET',
2525
action: 'show'
2626
});

examples/social-network/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"author": "",
1111
"license": "MIT",
1212
"dependencies": {
13-
"babel-core": "6.9.1",
14-
"babel-preset-lux": "1.0.0",
15-
"knex": "0.11.5",
16-
"lux-framework": "0.0.1-beta.13",
13+
"babel-core": "6.10.4",
14+
"babel-preset-lux": "1.1.0",
15+
"knex": "0.11.7",
16+
"lux-framework": "1.0.0-rc",
1717
"sqlite3": "3.1.4"
1818
},
1919
"devDependencies": {

examples/todo/app/routes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function routes(route, resource) {
2-
resource('tasks');
3-
resource('lists');
1+
export default function routes() {
2+
this.resource('tasks');
3+
this.resource('lists');
44
}

examples/todo/bin/app.js

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

examples/todo/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"author": "",
1111
"license": "MIT",
1212
"dependencies": {
13-
"babel-core": "6.9.1",
14-
"babel-preset-lux": "1.0.0",
15-
"knex": "0.11.5",
16-
"lux-framework": "0.0.1-beta.13",
13+
"babel-core": "6.10.4",
14+
"babel-preset-lux": "1.1.0",
15+
"knex": "0.11.7",
16+
"lux-framework": "1.0.0-rc",
1717
"sqlite3": "3.1.4"
1818
},
1919
"devDependencies": {

0 commit comments

Comments
 (0)