├── app └── .gitkeep ├── addon └── .gitkeep ├── vendor └── .gitkeep ├── tests ├── unit │ ├── .gitkeep │ ├── view-class-deprecation-is-silenced-test.js │ ├── select-class-deprecation-is-silenced-test.js │ ├── view-select-deprecation-is-silenced-test.js │ └── view-helper-deprecation-is-silenced-test.js ├── dummy │ ├── app │ │ ├── helpers │ │ │ └── .gitkeep │ │ ├── models │ │ │ └── .gitkeep │ │ ├── routes │ │ │ └── .gitkeep │ │ ├── styles │ │ │ └── app.css │ │ ├── views │ │ │ └── .gitkeep │ │ ├── components │ │ │ └── .gitkeep │ │ ├── controllers │ │ │ └── .gitkeep │ │ ├── templates │ │ │ ├── components │ │ │ │ └── .gitkeep │ │ │ └── application.hbs │ │ ├── router.js │ │ ├── app.js │ │ └── index.html │ ├── public │ │ ├── robots.txt │ │ └── crossdomain.xml │ └── config │ │ └── environment.js ├── test-helper.js ├── helpers │ ├── resolver.js │ └── start-app.js ├── .jshintrc └── index.html ├── .watchmanconfig ├── .bowerrc ├── index.js ├── blueprints ├── view │ ├── index.js │ └── files │ │ └── __root__ │ │ └── __path__ │ │ └── __name__.js └── view-test │ ├── files │ └── __root__ │ │ └── __path__ │ │ └── __name__.js │ └── index.js ├── .npmignore ├── config ├── environment.js └── ember-try.js ├── testem.json ├── .ember-cli ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Brocfile.js ├── bower.json ├── .jshintrc ├── .travis.yml ├── .editorconfig ├── LICENSE.md ├── package.json └── README.md /app/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addon/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/views/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp"] 3 | } 4 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

Welcome to Ember.js

2 | 3 | {{outlet}} 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 'use strict'; 3 | 4 | module.exports = { 5 | name: 'ember-legacy-views' 6 | }; 7 | -------------------------------------------------------------------------------- /blueprints/view/index.js: -------------------------------------------------------------------------------- 1 | /*jshint node:true*/ 2 | 3 | module.exports = { 4 | description: 'Generates a view subclass.' 5 | }; 6 | -------------------------------------------------------------------------------- /blueprints/view/files/__root__/__path__/__name__.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.View.extend({ 4 | }); 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower_components/ 2 | tests/ 3 | tmp/ 4 | dist/ 5 | 6 | .bowerrc 7 | .editorconfig 8 | .ember-cli 9 | .travis.yml 10 | .npmignore 11 | **/.gitkeep 12 | bower.json 13 | Brocfile.js 14 | testem.json 15 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node:true */ 2 | 'use strict'; 3 | 4 | module.exports = function(/* environment, appConfig */) { 5 | return { 6 | EmberENV: { 7 | _ENABLE_LEGACY_VIEW_SUPPORT: true 8 | } 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { 3 | setResolver 4 | } from 'ember-qunit'; 5 | 6 | import Ember from 'ember'; 7 | 8 | Ember.ENV.RAISE_ON_DEPRECATION = true; 9 | 10 | setResolver(resolver); 11 | -------------------------------------------------------------------------------- /testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework": "qunit", 3 | "test_page": "tests/index.html?hidepassed", 4 | "disable_watching": true, 5 | "launch_in_ci": [ 6 | "PhantomJS" 7 | ], 8 | "launch_in_dev": [ 9 | "PhantomJS", 10 | "Chrome" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | var Router = Ember.Router.extend({ 5 | location: config.locationType 6 | }); 7 | 8 | Router.map(function() { 9 | }); 10 | 11 | export default Router; 12 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember/resolver'; 2 | import config from '../../config/environment'; 3 | 4 | var resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/* 15 | /libpeerconnection.log 16 | npm-debug.log 17 | testem.log 18 | -------------------------------------------------------------------------------- /blueprints/view-test/files/__root__/__path__/__name__.js: -------------------------------------------------------------------------------- 1 | import { moduleFor, test } from 'ember-qunit'; 2 | 3 | moduleFor('view:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>'); 4 | 5 | // Replace this with your real tests. 6 | test('it exists', function(assert) { 7 | let view = this.subject(); 8 | assert.ok(view); 9 | }); 10 | -------------------------------------------------------------------------------- /blueprints/view-test/index.js: -------------------------------------------------------------------------------- 1 | /*jshint node:true*/ 2 | 3 | var testInfo = require('ember-cli-test-info'); 4 | 5 | module.exports = { 6 | description: 'Generates a view unit test.', 7 | locals: function(options) { 8 | return { 9 | friendlyTestDescription: testInfo.description(options.entity.name, 'Unit', 'View') 10 | }; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | The Ember team and community are committed to everyone having a safe and inclusive experience. 2 | 3 | **Our Community Guidelines / Code of Conduct can be found here**: 4 | 5 | http://emberjs.com/guidelines/ 6 | 7 | For a history of updates, see the page history here: 8 | 9 | https://github.com/emberjs/website/commits/master/source/guidelines.html.erb 10 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from 'ember/resolver'; 3 | import loadInitializers from 'ember/load-initializers'; 4 | import config from './config/environment'; 5 | 6 | var App; 7 | 8 | Ember.MODEL_FACTORY_INJECTIONS = true; 9 | 10 | App = Ember.Application.extend({ 11 | modulePrefix: config.modulePrefix, 12 | podModulePrefix: config.podModulePrefix, 13 | Resolver: Resolver 14 | }); 15 | 16 | loadInitializers(App, config.modulePrefix); 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /Brocfile.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | /* global require, module */ 3 | 4 | var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 5 | 6 | /* 7 | This Brocfile specifes the options for the dummy test app of this 8 | addon, located in `/tests/dummy` 9 | 10 | This Brocfile does *not* influence how the addon or the app using it 11 | behave. You most likely want to be modifying `./index.js` or app's Brocfile 12 | */ 13 | 14 | var app = new EmberAddon(); 15 | app.import(app.bowerDirectory + '/ember/ember-template-compiler.js'); 16 | 17 | module.exports = app.toTree(); 18 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Application from '../../app'; 3 | import Router from '../../router'; 4 | import config from '../../config/environment'; 5 | 6 | export default function startApp(attrs) { 7 | var application; 8 | 9 | var attributes = Ember.merge({}, config.APP); 10 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; 11 | 12 | Ember.run(function() { 13 | application = Application.create(attributes); 14 | application.setupForTesting(); 15 | application.injectTestHelpers(); 16 | }); 17 | 18 | return application; 19 | } 20 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-legacy-views", 3 | "dependencies": { 4 | "ember": "canary", 5 | "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", 6 | "ember-cli-test-loader": "ember-cli-test-loader#0.1.3", 7 | "ember-data": "1.0.0-beta.18", 8 | "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4", 9 | "ember-qunit": "0.3.3", 10 | "ember-qunit-notifications": "0.0.7", 11 | "ember-resolver": "~0.1.15", 12 | "jquery": "^1.11.1", 13 | "loader.js": "ember-cli/loader.js#3.2.0", 14 | "qunit": "~1.17.1" 15 | }, 16 | "resolutions": { 17 | "ember": "canary" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "-Promise" 6 | ], 7 | "browser": true, 8 | "boss": true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | - "0.12" 5 | 6 | sudo: false 7 | 8 | cache: 9 | directories: 10 | - node_modules 11 | 12 | env: 13 | - EMBER_TRY_SCENARIO=default 14 | - EMBER_TRY_SCENARIO=ember-v1.12 15 | - EMBER_TRY_SCENARIO=ember-release 16 | - EMBER_TRY_SCENARIO=ember-beta 17 | 18 | matrix: 19 | fast_finish: true 20 | 21 | before_install: 22 | - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH 23 | - "npm config set spin false" 24 | - "npm install -g npm@^2" 25 | 26 | install: 27 | - npm install -g bower 28 | - npm install 29 | - bower install 30 | 31 | script: 32 | - ember try $EMBER_TRY_SCENARIO test 33 | -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.hbs] 21 | insert_final_newline = false 22 | indent_style = space 23 | indent_size = 2 24 | 25 | [*.css] 26 | indent_style = space 27 | indent_size = 2 28 | 29 | [*.html] 30 | indent_style = space 31 | indent_size = 2 32 | 33 | [*.{diff,md}] 34 | trim_trailing_whitespace = false 35 | -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | 12 | 13 | 14 | 15 | {{content-for 'head-footer'}} 16 | 17 | 18 | {{content-for 'body'}} 19 | 20 | 21 | 22 | 23 | {{content-for 'body-footer'}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/unit/view-class-deprecation-is-silenced-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | 3 | import Ember from 'ember'; 4 | 5 | module('Ember.View'); 6 | 7 | test('does not issue deprecation on create', function(assert){ 8 | assert.expect(1); 9 | 10 | try { 11 | Ember.View.create(); 12 | } catch(e) { 13 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 14 | } 15 | 16 | assert.ok(true, 'No deprecation is thrown'); 17 | }); 18 | 19 | test('does not issue deprecation on reopen', function(assert){ 20 | assert.expect(1); 21 | 22 | try { 23 | Ember.View.reopen(); 24 | } catch(e) { 25 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 26 | } 27 | 28 | assert.ok(true, 'No deprecation is thrown'); 29 | }); 30 | -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | scenarios: [ 3 | { 4 | name: 'default', 5 | dependencies: { } 6 | }, 7 | { 8 | name: 'ember-v1.12', 9 | dependencies: { 10 | 'ember': 'components/ember#1.12.0' 11 | }, 12 | resolutions: { 13 | 'ember': '1.12.0' 14 | } 15 | }, 16 | { 17 | name: 'ember-release', 18 | dependencies: { 19 | 'ember': 'components/ember#release' 20 | }, 21 | resolutions: { 22 | 'ember': 'release' 23 | } 24 | }, 25 | { 26 | name: 'ember-beta', 27 | dependencies: { 28 | 'ember': 'components/ember#beta' 29 | }, 30 | resolutions: { 31 | 'ember': 'beta' 32 | } 33 | }, 34 | { 35 | name: 'ember-canary', 36 | dependencies: { 37 | 'ember': 'components/ember#canary' 38 | }, 39 | resolutions: { 40 | 'ember': 'canary' 41 | } 42 | } 43 | ] 44 | }; 45 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "location", 6 | "setTimeout", 7 | "$", 8 | "-Promise", 9 | "define", 10 | "console", 11 | "visit", 12 | "exists", 13 | "fillIn", 14 | "click", 15 | "keyEvent", 16 | "triggerEvent", 17 | "find", 18 | "findWithAssert", 19 | "wait", 20 | "DS", 21 | "andThen", 22 | "currentURL", 23 | "currentPath", 24 | "currentRouteName" 25 | ], 26 | "node": false, 27 | "browser": false, 28 | "boss": true, 29 | "curly": false, 30 | "debug": false, 31 | "devel": false, 32 | "eqeqeq": true, 33 | "evil": true, 34 | "forin": false, 35 | "immed": false, 36 | "laxbreak": false, 37 | "newcap": true, 38 | "noarg": true, 39 | "noempty": false, 40 | "nonew": false, 41 | "nomen": false, 42 | "onevar": false, 43 | "plusplus": false, 44 | "regexp": false, 45 | "undef": true, 46 | "sub": true, 47 | "strict": false, 48 | "white": false, 49 | "eqnull": true, 50 | "esnext": true 51 | } 52 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | {{content-for 'test-head'}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for 'head-footer'}} 18 | {{content-for 'test-head-footer'}} 19 | 20 | 21 | 22 | {{content-for 'body'}} 23 | {{content-for 'test-body'}} 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for 'body-footer'}} 31 | {{content-for 'test-body-footer'}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /tests/unit/select-class-deprecation-is-silenced-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | 3 | import Ember from 'ember'; 4 | 5 | module('Ember.Select'); 6 | 7 | test('does not issue deprecation on create', function(assert){ 8 | assert.expect(1); 9 | 10 | try { 11 | Ember.Select.create(); 12 | } catch(e) { 13 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 14 | } 15 | 16 | assert.ok(true, 'No deprecation is thrown'); 17 | }); 18 | 19 | test('does not issue deprecation on reopen', function(assert){ 20 | assert.expect(1); 21 | 22 | try { 23 | Ember.Select.reopen(); 24 | } catch(e) { 25 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 26 | } 27 | 28 | assert.ok(true, 'No deprecation is thrown'); 29 | }); 30 | 31 | test('does not issue deprecation on extend', function(assert){ 32 | assert.expect(1); 33 | 34 | try { 35 | Ember.Select.extend(); 36 | } catch(e) { 37 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 38 | } 39 | 40 | assert.ok(true, 'No deprecation is thrown'); 41 | }); 42 | -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function(environment) { 4 | var ENV = { 5 | modulePrefix: 'dummy', 6 | environment: environment, 7 | baseURL: '/', 8 | locationType: 'auto', 9 | EmberENV: { 10 | FEATURES: { 11 | // Here you can enable experimental features on an ember canary build 12 | // e.g. 'with-controller': true 13 | } 14 | }, 15 | 16 | APP: { 17 | // Here you can pass flags/options to your application instance 18 | // when it is created 19 | } 20 | }; 21 | 22 | if (environment === 'development') { 23 | // ENV.APP.LOG_RESOLVER = true; 24 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 25 | // ENV.APP.LOG_TRANSITIONS = true; 26 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 27 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 28 | } 29 | 30 | if (environment === 'test') { 31 | // Testem prefers this... 32 | ENV.baseURL = '/'; 33 | ENV.locationType = 'none'; 34 | 35 | // keep test console output quieter 36 | ENV.APP.LOG_ACTIVE_GENERATION = false; 37 | ENV.APP.LOG_VIEW_LOOKUPS = false; 38 | 39 | ENV.APP.rootElement = '#ember-testing'; 40 | } 41 | 42 | if (environment === 'production') { 43 | 44 | } 45 | 46 | return ENV; 47 | }; 48 | -------------------------------------------------------------------------------- /tests/unit/view-select-deprecation-is-silenced-test.js: -------------------------------------------------------------------------------- 1 | import hbs from 'htmlbars-inline-precompile'; 2 | import { module, test } from 'qunit'; 3 | 4 | import Ember from 'ember'; 5 | 6 | let component; 7 | 8 | module('{{view "select"}}', { 9 | teardown() { 10 | if (component) { 11 | Ember.run(function() { 12 | component.destroy(); 13 | }); 14 | } 15 | } 16 | }); 17 | 18 | test('does not issue deprecation when appended', function(assert){ 19 | assert.expect(1); 20 | 21 | let registry = new Ember.Registry(); 22 | registry.register('view:select', Ember.Select); 23 | registry.register('component:some-component', Ember.Component.extend({ 24 | layout: hbs`{{view 'select'}}` 25 | })); 26 | let container = registry.container(); 27 | component = container.lookup('component:some-component'); 28 | 29 | try { 30 | Ember.run(function() { 31 | component.appendTo('#qunit-fixture'); 32 | }); 33 | assert.ok(true, 'No deprecation is thrown'); 34 | } catch(e) { 35 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 36 | } 37 | }); 38 | 39 | test('does not issue deprecation when compiled', function(assert){ 40 | assert.expect(1); 41 | 42 | try { 43 | Ember.HTMLBars.compile('{{view "select"}}'); 44 | assert.ok(true, 'No deprecation is issued.'); 45 | } catch(e) { 46 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /tests/unit/view-helper-deprecation-is-silenced-test.js: -------------------------------------------------------------------------------- 1 | import hbs from 'htmlbars-inline-precompile'; 2 | import { module, test } from 'qunit'; 3 | 4 | import Ember from 'ember'; 5 | 6 | let component; 7 | 8 | module('{{view "some-view"}}', { 9 | teardown() { 10 | if (component) { 11 | Ember.run(function() { 12 | component.destroy(); 13 | }); 14 | } 15 | } 16 | }); 17 | 18 | test('does not issue deprecation on invocation', function(assert) { 19 | assert.expect(1); 20 | 21 | let registry = new Ember.Registry(); 22 | registry.register('view:some-view', Ember.View.extend()); 23 | registry.register('component:some-component', Ember.Component.extend({ 24 | layout: hbs`{{view 'some-view'}}` 25 | })); 26 | let container = registry.container(); 27 | component = container.lookup('component:some-component'); 28 | 29 | try { 30 | Ember.run(function() { 31 | component.appendTo('#qunit-fixture'); 32 | }); 33 | assert.ok(true, 'No deprecation is thrown'); 34 | } catch(e) { 35 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 36 | } 37 | }); 38 | 39 | test('does not issue deprecation when compiled', function(assert) { 40 | assert.expect(1); 41 | 42 | try { 43 | Ember.HTMLBars.compile('{{view "foo"}}'); 44 | assert.ok(true, 'No deprecation is issued.'); 45 | } catch(e) { 46 | assert.ok(false, `An error was thrown unexpectedly: ${e.message}`); 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-legacy-views", 3 | "version": "0.2.0", 4 | "description": "The default blueprint for ember-cli addons.", 5 | "directories": { 6 | "doc": "doc", 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "start": "ember server", 11 | "build": "ember build", 12 | "test": "ember try:testall" 13 | }, 14 | "repository": "https://github.com/emberjs/ember-legacy-views", 15 | "engines": { 16 | "node": ">= 0.10.0" 17 | }, 18 | "author": "", 19 | "license": "MIT", 20 | "devDependencies": { 21 | "broccoli-asset-rev": "^2.0.2", 22 | "ember-cli": "0.2.7", 23 | "ember-cli-app-version": "0.3.3", 24 | "ember-cli-content-security-policy": "0.4.0", 25 | "ember-cli-dependency-checker": "^1.0.0", 26 | "ember-cli-htmlbars": "0.7.9", 27 | "ember-cli-htmlbars-inline-precompile": "^0.1.0", 28 | "ember-cli-ic-ajax": "0.1.1", 29 | "ember-cli-inject-live-reload": "^1.3.0", 30 | "ember-cli-qunit": "0.3.13", 31 | "ember-cli-uglify": "^1.0.1", 32 | "ember-data": "1.0.0-beta.18", 33 | "ember-disable-prototype-extensions": "^1.0.0", 34 | "ember-disable-proxy-controllers": "^1.0.0", 35 | "ember-export-application-global": "^1.0.2", 36 | "ember-try": "0.0.6" 37 | }, 38 | "keywords": [ 39 | "ember-addon" 40 | ], 41 | "dependencies": { 42 | "ember-cli-babel": "^5.0.0" 43 | }, 44 | "ember-addon": { 45 | "configPath": "tests/dummy/config" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/emberjs/ember-legacy-views.svg)](https://travis-ci.org/emberjs/ember-legacy-views) 2 | 3 | ## ember-legacy-views 4 | 5 | Ember.js 1.13 deprecated the `Ember.View` API and its associated helpers. 6 | Please see the [deprecation guide](http://emberjs.com/deprecations/v1.x/#toc_ember-view) 7 | for information about how to migrate away from views in Ember.js. 8 | 9 | This addon enables legacy view support without deprecation notices in Ember.js 1.13. 10 | In Ember.js 2.0 views are not present at all, and this addon brings them back. 11 | **After Ember 2.4 is released this addon will no longer be compatible with 12 | Ember**. It should be used to provide extra time for migrating away from views, 13 | not as a permanent solution. 14 | 15 | To remove the compile-time deprecation warnings that may appear in the terminal 16 | output of `ember serve`, make sure your Ember-CLI app is using `ember-cli-htmlbars` 17 | version `0.7.9` or later (this will be the default for Ember-CLI version 1.13.0 and later). 18 | 19 | ### App Installation 20 | 21 | ``` 22 | ember install ember-legacy-views 23 | ``` 24 | 25 | ### Contributing to this Addon 26 | 27 | * `git clone` this repository 28 | * `npm install` 29 | * `bower install` 30 | 31 | ### Running Tests 32 | 33 | * `ember test` 34 | * `ember test --server` 35 | 36 | ### Building and Release 37 | 38 | * `npm version TYPE` where TYPE is `major`, `minor` or `patch` 39 | 40 | For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/). 41 | --------------------------------------------------------------------------------