Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANUP beta] Remove legacy view related exports. #13315

Merged
merged 1 commit into from
Apr 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions packages/ember-views/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ import {
getViewBoundingClientRect
} from 'ember-views/system/utils';
import 'ember-views/system/ext'; // for the side effect of extending Ember.run.queues
import {
cloneStates,
states
} from 'ember-views/views/states';

import { Renderer } from 'ember-metal-views';
import { DeprecatedCoreView } from 'ember-views/views/core_view';
import { DeprecatedView } from 'ember-views/views/view';
import Component from 'ember-views/components/component';

import EventDispatcher from 'ember-views/system/event_dispatcher';
Expand Down Expand Up @@ -50,14 +44,6 @@ ViewUtils.isSimpleClick = isSimpleClick;
ViewUtils.getViewClientRects = getViewClientRects;
ViewUtils.getViewBoundingClientRect = getViewBoundingClientRect;

if (Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
Ember.CoreView = DeprecatedCoreView;
Ember.View = DeprecatedView;
Ember.View.states = states;
Ember.View.cloneStates = cloneStates;
Ember.View._Renderer = Renderer;
}

Ember._Renderer = Renderer;

Ember.Checkbox = Checkbox;
Expand Down
12 changes: 1 addition & 11 deletions packages/ember-views/lib/views/core_view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, deprecate } from 'ember-metal/debug';
import { assert } from 'ember-metal/debug';
import { get } from 'ember-metal/property_get';

import EmberObject from 'ember-runtime/system/object';
Expand Down Expand Up @@ -128,16 +128,6 @@ CoreView.reopenClass({
isViewFactory: true
});

export var DeprecatedCoreView = CoreView.extend({
init() {
deprecate(
'Ember.CoreView is deprecated. Please use Ember.View.',
false, { id: 'ember-views.core-view', until: '2.4.0' }
);
this._super(...arguments);
}
});

var _domHelper;
function domHelper() {
return _domHelper = _domHelper || require('ember-htmlbars/system/dom-helper').default;
Expand Down
30 changes: 1 addition & 29 deletions packages/ember-views/lib/views/view.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// jQuery, Ember.lookup,
// Ember.ENV
import Ember from 'ember-metal/core';
import { deprecate } from 'ember-metal/debug';

import 'ember-views/system/ext'; // for the side effect of extending Ember.run.queues

import CoreView from 'ember-views/views/core_view';
Expand Down Expand Up @@ -733,31 +730,6 @@ View.reopenClass({
views: {}
});

function viewDeprecationMessage() {
deprecate(
`Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy.`,
!!Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT,
{
url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view',
id: 'ember-views.view-deprecated',
until: '2.4.0'
}
);
}

var DeprecatedView = View.extend({
init() {
viewDeprecationMessage();
this._super(...arguments);
}
});

DeprecatedView.reopen = function() {
viewDeprecationMessage();
View.reopen(...arguments);
return this;
};

export default View;

export { ViewContextSupport, ViewChildViewsSupport, ViewStateSupport, TemplateRenderingSupport, ClassNamesSupport, DeprecatedView };
export { ViewContextSupport, ViewChildViewsSupport, ViewStateSupport, TemplateRenderingSupport, ClassNamesSupport };
17 changes: 1 addition & 16 deletions packages/ember-views/tests/views/view_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { computed } from 'ember-metal/computed';
import run from 'ember-metal/run_loop';
import jQuery from 'ember-views/system/jquery';
import EmberView, { DeprecatedView } from 'ember-views/views/view';
import EmberView from 'ember-views/views/view';
import { compile } from 'ember-template-compiler';

import { registerKeyword, resetKeyword } from 'ember-htmlbars/tests/utils';
Expand Down Expand Up @@ -164,18 +164,3 @@ QUnit.test('propagates dependent-key invalidated bindings upstream', function()
});

}

QUnit.module('DeprecatedView');

QUnit.test('calling reopen on DeprecatedView delegates to View', function() {
expect(2);
var originalReopen = EmberView.reopen;
var obj = {};

EmberView.reopen = function(arg) { ok(arg === obj); };

expectNoDeprecation();
DeprecatedView.reopen(obj);

EmberView.reopen = originalReopen;
});
20 changes: 1 addition & 19 deletions tests/node/app-boot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if (appModule.canRunTests) {
});

QUnit.test("lifecycle hooks disabled", function(assert) {
assert.expect(2);
assert.expect(1);

this.template('application', "{{my-component}}{{outlet}}");

Expand All @@ -107,24 +107,6 @@ if (appModule.canRunTests) {
}
});

this.view('index', {
_willRender: function() {
assert.ok(true, "should trigger view _willRender hook");
},
didRender: function() {
assert.ok(false, "should not trigger didRender hook");
},
willInsertElement: function() {
assert.ok(false, "should not trigger willInsertElement hook");
},
didCreateElement: function() {
assert.ok(false, "should not trigger didCreateElement hook");
},
didInsertElement: function() {
assert.ok(false, "should not trigger didInsertElement hook");
}
});

return this.renderToHTML('/');
});
}
14 changes: 1 addition & 13 deletions tests/node/helpers/app-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@ if (canRunTests) {

/*jshint -W079 */
global.EmberENV = {
FEATURES: features,
// Views are disabled but can be re-enabled via an addon.
// This flag simulates the addon so we can verify those
// views remain compatible with FastBoot. This can
// be removed in Ember 2.4 when view support is dropped
// entirely.
_ENABLE_LEGACY_VIEW_SUPPORT: true
FEATURES: features
};
}

Expand All @@ -103,7 +97,6 @@ module.exports = function(moduleName) {
this.controller = registerController;
this.route = registerRoute;
this.service = registerService;
this.view = registerView;
this.routes = registerRoutes;
this.registry = {};
this.renderToHTML = renderToHTML;
Expand Down Expand Up @@ -216,11 +209,6 @@ function registerService(name, serviceProps) {
this.register('service:'+name, service);
}

function registerView(name, viewProps) {
var view = this.Ember.View.extend(viewProps);
this.register('view:'+name, view);
}

function registerRoutes(cb) {
this.routesCallback = cb;
}