Commit 779ab09b authored by Miguel Camba's avatar Miguel Camba Committed by Addy Osmani

Update to Ember 2.10 and use HashLocation (#1722)

parent 0a0af214
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
"examples/binding-scala/js/*.js", "examples/binding-scala/js/*.js",
"examples/duel/www/**", "examples/duel/www/**",
"examples/duel/src/main/webapp/js/lib/**", "examples/duel/src/main/webapp/js/lib/**",
"examples/ember-cli/todomvc/dist/**/*.js", "examples/emberjs/todomvc/dist/**/*.js",
"examples/ember-cli/todomvc/testem.js", "examples/emberjs/todomvc/testem.js",
"examples/ember-cli/assets/**/*.js", "examples/emberjs/assets/**/*.js",
"examples/elm/build/elm.js", "examples/elm/build/elm.js",
"examples/elm/elm-stuff/**", "examples/elm/elm-stuff/**",
"examples/humble/js/**", "examples/humble/js/**",
......
...@@ -13,22 +13,8 @@ insert_final_newline = true ...@@ -13,22 +13,8 @@ insert_final_newline = true
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
[*.js]
indent_style = space
indent_size = 2
[*.hbs] [*.hbs]
insert_final_newline = false insert_final_newline = false
indent_style = space
indent_size = 2
[*.css]
indent_style = space
indent_size = 2
[*.html]
indent_style = space
indent_size = 2
[*.{diff,md}] [*.{diff,md}]
trim_trailing_whitespace = false trim_trailing_whitespace = false
# See http://help.github.com/ignore-files/ for more about ignoring files. # See https://help.github.com/ignore-files/ for more about ignoring files.
# compiled output # compiled output
# /dist # /dist
...@@ -13,5 +13,5 @@ ...@@ -13,5 +13,5 @@
/connect.lock /connect.lock
/coverage/* /coverage/*
/libpeerconnection.log /libpeerconnection.log
npm-debug.log npm-debug.log*
testem.log testem.log
...@@ -27,6 +27,6 @@ ...@@ -27,6 +27,6 @@
"strict": false, "strict": false,
"white": false, "white": false,
"eqnull": true, "eqnull": true,
"esnext": true, "esversion": 6,
"unused": true "unused": true
} }
...@@ -7,12 +7,15 @@ sudo: false ...@@ -7,12 +7,15 @@ sudo: false
cache: cache:
directories: directories:
- node_modules - $HOME/.npm
- $HOME/.cache # includes bowers cache
before_install: before_install:
- npm config set spin false - npm config set spin false
- npm install -g bower - npm install -g bower
- bower --version
- npm install phantomjs-prebuilt - npm install phantomjs-prebuilt
- node_modules/phantomjs-prebuilt/bin/phantomjs --version
install: install:
- npm install - npm install
......
...@@ -6,19 +6,19 @@ ...@@ -6,19 +6,19 @@
<title>Todomvc</title> <title>Todomvc</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/examples/ember-cli/index.html" />
{{content-for "head"}} {{content-for "head"}}
<link rel="stylesheet" href="assets/vendor.css"> <link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="assets/todomvc.css"> <link rel="stylesheet" href="{{rootURL}}assets/todomvc.css">
{{content-for "head-footer"}} {{content-for "head-footer"}}
</head> </head>
<body> <body>
{{content-for "body"}} {{content-for "body"}}
<script src="assets/vendor.js"></script> <script src="{{rootURL}}assets/vendor.js"></script>
<script src="assets/todomvc.js"></script> <script src="{{rootURL}}assets/todomvc.js"></script>
{{content-for "body-footer"}} {{content-for "body-footer"}}
</body> </body>
......
...@@ -2,7 +2,8 @@ import Ember from 'ember'; ...@@ -2,7 +2,8 @@ import Ember from 'ember';
import config from './config/environment'; import config from './config/environment';
const Router = Ember.Router.extend({ const Router = Ember.Router.extend({
location: config.locationType location: config.locationType,
rootURL: config.rootURL
}); });
Router.map(function () { Router.map(function () {
......
{ {
"name": "todomvc", "name": "todomvc",
"dependencies": { "dependencies": {
"ember": "~2.6.0", "ember": "~2.10.0",
"ember-cli-shims": "0.1.1", "ember-cli-shims": "0.1.3"
"ember-cli-test-loader": "0.2.2",
"ember-qunit-notifications": "0.1.0"
} }
} }
...@@ -5,11 +5,15 @@ module.exports = function (environment) { ...@@ -5,11 +5,15 @@ module.exports = function (environment) {
modulePrefix: 'todomvc', modulePrefix: 'todomvc',
environment: environment, environment: environment,
baseURL: null, baseURL: null,
locationType: 'auto', locationType: 'hash',
EmberENV: { EmberENV: {
FEATURES: { FEATURES: {
// Here you can enable experimental features on an ember canary build // Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true // e.g. 'with-controller': true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
} }
}, },
...@@ -29,7 +33,7 @@ module.exports = function (environment) { ...@@ -29,7 +33,7 @@ module.exports = function (environment) {
if (environment === 'test') { if (environment === 'test') {
// Testem prefers this... // Testem prefers this...
ENV.baseURL = '/'; ENV.rootURL = '/';
ENV.locationType = 'none'; ENV.locationType = 'none';
// keep test console output quieter // keep test console output quieter
......
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
<title>Todomvc</title> <title>Todomvc</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/examples/emberjs/index.html" />
<meta name="todomvc/config/environment" content="%7B%22modulePrefix%22%3A%22todomvc%22%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3Anull%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22todomvc%22%2C%22version%22%3A%220.0.0+b72d5e59%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D" />
<meta name="todomvc/config/environment" content="%7B%22modulePrefix%22%3A%22todomvc%22%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3Anull%2C%22locationType%22%3A%22hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22todomvc%22%2C%22version%22%3A%220.0.0+47754603%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D" />
<link rel="stylesheet" href="assets/vendor-7b5c98520910afa58d74e05ec86cd873.css">
<link rel="stylesheet" href="assets/todomvc-d41d8cd98f00b204e9800998ecf8427e.css">
<link rel="stylesheet" href="assets/vendor-7b5c98520910afa58d74e05ec86cd873.css" integrity="sha256-bsagGHduhay9QPLUFpddcZFq7Kmr2ScM3VKnWhdX8oM= sha512-eNsGN2aLecWPvoqNVH8oXK8o/IJ7rO5ti0zgS8lF8LiwmKUHdEIuFduwcDL1VLAt2r+3YjgDzoSNYK6c57pJzw==" >
<link rel="stylesheet" href="assets/todomvc-d41d8cd98f00b204e9800998ecf8427e.css" integrity="sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= sha512-z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==" >
</head> </head>
<body> <body>
<script src="assets/vendor-22a6a947beb9d4b28a782879e18b0f65.js" integrity="sha256-M1pD1q8B9PyrHkKX/mlfsOLLHMrh/x7vvCGLRC63OyI= sha512-I4vC6+4Z29iHB4nJBCzcIjrgMtDerq7sxYLE2lM/AhjkNLp6gf2+Zpne8OtGdTLRkyvTqzPm1V7gq9w4HQxOXg==" ></script>
<script src="assets/todomvc-d191d5c1c9280b108d69413f052d3bb4.js" integrity="sha256-1wUxToLQP6yjsvm0/8e3xQnv7SbSYcj3P/OPEdThZOk= sha512-X5K7gsPRYsUSRvJcnj80SLlclDd4X/g1Qgle1L1P4Zb63eUM0mYEfQECBcjcks7iZFItSGr8EVPOVELXO35HUA==" ></script>
<script src="assets/vendor-fe6aaf6bf08a00247e9bb45b00c6c98c.js"></script>
<script src="assets/todomvc-abee913429a66e32e34b282e3460218c.js"></script>
</body> </body>
</html> </html>
...@@ -2,41 +2,42 @@ ...@@ -2,41 +2,42 @@
"name": "todomvc", "name": "todomvc",
"version": "0.0.0", "version": "0.0.0",
"description": "Small description for todomvc goes here", "description": "Small description for todomvc goes here",
"private": true, "license": "MIT",
"author": "Miguel Camba",
"directories": { "directories": {
"doc": "doc", "doc": "doc",
"test": "tests" "test": "tests"
}, },
"repository": "",
"scripts": { "scripts": {
"build": "ember build", "build": "ember build",
"start": "ember server", "start": "ember server",
"test": "ember test" "test": "ember test"
}, },
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": { "devDependencies": {
"broccoli-asset-rev": "^2.4.2", "broccoli-asset-rev": "^2.4.5",
"ember-ajax": "0.7.1", "ember-ajax": "^2.4.1",
"ember-cli": "2.5.0", "ember-cli": "^2.10.0",
"ember-cli-app-version": "^1.0.0", "ember-cli-app-version": "^2.0.0",
"ember-cli-babel": "^5.1.6", "ember-cli-babel": "^5.1.7",
"ember-cli-dependency-checker": "^1.2.0", "ember-cli-dependency-checker": "^1.3.0",
"ember-cli-htmlbars": "^1.0.3", "ember-cli-htmlbars": "^1.0.10",
"ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-htmlbars-inline-precompile": "^0.3.3",
"ember-cli-inject-live-reload": "^1.4.0", "ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-jshint": "^1.0.0", "ember-cli-jshint": "^2.0.1",
"ember-cli-qunit": "^1.4.0", "ember-cli-qunit": "^3.0.1",
"ember-cli-release": "0.2.8", "ember-cli-release": "^0.2.9",
"ember-cli-sri": "^2.1.0", "ember-cli-sri": "^2.1.0",
"ember-cli-test-loader": "^1.1.0",
"ember-cli-uglify": "^1.2.0", "ember-cli-uglify": "^1.2.0",
"ember-export-application-global": "^1.0.5", "ember-export-application-global": "^1.0.5",
"ember-inflector": "1.9.4", "ember-inflector": "1.9.6",
"ember-load-initializers": "^0.5.1", "ember-load-initializers": "^0.5.1",
"ember-resolver": "^2.0.3", "ember-resolver": "^2.0.3",
"loader.js": "^4.0.1" "loader.js": "^4.0.10"
} },
"engines": {
"node": ">= 0.12.0"
},
"private": true
} }
...@@ -47,6 +47,6 @@ ...@@ -47,6 +47,6 @@
"strict": false, "strict": false,
"white": false, "white": false,
"eqnull": true, "eqnull": true,
"esnext": true, "esversion": 6,
"unused": true "unused": true
} }
import { module } from 'qunit'; import { module } from 'qunit';
import Ember from 'ember';
import startApp from '../helpers/start-app'; import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app'; import destroyApp from '../helpers/destroy-app';
const { RSVP: { Promise } } = Ember;
export default function (name, options = {}) { export default function (name, options = {}) {
module(name, { module(name, {
beforeEach() { beforeEach() {
...@@ -13,10 +16,8 @@ export default function (name, options = {}) { ...@@ -13,10 +16,8 @@ export default function (name, options = {}) {
}, },
afterEach() { afterEach() {
if (options.afterEach) { let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
options.afterEach.apply(this, arguments); return Promise.resolve(afterEach).then(() => destroyApp(this.application));
}
destroyApp(this.application);
} }
}); });
} }
...@@ -5,8 +5,8 @@ import config from '../../config/environment'; ...@@ -5,8 +5,8 @@ import config from '../../config/environment';
export default function startApp(attrs) { export default function startApp(attrs) {
let application; let application;
let attributes = Ember.merge({}, config.APP); // use defaults, but you can override
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; let attributes = Ember.assign({}, config.APP, attrs);
Ember.run(() => { Ember.run(() => {
application = Application.create(attributes); application = Application.create(attributes);
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
{{content-for "head"}} {{content-for "head"}}
{{content-for "test-head"}} {{content-for "test-head"}}
<link rel="stylesheet" href="assets/vendor.css"> <link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="assets/todomvc.css"> <link rel="stylesheet" href="{{rootURL}}assets/todomvc.css">
<link rel="stylesheet" href="assets/test-support.css"> <link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
{{content-for "head-footer"}} {{content-for "head-footer"}}
{{content-for "test-head-footer"}} {{content-for "test-head-footer"}}
...@@ -21,12 +21,11 @@ ...@@ -21,12 +21,11 @@
{{content-for "body"}} {{content-for "body"}}
{{content-for "test-body"}} {{content-for "test-body"}}
<script src="testem.js" integrity=""></script> <script src="/testem.js" integrity=""></script>
<script src="assets/vendor.js"></script> <script src="{{rootURL}}assets/vendor.js"></script>
<script src="assets/test-support.js"></script> <script src="{{rootURL}}assets/test-support.js"></script>
<script src="assets/todomvc.js"></script> <script src="{{rootURL}}assets/todomvc.js"></script>
<script src="assets/tests.js"></script> <script src="{{rootURL}}assets/tests.js"></script>
<script src="assets/test-loader.js"></script>
{{content-for "body-footer"}} {{content-for "body-footer"}}
{{content-for "test-body-footer"}} {{content-for "test-body-footer"}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment