Skip to content

Commit

Permalink
Major Refactor
Browse files Browse the repository at this point in the history
- major restructuring of code
- better handling of complex corner cases of pivoting
- query params rewrite
- es6ify
- smaller, more focused tests

Paired w @twokul on the ES6 stuff
  • Loading branch information
machty committed Dec 30, 2013
1 parent 0a521d5 commit 5f59a11
Show file tree
Hide file tree
Showing 54 changed files with 6,257 additions and 8,661 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.bundle
/dist
/tmp
/node_modules
9 changes: 6 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"predef": [
"console",
"Router",
"define",
"require",
"requireModule",
"equal",
"test",
"testBoth",
Expand All @@ -14,13 +15,15 @@
"ok",
"strictEqual",
"module",
"expect",
"QUnit",
"expect"
],

"node" : false,
"node" : true,
"browser" : true,

"boss" : true,
"esnext" : true,
"curly": false,
"debug": false,
"devel": false,
Expand Down
25 changes: 10 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
---
env:
global:
- S3_BUCKET_NAME=routerjs.builds.emberjs.com
- secure: ! 'TafdUQgYdnuj20fSRX9pv8hGsPG5PkNs8Nq+j5IYoZnD2FSNFdzq1o9mwEsS
KxhHOGDn/ZVw+GzxfZksLr1CfdwqbXtUPDrpHIG1JHrZ3cbYQ9U6vY7uY5GJ
xypZPhqzHkN8D4RG+NY7mbKtxYsMsH/G15u6qsquixTyWe1VlIw='
- secure: ! 'YG1i+TUkEmTpFxwgNjkE4AYrzEdM+1QAX/cRSrno8xJoo3dSQMoFxtF46V6B
4yqfe/+pNQtUjC8P0ooOxeuE4QLQ8GoWNpPwvsYeXC+jIcT/YZWTTtAjS7ss
tThLHIl+R69ejdQggC2WbaN8Co20CvsdtW5v7ZOBoaW4+DZLBAI='
after_success: 'bundle exec rake publish'
language: node_js
node_js:
- '0.10'
before_install:
- npm install -g grunt-cli
env:
global:
- secure: QZR44UCwwszJZ81cofiYtGFsLLmHOTAthS+XIgnxzztBRWjcivrfO+v55J39umwkYWqcBIxhTf4e3SALxB2QwLLb0KP17lRheEXd4fJP68UIYhQzOUHJYM+wm+WyWamJf61h5n3lp9Kf75EQrr50aTO0WYeReCLgpeq57p5F20Y=
- secure: SQaq0nDaew5Jwm1yB480Iln4/6Sg2n46q7zoanYect+vQNrKWJGcJGMp5Jq9mbDiDZLRpdazAGWyUQJRLaTLfosEx6V798dECDqkCue3hHY96AggYZQnXLh0QKnHeSVjN9Jr1x8wHkxMmvAG3zXkbhuPhD8hYOycJJLg4GLvXAo=
after_success: grunt build s3:dev
6 changes: 0 additions & 6 deletions Gemfile

This file was deleted.

35 changes: 0 additions & 35 deletions Gemfile.lock

This file was deleted.

35 changes: 35 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = function(grunt) {
var config = require('load-grunt-config')(grunt, {
configPath: 'tasks/options',
init: false
});

grunt.loadTasks('tasks');

this.registerTask('default', ['build']);

// Run client-side tests on the command line.
this.registerTask('test', 'Runs tests through the command line using PhantomJS', [
'build', 'tests', 'qunit'
]);

// Run a server. This is ideal for running the QUnit tests in the browser.
this.registerTask('server', ['build', 'tests', 'connect', 'watch:server']);


// Build test files
this.registerTask('tests', 'Builds the test package', ['concat:deps',
'transpile:testsAmd', 'transpile:testsCommonjs', 'buildTests:dist']);

// Build a new version of the library
this.registerTask('build', 'Builds a distributable version of <%= cfg.name %>',
['clean', 'transpile:amd', 'transpile:commonjs', 'concat:amdNoVersion',
'concat:browser', 'browser:distNoVersion', 'jshint', 'uglify:browserNoVersion']);

config.env = process.env;
config.pkg = grunt.file.readJSON('package.json');
// Load custom tasks from NPM
grunt.loadNpmTasks('grunt-browserify');
// Merge config into emberConfig, overwriting existing settings
grunt.initConfig(config);
};
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ to provide an API for handling routes.
In keeping with the Unix philosophy, it is a modular library
that does one thing and does it well.

`router.js` is the routing microlib used by
[Ember.js](https://github.com/emberjs/ember.js).

## Downloads

Passing builds of the 'master' branch will be automatically pubilshed to S3.
Expand Down Expand Up @@ -582,20 +585,10 @@ prefer routes with fewer dynamic segments, so
`/posts/edit` will match in preference to `/posts/:id`
if both match.
## More to Come
`router.js` is functional today. I plan to add more features
before a first official release:
* ~~A `failure` handler if any of the promises are rejected~~
* ~~An `exit` callback on a handler when the app navigates
to a page no longer represented by the handler~~
* Improved hooks for external libraries that manage the
physical URL.
* Testing support
* ~~The ability to dispatch events to the current handler
or parent handlers.~~
## Architecture
`router.js` will be the basis for the router in Ember.js.
Please read [this gist](https://gist.github.com/machty/7698646)
for an overview on `router.js`'s architecture, particularly if
you are interested in contributing to this project.
[builds-page]: http://routerjs.builds.emberjs.com.s3-website-us-east-1.amazonaws.com/index.html
170 changes: 0 additions & 170 deletions Rakefile

This file was deleted.

Loading

0 comments on commit 5f59a11

Please sign in to comment.