You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+175-8Lines changed: 175 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,172 @@
1
1
# Lux Changelog
2
2
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
+
classApplicationControllerextendsController {
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
+
functionisGood(req) {
46
+
if (req.params.bad) {
47
+
return400;
48
+
}
49
+
}
50
+
];
51
+
52
+
/**
53
+
* This will return 204 (No Content) and is equivalent to `return 204`.
54
+
*/
55
+
health() {
56
+
returntrue;
57
+
}
58
+
59
+
/**
60
+
* This will return 401 (Unauthorized) and is equivalent to `return 204`.
61
+
*/
62
+
topSecret() {
63
+
returnfalse;
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
+
returnnull;
92
+
}
93
+
}
94
+
95
+
exportdefaultApplicationController;
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
+
exportdefaultfunctionroutes() {
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)
*[[`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)
*[[`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)
*[[`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
+
3
170
### 0.0.1-beta.13 (June 18, 2016)
4
171
5
172
*[[`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.
49
216
50
217
##### Upgrading
51
218
52
-
#####Models
219
+
###### Application
53
220
54
221
For the sake of proper namespacing, Lux no longer exports the `Application`
55
222
class as a `default` export. To upgrade simply use a named import of
@@ -78,13 +245,13 @@ class MyApp extends Lux.Application {
78
245
exportdefaultMyApp;
79
246
```
80
247
81
-
##### Models
248
+
######Models
82
249
83
250
Models now support scopes and have a chainable query interface. More docs will
84
251
soon be available on this but for now it should be as simple as replacing calls
85
252
to `Model.findAll` with `Model.where`.
86
253
87
-
##### Controllers
254
+
######Controllers
88
255
89
256
Decorators are no longer used to declare custom actions on your controller. For
90
257
an easy upgrade simply remove the `@action` at the top of your custom actions.
@@ -103,7 +270,7 @@ class PostsController extends Controller {
103
270
exportdefaultPostsController;
104
271
```
105
272
106
-
##### Routes
273
+
######Routes
107
274
108
275
Route declarations no longer support an arrow function export since arrow
109
276
functions do not have a `name` property.
@@ -116,7 +283,7 @@ export default function routes(route, resource) {
116
283
}
117
284
```
118
285
119
-
##### Seed
286
+
######Seed
120
287
121
288
The db seed function no longer support an arrow function export since arrow
122
289
functions do not have a `name` property.
@@ -129,7 +296,7 @@ export default function seed() {
129
296
}
130
297
```
131
298
132
-
##### Config
299
+
######Config
133
300
134
301
Config files found in `./config/environments` now only require a single option
135
302
`log`.
@@ -142,7 +309,7 @@ export default {
142
309
};
143
310
```
144
311
145
-
##### .babelrc
312
+
######.babelrc
146
313
147
314
Lux now uses a special babel [preset](https://github.com/zacharygolba/babel-preset-lux)
148
315
to only transpile features that are missing from Node 6.X. That means that ~95%
@@ -155,7 +322,7 @@ performance boost in this release 🐇.
155
322
}
156
323
```
157
324
158
-
##### package.json
325
+
######package.json
159
326
160
327
Update your `package.json` to only include the following base packages required
161
328
for a Lux application (plus the ones you installed yourself).
0 commit comments