Skip to content

Commit

Permalink
[CLEANUP] Remove {{render}}
Browse files Browse the repository at this point in the history
  • Loading branch information
thoov committed Dec 5, 2017
1 parent d5f57aa commit 43a81c0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/ember-glimmer/lib/syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export function registerMacros(macro: any) {
export function populateMacros(blocks: any, inlines: any) {
inlines.add('outlet', outletMacro);
inlines.add('component', inlineComponentMacro);
inlines.add('render', renderMacro);

if (ENV._ENABLE_RENDER_SUPPORT === true) {
inlines.add('render', renderMacro);
}

inlines.add('mount', mountMacro);
inlines.add('input', inputMacro);
inlines.add('textarea', textAreaMacro);
Expand Down
2 changes: 2 additions & 0 deletions packages/ember-glimmer/lib/syntax/render.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
@module ember
Remove after 3.4 once _ENABLE_RENDER_SUPPORT flag is no longer needed.
*/

import { ConstReference, isConst } from '@glimmer/reference';
Expand Down
12 changes: 12 additions & 0 deletions packages/ember-glimmer/tests/integration/helpers/render-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { observer, set, computed } from 'ember-metal';
import { Controller } from 'ember-runtime';
import { ENV } from 'ember-environment';
import { RenderingTest, moduleFor } from '../../utils/test-case';

moduleFor('Helpers test: {{render}}', class extends RenderingTest {
constructor() {
super();
this.originalRenderSupport = ENV._ENABLE_RENDER_SUPPORT;
ENV._ENABLE_RENDER_SUPPORT = true;
}

teardown() {
super.teardown();
ENV._ENABLE_RENDER_SUPPORT = this.originalRenderSupport;
}

['@test should render given template']() {
this.registerTemplate('home', '<p>BYE</p>');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { deprecate } from 'ember-debug';
import calculateLocationDisplay from
'../system/calculate-location-display';

/*
* Remove after 3.4 once _ENABLE_RENDER_SUPPORT flag is no
* longer needed.
*/
export default function deprecateRenderModel(env) {
let { moduleName } = env.meta;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { deprecate } from 'ember-debug';
import calculateLocationDisplay from '../system/calculate-location-display';

/*
* Remove after 3.4 once _ENABLE_RENDER_SUPPORT flag is no
* longer needed.
*/
export default function deprecateRender(env) {
let { moduleName } = env.meta;

Expand Down
7 changes: 6 additions & 1 deletion packages/ember/tests/routing/basic_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ import {
setTemplate
} from 'ember-glimmer';
import { jQuery } from 'ember-views';
import { ENV } from 'ember-environment';
import { compile } from 'ember-template-compiler';
import { Application, Engine } from 'ember-application';
import { Transition } from 'router';

let trim = jQuery.trim;

let Router, App, router, registry, container, originalLoggerError;
let Router, App, router, registry, container, originalLoggerError, originalRenderSupport;

function bootApplication() {
router = container.lookup('router:main');
Expand Down Expand Up @@ -100,6 +101,9 @@ QUnit.module('Basic Routing', {
setTemplate('camelot', compile('<section><h3>Is a silly place</h3></section>'));

originalLoggerError = Logger.error;
originalRenderSupport = ENV._ENABLE_RENDER_SUPPORT;

ENV._ENABLE_RENDER_SUPPORT = true;
});
},

Expand All @@ -110,6 +114,7 @@ QUnit.module('Basic Routing', {

setTemplates({});
Logger.error = originalLoggerError;
ENV._ENABLE_RENDER_SUPPORT = originalRenderSupport;
});
}
});
Expand Down

0 comments on commit 43a81c0

Please sign in to comment.