Shout out to @adampash for fixing a bug that prevents newly created Lux apps from successfully being built! 👏
- Newly created Lux projects no longer fail to build due to invalid config files.
- [
6b598748d0
] - Fix: Quoting quotes inside config template (#260) (Adam Pash) - [
74416748e4
] - release: 1.0.0-rc.2 (#253) (Zachary Golba)
- Invalid parameters and malformed request bodies no longer fail silently.
- Controller's now accept relationships for
create
andupdate
actions.
- [
1172d562c5
] - fix: do not allow public route definitions to set private params (#252) (Zachary Golba) - [
278ab5dda3
] - fix: allow show action to be chained (#251) (Zachary Golba) - [
4777e1a22e
] - chore: update example apps (#250) (Zachary Golba) - [
5f55d63b57
] - deps: update eslint to version 3.2.2 (#248) (Greenkeeper) - [
831a61c7a1
] - deps: update rollup to version 0.34.3 (#249) (Greenkeeper) - [
e49e7df0e6
] - deps: update all dependencies (#247) (Zachary Golba) - [
f41007d873
] - deps: update eslint to version 3.2.1 (#245) (Greenkeeper) - [
62ee4be098
] - deps: update rollup-plugin-multi-entry to version 2.0.1 (#246) (Greenkeeper) - [
32aa4484d0
] - deps: update rollup to version 0.34.2 (#244) (Greenkeeper) - [
82fb3ce32e
] - deps: update mocha to version 3.0.0 (#243) (Greenkeeper) - [
e4de52d116
] - refactor: add better relationship support and refactor type systems (#229) (Zachary Golba) - [
e5e4c7afde
] - deps: update rollup-plugin-node-resolve to version 2.0.0 (#242) (Greenkeeper) - [
edefdb50be
] - deps: update rollup-plugin-node-resolve to version 1.7.3 (#241) (Greenkeeper) - [
2d35a05c43
] - deps: update ora to version 0.3.0 (#239) (Greenkeeper) - [
6787f15135
] - deps: update eslint to version 3.2.0 (#237) (Greenkeeper) - [
aab024dc10
] - deps: update flow-bin to version 0.30.0 (#238) (Greenkeeper) - [
4fcf1fcb54
] - deps: update rollup-plugin-node-resolve to version 1.7.2 (#236) (Greenkeeper) - [
dff620b617
] - deps: update eslint-plugin-flowtype to version 2.4.0 (#235) (Greenkeeper) - [
c1e1d69956
] - deps: update babel-plugin-transform-es2015-modules-commonjs to version 6.11.5 (#234) (Greenkeeper) - [
8c2494cd4b
] - deps: update babel-core to version 6.11.4 (#233) (Greenkeeper) - [
7682b8720a
] - deps: update eslint to version 3.1.1 (#231) (Greenkeeper) - [
6b62779f27
] - fix: pluralize fields resource name (#216) (Louis Person) - [
44025b35f7
] - deps: update documentation (package) to version 4.0.0-beta8 (#228) (Zachary Golba) - [
ef8a1f6e22
] - deps: update pg to version 6.0.2 in test-app (#227) (Zachary Golba) - [
4247194886
] - feat: deduce domain protocol from connection (#217) (Louis Person) - [
cb5e45d342
] - deps: update eslint to version 3.1.0 (#226) (Greenkeeper) - [
d8ef797d46
] - refactor: remove response stream in favor of res.end() (#225) (Zachary Golba) - [
a8a5406995
] - feat: improve log messages and data (#213) (Zachary Golba) - [
6cd3474a53
] - deps: update flow-bin to version 0.29.0 (#224) (Greenkeeper) - [
2960a4148a
] - deps: update source-map-support to version 0.4.2 (#220) (Greenkeeper) - [
c06a677c81
] - deps: update eslint-plugin-flowtype to version 2.3.1 (#219) (Greenkeeper) - [
e69f04f6d9
] - feat: check directory for valid directory structure (#215) (kev5873) - [
a7960f6bea
] - deps: update rollup to version 0.34.1 (#214) (Greenkeeper) - [
9c7e24a6dd
] - refactor: add flow comment to the top of decl files (#212) (Zachary Golba) - [
fc325ea65b
] - refactor: improve and simplify eslint rules (#209) (Zachary Golba) - [
a8460e5d4c
] - fix: resource IDs must be strings (#211) (Louis Person) - [
fd0a593bb1
] - deps: update rollup to version 0.34.0 (#210) (Greenkeeper) - [
4cc248bed4
] - deps: update test-app dependencies (#208) (Zachary Golba) - [
81a30f76b9
] - feat: improve proxy decl (#207) (Zachary Golba) - [
99523b7a0d
] - deps: update babel-eslint to version 6.1.2 (#206) (Greenkeeper) - [
eca77d5e9f
] - deps: update rollup to version 0.33.2 (#205) (Greenkeeper) - [
4bb1878b91
] - deps: update babel-eslint to version 6.1.1 (#204) (Greenkeeper) - [
3bb6e07431
] - fix: errors is a top level member (#203) (Louis Person) - [
370630c8d4
] - deps: update rollup to version 0.33.1 (#202) (Greenkeeper) - [
3eb6790091
] - deps: update rollup-plugin-multi-entry to version 2.0.0 🚀 (#199) (Greenkeeper) - [
dc2e232b94
] - deps: update flow-bin to version 0.28.0 🚀 (#201) (Greenkeeper) - [
000bf415a2
] - deps: update eslint to version 3.0.1 (#200) (Greenkeeper) - [
14b7bab46c
] - docs: update CHANGELOG.md to include docker images (#198) (Zachary Golba) - [
236c3961f0
] - docs: update ROADMAP.md (#197) (Zachary Golba) - [
1d3a7b29ae
] - docs: update testing section of README.md (#196) (Zachary Golba) - [
266b2120a2
] - release: 1.0.0-rc.1 (#195) (Zachary Golba)
Happy Independence Day 🇺🇸
This release brings a few bug fixes and some of the features tracked in the 1.0 milestone. Special thanks to @kev5873 for finding and fixing a bug related to generating a new project with more than one dash in the title!
🐳 We now have images on Docker Hub for seamless Lux development and deploying.
You are now able to query for a single record similar to Query#find
but with all chainable query methods rather than just WHERE 'id' = ?
.
Async/Await
const post = await Post
.first()
.where({ isPublic: true });
console.log(post);
// => Post {}
Promise
Post
.first()
.where({ isPublic: true })
.then(post => console.log(post));
// => Post {}
Models now return a Promise
when accessing a relationship. If the related record have been eager loaded with includes it will immediately resolve to the eager loaded value. Otherwise, it will load the related records from the database and resolve with the result.
Async/Await
const post = await Post.find(1);
console.log(await post.author);
// => Author {}
Promise
Post.find(1)
.then(post => post.author)
.then(author => console.log(author));
// => Author {}
- [
32c1b92d04
] - deps: update moment to version 2.14.1 (#194) (Greenkeeper) - [
e43e2e6c00
] - deps: update eslint to version 3.0.0 (#192) (Greenkeeper) - [
40863b4fbd
] - fix: display correct error messages from flow script (#191) (Zachary Golba) - [
5aeb903196
] - feat: return a promise from relationships (#190) (Zachary Golba) - [
38d7a9bcbf
] - feat: add Query#first and Query#last (#189) (Zachary Golba) - [
bceb825976
] - fix: fixes #187 issue with class name generation with multiple dashes (#188) (kev5873) - [
620ab46eae
] - chore(package): update source-map-support to version 0.4.1 (#186) (Greenkeeper) - [
22dfbaf03b
] - release: 1.0.0-rc (#185) (Zachary Golba)
🔅🎊🎈 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.
In addition to features, this release includes bug fixes and general performance improvements.
You can now debug your application rails style with a custom repl that has your application built and loaded as global variables.
To start the repl, run lux console
or lux c
in your
> User.find(1).then(user => {
console.log(`${user.name} is working as expected.`);
});
// => Promise
// 'Stephen Curry is working as expected.'
> PostsController.beforeAction
// => [[Function], [Function], [Function]]
> routes
// => Router {...routes}
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).
These are a few example edge cases where returning a Model or an Array of Models may not be what you want to do.
import { Controller } from 'lux-framework';
class ApplicationController extends Controller {
beforeAction = [
/**
* If any request is sent to this application with `?bad=true` the server
* will respond with 400 (Bad Request) and the latter actions will not be
* called. Otherwise, the request will be handled normally.
*/
function isGood(req) {
if (req.params.bad) {
return 400;
}
}
];
/**
* This will return 204 (No Content) and is equivalent to `return 204`.
*/
health() {
return true;
}
/**
* This will return 401 (Unauthorized) and is equivalent to `return 204`.
*/
topSecret() {
return false;
}
/**
* This will return 200 (OK) with the string 'bar'.
*/
foo() {
return 'bar';
}
/**
* This will return 200 (OK) with the following JSON.
*
* {
* "foo": "bar"
* }
*/
fooJSON() {
return {
foo: 'bar'
};
}
/**
* This will return 404 (Not Found). Returning undefined will also result in
* a 404 unless the function returning undefined is called from beforeAction.
*/
notFound() {
return null;
}
}
export default ApplicationController;
Lux now is 100% compatible with Windows!
NOTE: 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.
-
lux serve
does not start in cluster mode by default. To run your application as a cluster runlux serve -c
orlux serve --cluster
. -
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).
The Lux CLI in 1.0 is not backwards compatible with previous beta versions so please perform a local upgrade before upgrading Lux globally.
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.
// ./app/routes.js
export default function routes() {
this.resource('post');
this.resource('users');
this.route('users/login', {
action: 'login',
method: 'POST'
});
this.route('users/logout', {
action: 'logout',
method: 'DELETE'
});
}
- [
81f52fc1c8
] - feat: add luxify function for converting traditional middleware (#183) (Zachary Golba) - [
39ce152574
] - fix: index names sometimes exceed max length in generated migrations (#182) (Zachary Golba) - [
fb5a71a897
] - feat: add custom repl for debugging (#180) (Zachary Golba) - [
c2b0b30d01
] - feat: do not cluster by default use -c || --cluster (#179) (Zachary Golba) - [
785ebf1c39
] - fix: regression from #177 local lux not being used in cli (#178) (Zachary Golba) - [
67b9940e5c
] - feat: add windows support (#177) (Zachary Golba) - [
c4ab5e0b3b
] - deps: update rollup to version 0.33.0 (#176) (Greenkeeper) - [
a7e860dd97
] - deps: update rollup-plugin-babel to version 2.6.1 (#172) (Greenkeeper) - [
68e7d8fafe
] - deps: update rollup-plugin-json to version 2.0.1 (#173) (Greenkeeper) - [
7abf664c99
] - deps: update rollup-plugin-eslint to version 2.0.2 (#175) (Greenkeeper) - [
f4e17aabf9
] - deps: update rollup-plugin-node-resolve to version 1.7.1 (#174) (Greenkeeper) - [
c2a77c68d5
] - deps: update rollup to version 0.32.4 (#171) (Greenkeeper) - [
b23873109b
] - deps: update rollup-plugin-babel to version 2.6.0 (#169) (Greenkeeper) - [
7ed59ab595
] - deps: update rollup to version 0.32.2 (#168) (Greenkeeper) - [
b25237a647
] - refactor: use process.cwd() instead of process.env.PWD (#167) (Zachary Golba) - [
5bab51a38b
] - deps: update babel-eslint to version 6.1.0 (#165) (Greenkeeper) - [
53cb1e53e2
] - deps: update rollup to version 0.32.1 (#164) (Greenkeeper) - [
022b2e954c
] - deps: upgrade pg version in test-app (#166) (Zachary Golba) - [
ef3f9ce8d3
] - fix: ensure lux is not an external dependency (#163) (Zachary Golba) - [
fba8654d2e
] - deps: update test-app dependencies (#162) (Zachary Golba) - [
84160c9149
] - deps: update babel-core to version 6.10.4 (#161) (Greenkeeper) - [
7ee935afa1
] - deps: update babel-eslint to version 6.0.5 (#160) (Greenkeeper) - [
cd53552aca
] - deps: update eslint to version 2.13.1 (#159) (Greenkeeper) - [
8e6a23dad3
] - refactor: improve build process and stack traces (#158) (Zachary Golba) - [
6748638ca6
] - refactor: rename serializer methods and return objects (#155) (Zachary Golba) - [
7597031076
] - feat: ensure Application#port is a number (#156) (Zachary Golba) - [
2d83f30df6
] - deps: update rollup to version 0.32.0 (#154) (Greenkeeper) - [
64250ebe5b
] - refactor: separate responsibilities in req/res flow (#153) (Zachary Golba)
- [
30a60c10ca
] - chore: bump version to 0.0.1-beta.13 (Zachary Golba) - [
a569225072
] - feat: match ember-data jsonapi pagination implementation (#151) (Zachary Golba) - [
ea4786b791
] - deps: update mysql2 to version 1.0.0-rc.5 in test-app (#150) (Zachary Golba) - [
9b78c19540
] - style: change tabs to spaces in .eslintrc.js (#149) (Zachary Golba) - [
853d81a5d5
] - deps: update bluebird to version 3.4.1 (#147) (Greenkeeper) - [
873f92dcac
] - deps: update eslint to version 2.13.0 (#146) (Greenkeeper)
- [
723c403598
] - feat: generate basic .eslintrc.json withlux new
cmd (Zachary Golba) - [
952fa65db3
] - deps: update rollup to version 0.31.2 (#141) (Greenkeeper) - [
07bdc43db1
] - docs: update CHANGELOG.md (Zachary Golba)
This is the last big set of breaking changes before a stable 1.0.0
release
and moving forward we will strictly follow semantic versioning.
If all goes well in this release the next release will be 1.0.0-rc
and will
only contain a few more features geared towards application profiling.
- [
30f962c003
] - deps: update dependencies (Zachary Golba) - [
b6700be793
] - refactor: move query proxy to initializer function (Zachary Golba) - [
b53c58a06f
] - chore: update examples (Zachary Golba) - [
2d0f2ef941
] - feat: support n:m relationships (Zachary Golba) - [
93e3c0a14b
] - feat: add chainable query interface (Zachary Golba) - [
425b8de4cc
] - feat: use watchman for file watcher with fs.watch fallback (Zachary Golba) - [
97bed29798
] - refactor: remove all decorators from private and public APIs (Zachary Golba) - [
53e257ae66
] - refactor: use lux babel preset (Zachary Golba) - [
2512e857b2
] - refactor: use streams for Logger (Zachary Golba) - [
4341f5cebd
] - refactor: use rollup for build (Zachary Golba) - [
6bc225ac87
] - feat: add file watcher (Zachary Golba) - [
5425c512e8
] - feat: add process manager (Zachary Golba) - [
7d0463a3f0
] - feat: tree-shaking, native es6, and start of HMR work (Zachary Golba) - [
82eab320d2
] - docs: start api documentation (Zachary Golba) - [
7e4a38c781
] - deps: update eslint to version 2.12.0 (#140) (Greenkeeper) - [
6b8b29aea3
] - deps: update eslint to version 2.11.1 (#139) (Greenkeeper) - [
ef8b36cb2f
] - deps: update babel-core to version 6.9.1 (#137) (Greenkeeper) - [
c5c812dc62
] - deps: update eslint to version 2.11.0 (#135) (Greenkeeper) - [
24033dcfb3
] - chore: update eslint config (#133) (Zachary Golba) - [
ed58e7a685
] - deps: update mocha to version 2.5.3 (#132) (Greenkeeper) - [
c76c51b802
] - deps: update mocha to version 2.5.2 (#130) (Greenkeeper)
For the sake of proper namespacing, Lux no longer exports the Application
class as a default
export. To upgrade simply use a named import of
Application
within your ./app/index.js
file.
import { Application } from 'lux-framework';
class MyApp extends Application {
}
export default MyApp;
You could also use a namespaced import of Lux if you are worried about collisions.
import Lux from 'lux-framework';
class MyApp extends Lux.Application {
}
export default MyApp;
Models now support scopes and have a chainable query interface. More docs will
soon be available on this but for now it should be as simple as replacing calls
to Model.findAll
with Model.where
.
Decorators are no longer used to declare custom actions on your controller. For
an easy upgrade simply remove the @action
at the top of your custom actions.
import { Controller } from 'lux-framework';
import Post from '../models/post';
class PostsController extends Controller {
drafts() {
return Post.drafts();
}
}
export default PostsController;
Route declarations no longer support an arrow function export since arrow
functions do not have a name
property.
// ./app/routes.js
export default function routes(route, resource) {
resource('posts');
}
The db seed function no longer support an arrow function export since arrow
functions do not have a name
property.
// ./db/seed.js
export default function seed() {
resource('posts');
}
Config files found in ./config/environments
now only require a single option
log
.
// ./config/environments/development.js
export default {
log: true
};
Lux now uses a special babel preset to only transpile features that are missing from Node 6.X. That means that ~95% of ES2015 syntax is actually using a native implementation. You can expect a performance boost in this release 🐇.
{
"presets": ["lux"]
}
Update your package.json
to only include the following base packages required
for a Lux application (plus the ones you installed yourself).
{
"babel-core": "6.9.1",
"babel-preset-lux": "1.0.0",
"knex": "0.11.5",
"lux-framework": "0.0.1-beta.11",
"sqlite3": "3.1.4"
}
- [
f2b63501c9
] - chore: bump version to 0.0.1-beta.10 (Zachary Golba) - [
00a139653b
] - refactor: use webpack for build (#121) (Zachary Golba) - [
47cfa90f02
] - deps: update mocha to version 2.5.1 (#128) (Greenkeeper) - [
bbf73047eb
] - docs: remove node-orm2 references from ROADMAP.md (#126) (Zachary Golba) - [
4338d05c3b
] - docs: fix broken links in CHANGELOG.md (#125) (Zachary Golba) - [
50c18275a0
] - docs: update code sample in README.md (#124) (Zachary Golba) - [
940b53a7ed
] - chore: add CHANGELOG.md (#123) (Zachary Golba) - [
8837cb5064
] - fix: NODE_ENV is not being passed down to child processes (#122) (Zachary Golba) - [
c9f2aef952
] - feat: confirm overwriting files with lux generate cmd (#120) (Zachary Golba) - [
06dffaf0cd
] - chore: .editorconfig file (#119) (Joan Piedra) - [
a7f191003d
] - feat: improve error handling on missing controller & serializer files (#118) (Joan Piedra) - [
1dd3ab64c4
] - refactor: remove Base package (#117) (Zachary Golba) - [
0f64cc864a
] - fix: hasMany relationships are not eager loading properly (#116) (Zachary Golba) - [
11cb766267
] - fix: select statement not being optimized by fields param (#115) (Zachary Golba) - [
ad3564fc8b
] - fix: pagination links break with an empty table (#114) (Zachary Golba) - [
1b84009543
] - fix: ignore hidden and non .js files in loader (#113) (Joan Piedra) - [
6d97ca7545
] - fix: using ?include is not working with multiple resources (#112) (Zachary Golba) - [
ef8e779867
] - fix: defaultValue is not accounted for in #108 (#111) (Zachary Golba) - [
71a1be6ccc
] - fix: column data not consistent across all dbms (#108) (Zachary Golba) - [
7c897ae0f2
] - fix: multiple 'hasMany' 'type' values are incorrect in serialized data (#109) (Zachary Golba) - [
a03cde5195
] - chore: update example apps (#105) (Zachary Golba) - [
824caab17f
] - deps: update ora to version 0.2.3 (#101) (Greenkeeper)
- [
4002a5a64d
] - chore: bump version to 0.0.1-beta.9 (#97) (Zachary Golba) - [
a7e54aa4da
] - fix: middleware functions added in 'beforeAction' not executing (#95) (Zachary Golba) - [
b16557647e
] - fix: migration generator does not change - to _ (#96) (Zachary Golba) - [
81cdd2108b
] - fix: remove short -db flag from lux new cmd (#93) (Zachary Golba) - [
71f4593fbb
] - refactor: use chalk instead of colors (#92) (Zachary Golba) - [
786872becb
] - fix: config generator uses double quotes (#89) (Zachary Golba) - [
2fb314ad1b
] - deps: update bluebird to version 3.4.0 (#91) (Zachary Golba) - [
d95fb392c2
] - deps: update babel-preset-es2015 to version 6.9.0 (#90) (Zachary Golba) - [
6c7b42ddad
] - deps: update babel-runtime to version 6.9.0 (#88) (Greenkeeper) - [
095d12a100
] - deps: update babel-plugin-transform-runtime to version 6.9.0 (#87) (Greenkeeper) - [
9ef804ecd9
] - deps: update babel-core to version 6.9.0 (#86) (Greenkeeper) - [
23251651e9
] - chore: add keywords to package.json (#81) (Zachary Golba) - [
418cadb662
] - chore: add dependencies badge to README.md (#80) (Zachary Golba) - [
af3e72b73e
] - deps: Update all dependencies 🌴 (#79) (Greenkeeper) - [
2560584a4f
] - chore: update roadmap to reflect changes in #65 (#78) (Zachary Golba)
- [
6416c6c309
] - feat: implement custom orm on top of knex.js (#65) (Zachary Golba) - [
d117376a46
] - test: add sudo and correct g++ version for node 4+ in .travis.yml (#70) (Zachary Golba) - [
9a293bd117
] - feat: use js instead of json for config files (#67) (John-Henry Liberty) - [
720f0e1323
] - test: update travis to use npm link (#68) (John-Henry Liberty) - [
2fc214c045
] - feat: use local lux install if one exists (#66) (Zachary Golba)
- [
e35c430cdc
] - chore: bump version to 0.0.1-beta.7 (#64) (Zachary Golba) - [
ec0b60b191
] - fix: HEAD and OPTIONS request result in a 404 (#63) (Zachary Golba)
- [
4079b07269
] - chore: bump version to 0.0.1-beta.6 (#61) (Zachary Golba) - [
b94c526e87
] - fix: serialize hasMany relationships (#60) (Zachary Golba) - [
2f5aa41c1a
] - chore: test on node 6 (#58) (Zachary Golba) - [
e26a900e43
] - docs: add ROADMAP.md (#57) (Zachary Golba)
- [
8a21b472e0
] - chore: bump version to 0.0.1-beta.5 (#55) (Zachary Golba) - [
909e732b9a
] - chore: update dependencies (#54) (Zachary Golba) - [
47ef4b87a8
] - fix: miss-match session key/secret error (#53) (Zachary Golba) - [
e70a032c0f
] - fix: strings w/ commas interpreted as an array for POST/PATCH (#49) (Zachary Golba) - [
23da23d74d
] - docs: add npm package badge to README (#47) (Zachary Golba) - [
0788e468a6
] - test: add unit/integration tests (#39) (Zachary Golba) - [
498c951917
] - chore: add Gitter badge (#46) (The Gitter Badger)
- [
77dcdbe03b
] - chore: bump version to 0.0.1-beta.4 (#45) (Zachary Golba) - [
7c529fa235
] - fix: correct typo in README (#44) (Nic Young) - [
0880a71d89
] - fix: globally disable orm2 cache (Zachary Golba) - [
0bd7c8dfde
] - fix: make ora a runtime dependency (#40) (Zachary Golba) - [
30ca0c27d5
] - feat: add spinner for long running task (#38) (Albert Yu)
- [
03958b98d1
] - chore: bump version to 0.0.1-beta.3 (#37) (Zachary Golba) - [
10b782be1f
] - fix: logger date incorrect (#35) (kev5873) - [
e9897371be
] - chore: Link to Medium Article in Readme (#33) (Zachary Golba)
- [
c073253cd0
] - fix: listening message dispatched before workers are ready (#34) (Zachary Golba)
- [
5a734e79ce
] - fix: shebang line not finding node on linux (#32) (Zachary Golba)
- [
4a193b86d2
] - Initial Commit (Zachary Golba)