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] Remove {{render}} #15915

Merged
merged 2 commits into from
Dec 13, 2017
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
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ENV is not imported (thats what one of the test failures indicated at least)..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thoov - I think fixing this will fix CI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue Yep that fixed it. Should be good to go now

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