Skip to content

Commit

Permalink
Merge pull request #20345 from emberjs/remove-flags-for-released-feat…
Browse files Browse the repository at this point in the history
…ures

Remove flags for released features
  • Loading branch information
ef4 committed Jan 7, 2023
2 parents 7736b91 + 30e0d76 commit ba31276
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 175 deletions.
12 changes: 4 additions & 8 deletions FEATURES.md
Expand Up @@ -5,12 +5,8 @@ for a detailed explanation.

## Feature Flags

* `EMBER_DEFAULT_HELPER_MANAGER`
<!--
* `FLAG_NAME_HERE`
Provides a default manager for unrecognized helpers as specified in
[RFC-756](https://github.com/emberjs/rfcs/blob/master/text/0756-helper-default-manager.md).

* `EMBER_UNIQUE_ID_HELPER`

Provides a `{{unique-id}} helper as specified in
[RFC-659](https://github.com/emberjs/rfcs/blob/master/text/0659-unique-id-helper.md).
Flag description here.
-->
3 changes: 1 addition & 2 deletions packages/@ember/-internals/glimmer/lib/environment.ts
Expand Up @@ -3,7 +3,6 @@ import { get, set, _getProp, _setProp } from '@ember/-internals/metal';
import type { InternalOwner } from '@ember/-internals/owner';
import { getDebugName } from '@ember/-internals/utils';
import { constructStyleDeprecationMessage } from '@ember/-internals/views';
import { EMBER_DEFAULT_HELPER_MANAGER } from '@ember/canary-features';
import { assert, deprecate, warn } from '@ember/debug';
import type { DeprecationOptions } from '@ember/debug';
import { schedule, _backburner } from '@ember/runloop';
Expand All @@ -21,7 +20,7 @@ import toBool from './utils/to-bool';

setGlobalContext({
FEATURES: {
DEFAULT_HELPER_MANAGER: Boolean(EMBER_DEFAULT_HELPER_MANAGER),
DEFAULT_HELPER_MANAGER: true,
},

scheduleRevalidate() {
Expand Down
6 changes: 1 addition & 5 deletions packages/@ember/-internals/glimmer/lib/resolver.ts
Expand Up @@ -2,7 +2,6 @@ import { privatize as P } from '@ember/-internals/container';
import { ENV } from '@ember/-internals/environment';
import type { InternalFactory, InternalOwner, RegisterOptions } from '@ember/-internals/owner';
import { isFactory } from '@ember/-internals/owner';
import { EMBER_UNIQUE_ID_HELPER } from '@ember/canary-features';
import { assert } from '@ember/debug';
import { _instrumentStart } from '@ember/instrumentation';
import { DEBUG } from '@glimmer/env';
Expand Down Expand Up @@ -132,6 +131,7 @@ const BUILTIN_HELPERS: Record<string, object> = {
fn,
get,
hash,
'unique-id': uniqueId,
};

if (DEBUG) {
Expand All @@ -148,10 +148,6 @@ if (DEBUG) {
BUILTIN_HELPERS['-disallow-dynamic-resolution'] = disallowDynamicResolution;
}

if (EMBER_UNIQUE_ID_HELPER) {
BUILTIN_HELPERS['unique-id'] = uniqueId;
}

const BUILTIN_KEYWORD_MODIFIERS: Record<string, ModifierDefinitionState> = {
action: actionModifier,
};
Expand Down
Expand Up @@ -6,7 +6,7 @@ import { action } from '@ember/object';
moduleFor(
'Helpers test: default helper manager',
class extends RenderingTestCase {
'@feature(EMBER_DEFAULT_HELPER_MANAGER) plain functions can be used as helpers'() {
'@test plain functions can be used as helpers'() {
function hello() {
return 'hello';
}
Expand All @@ -20,9 +20,7 @@ moduleFor(
this.assertText('hello');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) positional arguments are passed as function arguments'(
assert
) {
'@test positional arguments are passed as function arguments'(assert) {
function hello(...args) {
assert.deepEqual(args, [1, 2, 3]);
return args.length;
Expand All @@ -34,7 +32,7 @@ moduleFor(
this.assertText('3');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) tracks changes to positional arguments'(assert) {
'@test tracks changes to positional arguments'(assert) {
let count = 0;

function hello(firstArgument) {
Expand All @@ -60,9 +58,7 @@ moduleFor(
this.assertText('456');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) named arguments are passed as the last function argument'(
assert
) {
'@test named arguments are passed as the last function argument'(assert) {
function hello(positional, named) {
assert.strictEqual(positional, 'foo');

Expand All @@ -75,7 +71,7 @@ moduleFor(
this.assertText('bar');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) tracks changes to named arguments'(assert) {
'@test tracks changes to named arguments'(assert) {
let count = 0;

function hello(named) {
Expand All @@ -101,7 +97,7 @@ moduleFor(
this.assertText('456');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) plain functions passed as component arguments can be used as helpers'() {
'@test plain functions passed as component arguments can be used as helpers'() {
function hello() {
return 'hello';
}
Expand All @@ -114,7 +110,7 @@ moduleFor(
this.assertText('hello');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) plain functions stored as class properties can be used as helpers'() {
'@test plain functions stored as class properties can be used as helpers'() {
this.registerComponent('foo-bar', {
template: '{{(this.hello)}}',
ComponentClass: class extends Component {
Expand All @@ -128,7 +124,7 @@ moduleFor(
this.assertText('hello');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) class methods can be used as helpers'() {
'@test class methods can be used as helpers'() {
this.registerComponent('foo-bar', {
template: '{{(this.hello)}}',
ComponentClass: class extends Component {
Expand All @@ -142,7 +138,7 @@ moduleFor(
this.assertText('hello');
}

'@feature(EMBER_DEFAULT_HELPER_MANAGER) actions can be used as helpers'() {
'@test actions can be used as helpers'() {
this.registerComponent('foo-bar', {
template: '{{(this.hello)}}',
ComponentClass: class extends Component {
Expand Down
Expand Up @@ -4,7 +4,6 @@ import { Helper, helper, Component as EmberComponent } from '@ember/-internals/g
import { tracked } from '@ember/-internals/metal';
import { set } from '@ember/object';
import { getOwner } from '@ember/-internals/owner';
import { EMBER_DEFAULT_HELPER_MANAGER } from '@ember/canary-features';
import Service, { service } from '@ember/service';
import { DEBUG } from '@glimmer/env';
import { getValue } from '@glimmer/validator';
Expand Down Expand Up @@ -444,17 +443,6 @@ moduleFor(
invokeHelper(undefined, class extends Helper {});
}, /Expected a context object to be passed as the first parameter to invokeHelper, got undefined/);
}

'@test asserts if no manager exists for the helper definition'(assert) {
if (!DEBUG || EMBER_DEFAULT_HELPER_MANAGER) {
assert.expect(0);
return;
}

assert.throws(() => {
invokeHelper({}, class {});
}, /Attempted to load a helper, but there wasn't a helper manager associated with the definition. The definition was:/);
}
}
);

Expand Down

0 comments on commit ba31276

Please sign in to comment.