Skip to content

Commit

Permalink
Merge pull request #15915 from thoov/remove-render
Browse files Browse the repository at this point in the history
[CLEANUP] Remove {{render}}
  • Loading branch information
rwjblue authored Dec 13, 2017
2 parents 27204b0 + ce61c5d commit ab5e69e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/ember-glimmer/lib/syntax.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { assert } from 'ember-debug';
import { ENV } from 'ember-environment';
import { textAreaMacro } from './syntax/-text-area';
import {
blockComponentMacro,
Expand Down Expand Up @@ -65,7 +66,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 ab5e69e

Please sign in to comment.