language
stringclasses 1
value | owner
stringlengths 2
15
| repo
stringlengths 2
21
| sha
stringlengths 45
45
| message
stringlengths 7
36.3k
| path
stringlengths 1
199
| patch
stringlengths 15
102k
| is_multipart
bool 2
classes |
---|---|---|---|---|---|---|---|
Other
|
emberjs
|
ember.js
|
255bd2860a5968484b3891a0e1c822da5643a634.json
|
remove debug stack
|
packages/@ember/-internals/glimmer/lib/component-managers/mount.ts
|
@@ -80,10 +80,6 @@ class MountManager extends AbstractManager<EngineState, EngineDefinitionState>
}
create(environment: Environment, { name }: EngineDefinitionState, args: Arguments) {
- if (DEBUG) {
- environment.debugStack.pushEngine(`engine:${name}`);
- }
-
// TODO
// mount is a runtime helper, this shouldn't use dynamic layout
// we should resolve the engine app template in the helper
@@ -172,10 +168,6 @@ class MountManager extends AbstractManager<EngineState, EngineDefinitionState>
}
didRenderLayout(bucket: EngineState, bounds: Bounds): void {
- if (DEBUG) {
- bucket.environment.debugStack.pop();
- }
-
if (ENV._DEBUG_RENDER_TREE) {
bucket.environment.debugRenderTree.didRender(bucket.controller, bounds);
bucket.environment.debugRenderTree.didRender(bucket, bounds);
| true |
Other
|
emberjs
|
ember.js
|
255bd2860a5968484b3891a0e1c822da5643a634.json
|
remove debug stack
|
packages/@ember/-internals/glimmer/lib/component-managers/outlet.ts
|
@@ -5,7 +5,6 @@ import { assert } from '@ember/debug';
import EngineInstance from '@ember/engine/instance';
import { _instrumentStart } from '@ember/instrumentation';
import { assign } from '@ember/polyfills';
-import { DEBUG } from '@glimmer/env';
import { ComponentCapabilities, Option, Simple } from '@glimmer/interfaces';
import { CONSTANT_TAG, createTag, Tag, VersionedPathReference } from '@glimmer/reference';
import {
@@ -76,10 +75,6 @@ class OutletComponentManager extends AbstractManager<OutletInstanceState, Outlet
args: Arguments,
dynamicScope: DynamicScope
): OutletInstanceState {
- if (DEBUG) {
- environment.debugStack.push(`template:${definition.template.referrer.moduleName}`);
- }
-
let parentStateRef = dynamicScope.outletState;
let currentStateRef = definition.ref;
@@ -167,10 +162,6 @@ class OutletComponentManager extends AbstractManager<OutletInstanceState, Outlet
didRenderLayout(state: OutletInstanceState, bounds: Bounds): void {
state.finalize();
- if (DEBUG) {
- state.environment.debugStack.pop();
- }
-
if (ENV._DEBUG_RENDER_TREE) {
state.environment.debugRenderTree.didRender(state, bounds);
| true |
Other
|
emberjs
|
ember.js
|
255bd2860a5968484b3891a0e1c822da5643a634.json
|
remove debug stack
|
packages/@ember/-internals/glimmer/lib/component-managers/root.ts
|
@@ -40,10 +40,6 @@ class RootComponentManager extends CurlyComponentManager {
) {
let component = this.component;
- if (DEBUG) {
- environment.debugStack.push((component as any)._debugContainerKey);
- }
-
let finalizer = _instrumentStart('render.component', initialRenderInstrumentDetails, component);
dynamicScope.view = component;
| true |
Other
|
emberjs
|
ember.js
|
255bd2860a5968484b3891a0e1c822da5643a634.json
|
remove debug stack
|
packages/@ember/-internals/glimmer/lib/environment.ts
|
@@ -10,7 +10,6 @@ import {
SimpleDynamicAttribute,
} from '@glimmer/runtime';
import { Destroyable, Opaque } from '@glimmer/util';
-import getDebugStack, { DebugStack } from './utils/debug-stack';
import createIterable from './utils/iterable';
import { ConditionalReference, UpdatableReference } from './utils/references';
import { isHTMLSafe } from './utils/string';
@@ -35,7 +34,6 @@ export default class Environment extends GlimmerEnvironment {
public isInteractive: boolean;
public destroyedComponents: Destroyable[];
- private _debugStack: DebugStack | undefined;
private _debugRenderTree: DebugRenderTree | undefined;
public inTransaction = false;
@@ -52,23 +50,11 @@ export default class Environment extends GlimmerEnvironment {
installPlatformSpecificProtocolForURL(this);
- if (DEBUG) {
- this._debugStack = getDebugStack();
- }
-
if (ENV._DEBUG_RENDER_TREE) {
this._debugRenderTree = new DebugRenderTree();
}
}
- get debugStack(): DebugStack {
- if (DEBUG) {
- return this._debugStack!;
- } else {
- throw new Error("Can't access debug stack outside of debug mode");
- }
- }
-
get debugRenderTree(): DebugRenderTree {
if (ENV._DEBUG_RENDER_TREE) {
return this._debugRenderTree!;
| true |
Other
|
emberjs
|
ember.js
|
255bd2860a5968484b3891a0e1c822da5643a634.json
|
remove debug stack
|
packages/@ember/-internals/glimmer/lib/utils/debug-stack.ts
|
@@ -1,75 +0,0 @@
-// @ts-check
-
-import { DEBUG } from '@glimmer/env';
-
-export interface DebugStack {
- push(name: string): void;
- pushEngine(name: string): void;
- pop(): string | void;
- peek(): string | void;
-}
-
-let getDebugStack: () => DebugStack = () => {
- throw new Error("Can't access the DebugStack class outside of debug mode");
-};
-
-if (DEBUG) {
- class Element {
- constructor(public name: string) {}
- }
-
- class TemplateElement extends Element {}
- class EngineElement extends Element {}
-
- let DebugStackImpl = class DebugStackImpl implements DebugStack {
- private _stack: TemplateElement[] = [];
-
- push(name: string) {
- this._stack.push(new TemplateElement(name));
- }
-
- pushEngine(name: string) {
- this._stack.push(new EngineElement(name));
- }
-
- pop(): string | void {
- let element = this._stack.pop();
-
- if (element) {
- return element.name;
- }
- }
-
- peek(): string | void {
- let template = this._currentTemplate();
- let engine = this._currentEngine();
-
- if (engine) {
- return `"${template}" (in "${engine}")`;
- } else if (template) {
- return `"${template}"`;
- }
- }
-
- _currentTemplate() {
- return this._getCurrentByType(TemplateElement);
- }
-
- _currentEngine() {
- return this._getCurrentByType(EngineElement);
- }
-
- _getCurrentByType(type: any): string | void {
- for (let i = this._stack.length; i >= 0; i--) {
- let element = this._stack[i];
- if (element instanceof type) {
- return element.name;
- }
- }
- }
- };
-
- getDebugStack = () => new DebugStackImpl();
-}
-
-export default getDebugStack;
| true |
Other
|
emberjs
|
ember.js
|
255bd2860a5968484b3891a0e1c822da5643a634.json
|
remove debug stack
|
packages/@ember/-internals/glimmer/lib/utils/references.ts
|
@@ -136,6 +136,9 @@ export class RootPropertyReference extends PropertyReference
super();
if (DEBUG) {
+ // Capture the stack when this reference is created, as that is the
+ // component/context that the component was created _in_. Later, it could
+ // be accessed from any number of components.
this.debugStackLog = env ? env.debugRenderTree.logCurrentRenderStack() : '';
}
| true |
Other
|
emberjs
|
ember.js
|
255bd2860a5968484b3891a0e1c822da5643a634.json
|
remove debug stack
|
packages/@ember/-internals/glimmer/tests/unit/utils/debug-stack-test.js
|
@@ -1,39 +0,0 @@
-import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
-
-import { getDebugStack } from '@ember/-internals/glimmer';
-import { DEBUG } from '@glimmer/env';
-
-moduleFor(
- 'Glimmer DebugStack',
- class extends AbstractTestCase {
- ['@test pushing and popping'](assert) {
- if (DEBUG) {
- let stack = getDebugStack(this.owner);
-
- assert.equal(stack.peek(), undefined);
-
- stack.push('template:application');
-
- assert.equal(stack.peek(), '"template:application"');
-
- stack.push('component:top-level-component');
-
- assert.equal(stack.peek(), '"component:top-level-component"');
-
- stack.pushEngine('engine:my-engine');
- stack.push('component:component-in-engine');
-
- assert.equal(stack.peek(), '"component:component-in-engine" (in "engine:my-engine")');
-
- stack.pop();
- stack.pop();
- let item = stack.pop();
-
- assert.equal(item, 'component:top-level-component');
- assert.equal(stack.peek(), '"template:application"');
- } else {
- assert.expect(0);
- }
- }
- }
-);
| true |
Other
|
emberjs
|
ember.js
|
fbae785fefebc8935e33315e23e76682a42fbd75.json
|
Add v3.15.0-beta.3 to CHANGELOG
[ci skip]
(cherry picked from commit 7583e14df41a44d8b85487e8862a8016c8e1563e)
|
CHANGELOG.md
|
@@ -1,5 +1,9 @@
# Ember Changelog
+### v3.15.0-beta.3 (November 18, 2019)
+
+- [#18549](https://github.com/emberjs/ember.js/pull/18549) [BUGFIX] Add component reference to the mouse event handler deprecation warnings
+
### v3.15.0-beta.2 (November 11, 2019)
- [#18539](https://github.com/emberjs/ember.js/pull/18539) [BUGFIX] Add ID to `CapturedRenderNode`
| false |
Other
|
emberjs
|
ember.js
|
e7b2c13be897e3af9df4af7aa7885b9d0529d465.json
|
Correct version number.
Co-Authored-By: Robert Jackson <[email protected]>
|
packages/@ember/deprecated-features/index.ts
|
@@ -16,4 +16,4 @@ export const FUNCTION_PROTOTYPE_EXTENSIONS = !!'3.11.0-beta.1';
export const MOUSE_ENTER_LEAVE_MOVE_EVENTS = !!'3.13.0-beta.1';
export const EMBER_COMPONENT_IS_VISIBLE = !!'3.15.0-beta.1';
export const PARTIALS = !!'3.15.0-beta.1';
-export const GLOBALS_RESOLVER = !!'3.16.0';
+export const GLOBALS_RESOLVER = !!'3.16.0-beta.1';
| false |
Other
|
emberjs
|
ember.js
|
cb39f507fc8ce2dcb840d3e845d90a9a2e677400.json
|
remove test entries
|
tests/docs/expected.js
|
@@ -83,7 +83,6 @@ module.exports = {
'appendTo',
'application',
'apply',
- 'args',
'ariaRole',
'arrangedContent',
'array',
@@ -136,7 +135,6 @@ module.exports = {
'computed',
'concat',
'concatenatedProperties',
- 'constructor',
'container',
'containerDebugAdapter',
'content',
| false |
Other
|
emberjs
|
ember.js
|
c7e5fdbc6cbfeb04de12b88f833aed4719330502.json
|
CHANGELOG: Fix broken link syntax
|
CHANGELOG.md
|
@@ -16,7 +16,7 @@
### v3.14.0 (October 29, 2019)
-- [#18345](https://github.com/emberjs/ember.js/pull/18345) / [#18363](https://github.com/emberjs/ember.js/pull/18363) [FEATURE] Implement the [Provide @model named argument to route templates](https://github.com/emberjs/rfcs/blob/master/text/0523-model-argument-for-route-templates.md RFC.
+- [#18345](https://github.com/emberjs/ember.js/pull/18345) / [#18363](https://github.com/emberjs/ember.js/pull/18363) [FEATURE] Implement the [Provide @model named argument to route templates](https://github.com/emberjs/rfcs/blob/master/text/0523-model-argument-for-route-templates.md) RFC.
- [#18458](https://github.com/emberjs/ember.js/pull/18458) [BUGFIX] Using query params helper outside of link-to
- [#18429](https://github.com/emberjs/ember.js/pull/18429) [BUGFIX] Fix incorrect error message for octane features.
- [#18415](https://github.com/emberjs/ember.js/pull/18415) [BUGFIX] Fix hbs import path in test blueprint.
| false |
Other
|
emberjs
|
ember.js
|
05adb58132238ddf73149f35bbb4a93c53be943a.json
|
remove unreachable code (#18483)
remove unreachable code
|
packages/@ember/-internals/glimmer/lib/utils/references.ts
|
@@ -37,7 +37,7 @@ import {
PrimitiveReference,
UNDEFINED_REFERENCE,
} from '@glimmer/runtime';
-import { Option, unreachable } from '@glimmer/util';
+import { Option } from '@glimmer/util';
import { HelperFunction, HelperInstance, RECOMPUTE_TAG } from '../helper';
import emberToBool from './to-bool';
@@ -505,8 +505,6 @@ export function referenceFromParts(
return reference;
}
-type Primitive = undefined | null | boolean | number | string;
-
function isObject(value: unknown): value is object {
return value !== null && typeof value === 'object';
}
@@ -515,7 +513,7 @@ function isFunction(value: unknown): value is Function {
return typeof value === 'function';
}
-function isPrimitive(value: unknown): value is Primitive {
+function ensurePrimitive(value: unknown) {
if (DEBUG) {
let label;
@@ -534,8 +532,6 @@ function isPrimitive(value: unknown): value is Primitive {
typeof value === 'string'
);
}
-
- return true;
}
function valueToRef<T = unknown>(value: T, bound = true): VersionedPathReference<T> {
@@ -545,25 +541,9 @@ function valueToRef<T = unknown>(value: T, bound = true): VersionedPathReference
} else if (isFunction(value)) {
// ember doesn't do observing with functions
return new UnboundReference(value);
- } else if (isPrimitive(value)) {
- return PrimitiveReference.create(value);
- } else if (DEBUG) {
- let type = typeof value;
- let output: Option<string>;
-
- try {
- output = String(value);
- } catch (e) {
- output = null;
- }
-
- if (output) {
- throw unreachable(`[BUG] Unexpected ${type} (${output})`);
- } else {
- throw unreachable(`[BUG] Unexpected ${type}`);
- }
} else {
- throw unreachable();
+ ensurePrimitive(value);
+ return PrimitiveReference.create(value as any);
}
}
@@ -574,24 +554,8 @@ function valueKeyToRef(value: unknown, key: string): VersionedPathReference<Opaq
} else if (isFunction(value)) {
// ember doesn't do observing with functions
return new UnboundReference(value[key]);
- } else if (isPrimitive(value)) {
- return UNDEFINED_REFERENCE;
- } else if (DEBUG) {
- let type = typeof value;
- let output: Option<string>;
-
- try {
- output = String(value);
- } catch (e) {
- output = null;
- }
-
- if (output) {
- throw unreachable(`[BUG] Unexpected ${type} (${output})`);
- } else {
- throw unreachable(`[BUG] Unexpected ${type}`);
- }
} else {
- throw unreachable();
+ ensurePrimitive(value);
+ return UNDEFINED_REFERENCE;
}
}
| false |
Other
|
emberjs
|
ember.js
|
7cf8f50e11cbd1c2e975e9f77bb84847511fd314.json
|
Add v3.15.0-beta.2 to CHANGELOG
[ci skip]
(cherry picked from commit d17a783a504536e24736b9cc9ee7973bbc60687c)
|
CHANGELOG.md
|
@@ -1,5 +1,9 @@
# Ember Changelog
+### v3.15.0-beta.2 (November 11, 2019)
+
+- [#18539](https://github.com/emberjs/ember.js/pull/18539) [BUGFIX] Add ID to `CapturedRenderNode`
+
### v3.15.0-beta.1 (October 31, 2019)
- [#17948](https://github.com/emberjs/ember.js/pull/17948) [DEPRECATION] Deprecate `Component#isVisible` per [RFC #324](https://github.com/emberjs/rfcs/blob/master/text/0324-deprecate-component-isvisible.md).
| false |
Other
|
emberjs
|
ember.js
|
1a1c1e703f65454c5626dfe0902129fdd6ff7646.json
|
Add v3.15.0-beta.1 to CHANGELOG
[ci skip]
(cherry picked from commit 197e21530bdd2864c8e4e9b08996bd9dc4a50982)
|
CHANGELOG.md
|
@@ -1,5 +1,11 @@
# Ember Changelog
+### v3.15.0-beta.1 (October 31, 2019)
+
+- [#17948](https://github.com/emberjs/ember.js/pull/17948) [DEPRECATION] Deprecate `Component#isVisible` per [RFC #324](https://github.com/emberjs/rfcs/blob/master/text/0324-deprecate-component-isvisible.md).
+- [#18491](https://github.com/emberjs/ember.js/pull/18491) [DEPRECATION] Deprecate `{{partial}}` per [RFC #449](https://github.com/emberjs/rfcs/blob/master/text/0449-deprecate-partials.md).
+- [#18441](https://github.com/emberjs/ember.js/pull/18441) [DEPRECATION] Deprecate window.ENV
+
### v3.14.1 (October 30, 2019)
- [#18244](https://github.com/emberjs/ember.js/pull/18244) [BUGFIX] Fix query param assertion when using the router services `transitionTo` to redirect _during_ an existing transition.
| false |
Other
|
emberjs
|
ember.js
|
7e22ae3ced97db1b37596d40ca25f2f26fd61042.json
|
Apply suggestions from code review
Co-Authored-By: Ricardo Mendes <[email protected]>
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -664,15 +664,19 @@ const ArrayMixin = Mixin.create(Enumerable, {
let foods = [
{ name: 'apple', eaten: false },
{ name: 'banana', eaten: false },
- { name: carrot': eaten: false }
+ { name: 'carrot', eaten: false }
];
foods.forEach((food) => food.eaten = true);
let output = '';
foods.forEach((item, index, array) =>
- output += `${index + 1}/${array.length}) ${item}\n`
+ output += `${index + 1}/${array.length} ${item.name}\n`;
);
+ console.log(output);
+ // 1/3 apple
+ // 2/3 banana
+ // 3/3 carrot
```
@method forEach
| false |
Other
|
emberjs
|
ember.js
|
b8ebef5d0a14f1f4a67436e6a46699266e81c635.json
|
Add v3.14.1 to CHANGELOG.md
[ci skip]
|
CHANGELOG.md
|
@@ -1,5 +1,9 @@
# Ember Changelog
+### v3.14.1 (October 30, 2019)
+
+- [#18244](https://github.com/emberjs/ember.js/pull/18244) [BUGFIX] Fix query param assertion when using the router services `transitionTo` to redirect _during_ an existing transition.
+
### v3.14.0 (October 29, 2019)
- [#18345](https://github.com/emberjs/ember.js/pull/18345) / [#18363](https://github.com/emberjs/ember.js/pull/18363) [FEATURE] Implement the [Provide @model named argument to route templates](https://github.com/emberjs/rfcs/blob/master/text/0523-model-argument-for-route-templates.md RFC.
| false |
Other
|
emberjs
|
ember.js
|
1ffa71d499e4a5dce7370304accae473936695c1.json
|
Add v3.14.0 to CHANGELOG
[ci skip]
(cherry picked from commit a1d8e395b0b0879c0983d3da9f3b7721b9883c32)
|
CHANGELOG.md
|
@@ -1,29 +1,12 @@
# Ember Changelog
-### v3.14.0-beta.5 (October 14, 2019)
+### v3.14.0 (October 29, 2019)
-- [#18476](https://github.com/emberjs/ember.js/pull/18476) [BUGFIX] Ensure model can be observed by sync observers
+- [#18345](https://github.com/emberjs/ember.js/pull/18345) / [#18363](https://github.com/emberjs/ember.js/pull/18363) [FEATURE] Implement the [Provide @model named argument to route templates](https://github.com/emberjs/rfcs/blob/master/text/0523-model-argument-for-route-templates.md RFC.
- [#18458](https://github.com/emberjs/ember.js/pull/18458) [BUGFIX] Using query params helper outside of link-to
-
-### v3.14.0-beta.4 (October 7, 2019)
-
-- [#18462](https://github.com/emberjs/ember.js/pull/18462) [BUGFIX] Prevents observer re-entry
-
-### v3.14.0-beta.3 (October 1, 2019)
-
- [#18429](https://github.com/emberjs/ember.js/pull/18429) [BUGFIX] Fix incorrect error message for octane features.
-
-### v3.14.0-beta.2 (September 24, 2019)
-
-- [#18273](https://github.com/emberjs/ember.js/pull/18273) [BUGFIX] Fix issues with SSR rehydration of <title>.
- [#18415](https://github.com/emberjs/ember.js/pull/18415) [BUGFIX] Fix hbs import path in test blueprint.
-- [#18418](https://github.com/emberjs/ember.js/pull/18418) / [#18419](https://github.com/emberjs/ember.js/pull/18419) [BUGFIX] Require Octane features when using Octane preview.
-
-### v3.14.0-beta.1 (September 19, 2019)
-
-- [#18345](https://github.com/emberjs/ember.js/pull/18345) / [#18363](https://github.com/emberjs/ember.js/pull/18363) [FEATURE] Implement the [Provide @model named argument to route templates](https://github.com/emberjs/rfcs/blob/master/text/0523-model-argument-for-route-templates.md RFC.
- [#18387](https://github.com/emberjs/ember.js/pull/18387) [BUGFIX] Ensure `updateComponent` is fired consistently
-- [#18372](https://github.com/emberjs/ember.js/pull/18372) Debug Render Tree (for Ember Inspector)
- [#18381](https://github.com/emberjs/ember.js/pull/18381) Drop Node 6 and 11 support.
- [#18410](https://github.com/emberjs/ember.js/pull/18410) Use ember-cli-htmlbars for inline precompilation if possible.
| false |
Other
|
emberjs
|
ember.js
|
93b2e873acd01347b5f792e233d6417a2670003d.json
|
Add v3.13.4 to CHANGELOG
[ci skip]
(cherry picked from commit 4d02f86ab30c94c4d4c9b2ae15663214865ff134)
|
CHANGELOG.md
|
@@ -27,6 +27,12 @@
- [#18381](https://github.com/emberjs/ember.js/pull/18381) Drop Node 6 and 11 support.
- [#18410](https://github.com/emberjs/ember.js/pull/18410) Use ember-cli-htmlbars for inline precompilation if possible.
+### v3.13.4 (October 29,2019)
+
+- [#18476](https://github.com/emberjs/ember.js/pull/18476) [BUGFIX] Ensure model can be observed by sync observers.
+- [#18477](https://github.com/emberjs/ember.js/pull/18477) [BUGFIX] Allows @each to work with arrays that contain falsy values.
+- [#18500](https://github.com/emberjs/ember.js/pull/18500) [BUGFIX] Remove requirement for disabling jquery-integration in Octane.
+
### v3.13.3 (October 8, 2019)
- [#18462](https://github.com/emberjs/ember.js/pull/18462) [BUGFIX] Prevents observer re-entry.
| false |
Other
|
emberjs
|
ember.js
|
2b158170a20d0ca6c8d26c2a54ff50c00747388a.json
|
Apply suggestions from code review
Co-Authored-By: Ricardo Mendes <[email protected]>
|
packages/@ember/-internals/owner/index.ts
|
@@ -52,15 +52,15 @@ export const OWNER = symbol('OWNER');
into the owner.
For example, this component dynamically looks up a service based on the
- `audioType` passed as an attribute:
+ `audioType` passed as an argument:
```app/components/play-audio.js
import Component from '@glimmer/component';
import { getOwner } from '@ember/application';
// Usage:
//
- // <PlayAudio @audioType={{model.audioType}} @audioFile={{model.file}}/>
+ // <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>
//
export default class extends Component {
get audioService() {
| false |
Other
|
emberjs
|
ember.js
|
bc31e34d9c492941ba369b2424df419cf98b3a4c.json
|
add code example for EmberArray isAny
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -1123,6 +1123,18 @@ const ArrayMixin = Mixin.create(Enumerable, {
argument for any item in the array. This method is often simpler/faster
than using a callback.
+ Example usage:
+
+ ```javascript
+ const food = [
+ { food: 'apple', isFruit: true},
+ { food: 'bread', isFruit: false },
+ { food: 'banana', isFruit: true }
+ ];
+ food.isAny('isFruit'); // true
+
+ ```
+
@method isAny
@param {String} key the property to test
@param {String} [value] optional value to test against. Defaults to `true`
| false |
Other
|
emberjs
|
ember.js
|
ed2fe07eac1f94efd5e849233ceeeba95776c9b3.json
|
fix return value in reject code example
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -863,7 +863,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
];
const nonFruits = food.reject(function(thing) {
return thing.isFruit;
- }); // [{food: 'beans', isFruit: false}]
+ }); // [{food: 'bread', isFruit: false}]
```
@method reject
| false |
Other
|
emberjs
|
ember.js
|
016b00eeea1693eee35f7922858ea53d9a6fb0fa.json
|
fix glimmer tracking example
|
packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts
|
@@ -23,12 +23,7 @@ a component's properties are expected to be static,
meaning you are not able to update them and have the template update
accordingly. Marking a property as tracked means that when that
property changes, a rerender of the component is scheduled so the
-template is kept up to date.
-
-@method tracked
-@static
-@for @glimmer/tracking
-@public
+template is kept up to date.
```javascript
import Component from '@glimmer/component';
@@ -44,4 +39,9 @@ export default class SomeComponent extends Component {
}
}
```
-*/
\ No newline at end of file
+
+@method tracked
+@static
+@for @glimmer/tracking
+@public
+*/
| false |
Other
|
emberjs
|
ember.js
|
474d0498abd607b017eb7dc36b3417ab37e28b6e.json
|
fix package namespace
|
packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts
|
@@ -7,7 +7,7 @@ Trackable values are values that:
We can do this by marking the field with the @tracked decorator.
-@module @glimmer/component
+@module @glimmer/tracking
@public
*/
| false |
Other
|
emberjs
|
ember.js
|
2642328a70d580a54f6d94d15d1ef3704fc794bb.json
|
Add docs for @glimmer/tracking
|
packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts
|
@@ -0,0 +1,47 @@
+/**
+In order to tell Ember a value might change, we need to mark it as trackable.
+Trackable values are values that:
+
+- Can change over their component’s lifetime and
+- Should cause Ember to rerender if and when they change
+
+We can do this by marking the field with the @tracked decorator.
+
+@module @glimmer/component
+@public
+*/
+
+/**
+ @class GlimmerTracking
+ @public
+ @static
+*/
+
+/**
+Marks a property as tracked. For example, by default,
+a component's properties are expected to be static,
+meaning you are not able to update them and have the template update
+accordingly. Marking a property as tracked means that when that
+property changes, a rerender of the component is scheduled so the
+template is kept up to date.
+
+@method tracked
+@static
+@for @glimmer/tracking
+@public
+
+```javascript
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class SomeComponent extends Component {
+ @tracked item = 1;
+
+ @action
+ plusOne() {
+ this.item += 1;
+ }
+}
+```
+*/
\ No newline at end of file
| false |
Other
|
emberjs
|
ember.js
|
1f3da9312c2febcc7fca6a3aa3a7420955d4c2ab.json
|
Add example for constructor
|
packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts
|
@@ -40,6 +40,19 @@ Constructs a new component and assigns itself the passed properties.
@static
@for @glimmer/component
@public
+
+```javascript
+import Component from '@glimmer/component';
+
+export default class SomeComponent extends Component {
+ constructor(owner, args) {
+ super(...arguments);
+ if (this.args.fadeIn === true) {
+ // fade in logic here
+ }
+ }
+}
+```
*/
/**
@@ -49,6 +62,8 @@ Override this function to do any set up that requires an element in the document
@static
@for @glimmer/component
@public
+
+
*/
/**
| false |
Other
|
emberjs
|
ember.js
|
73f6fa9a2b2ed7d808cacfdd769835fd987f565f.json
|
Correct the type of `test` for `assert`
Fixes #18516.
|
packages/@ember/debug/index.ts
|
@@ -157,7 +157,7 @@ if (DEBUG) {
@for @ember/debug
@param {String} description Describes the expectation. This will become the
text of the Error thrown if the assertion fails.
- @param {Boolean} condition Must be truthy for the assertion to pass. If
+ @param {any} condition Must be truthy for the assertion to pass. If
falsy, an exception will be thrown.
@public
@since 1.0.0
| false |
Other
|
emberjs
|
ember.js
|
5dc7e606de27ad38440b685f733bf71f77e2705c.json
|
Fix the module names
|
packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts
|
@@ -24,7 +24,7 @@ export default class SomeComponent extends Component {
}
```
-@module @glimmer/something
+@module @glimmer/component
@public
*/
@@ -38,7 +38,7 @@ export default class SomeComponent extends Component {
Constructs a new component and assigns itself the passed properties.
@method constructor
@static
-@for @glimmer/something
+@for @glimmer/component
@public
*/
@@ -47,7 +47,7 @@ Constructs a new component and assigns itself the passed properties.
Override this function to do any set up that requires an element in the document body.
@method didInsertElement
@static
-@for @glimmer/something
+@for @glimmer/component
@public
*/
@@ -56,14 +56,14 @@ Override this function to do any set up that requires an element in the document
It is called only during a rerender, not during an initial render.
@method didUpdate
@static
-@for @glimmer/something
+@for @glimmer/component
@public
*/
/**
`willDestroy` is called before the component has been removed from the DOM.
@method willDestroy
@static
-@for @glimmer/something
+@for @glimmer/component
@public
*/
| false |
Other
|
emberjs
|
ember.js
|
5d2269fd34cf646bae4224d8a977e169625055e2.json
|
add glimmer namespace, not working
|
packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts
|
@@ -24,7 +24,7 @@ export default class SomeComponent extends Component {
}
```
-@module @ember/something
+@module @glimmer/something
@public
*/
@@ -38,7 +38,7 @@ export default class SomeComponent extends Component {
Constructs a new component and assigns itself the passed properties.
@method constructor
@static
-@for @ember/something
+@for @glimmer/something
@public
*/
@@ -47,7 +47,7 @@ Constructs a new component and assigns itself the passed properties.
Override this function to do any set up that requires an element in the document body.
@method didInsertElement
@static
-@for @ember/something
+@for @glimmer/something
@public
*/
@@ -56,14 +56,14 @@ Override this function to do any set up that requires an element in the document
It is called only during a rerender, not during an initial render.
@method didUpdate
@static
-@for @ember/something
+@for @glimmer/something
@public
*/
/**
`willDestroy` is called before the component has been removed from the DOM.
@method willDestroy
@static
-@for @ember/something
+@for @glimmer/something
@public
*/
| false |
Other
|
emberjs
|
ember.js
|
8955e1c994ef9def71586335513a78a8697d444e.json
|
Add static to functions
|
packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts
|
@@ -46,6 +46,7 @@ Constructs a new component and assigns itself the passed properties.
`didInsertElement` is called when the component has been inserted into the DOM.
Override this function to do any set up that requires an element in the document body.
@method didInsertElement
+@static
@for @ember/something
@public
*/
@@ -54,13 +55,15 @@ Override this function to do any set up that requires an element in the document
`didUpdate` is called when the component has updated and rerendered itself.
It is called only during a rerender, not during an initial render.
@method didUpdate
+@static
@for @ember/something
@public
*/
/**
`willDestroy` is called before the component has been removed from the DOM.
@method willDestroy
+@static
@for @ember/something
@public
*/
| false |
Other
|
emberjs
|
ember.js
|
b873c7ff3b6f7286d3505ffc783018809b25656f.json
|
use testing name
|
packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts
|
@@ -24,7 +24,7 @@ export default class SomeComponent extends Component {
}
```
-@module @glimmer/component
+@module @ember/something
@public
*/
@@ -37,26 +37,30 @@ export default class SomeComponent extends Component {
/**
Constructs a new component and assigns itself the passed properties.
@method constructor
-@param options
+@static
+@for @ember/something
@public
*/
/**
`didInsertElement` is called when the component has been inserted into the DOM.
Override this function to do any set up that requires an element in the document body.
@method didInsertElement
+@for @ember/something
@public
*/
/**
`didUpdate` is called when the component has updated and rerendered itself.
It is called only during a rerender, not during an initial render.
@method didUpdate
+@for @ember/something
@public
*/
/**
`willDestroy` is called before the component has been removed from the DOM.
@method willDestroy
+@for @ember/something
@public
*/
| false |
Other
|
emberjs
|
ember.js
|
568fdeb1be4666bc51acc9bee074af402b84632c.json
|
Add example for EmberArray#isEvery
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -1041,6 +1041,29 @@ const ArrayMixin = Mixin.create(Enumerable, {
Note that like the native `Array.every`, `isEvery` will return true when called
on any empty array.
+ ```javascript
+ class Language {
+ constructor(name, isProgrammingLanguage) {
+ this.name = name;
+ this.programmingLanguage = isProgrammingLanguage;
+ }
+ }
+
+ const compiledLanguages = [
+ new Language('Java', true),
+ new Language('Go', true),
+ new Language('Rust', true)
+ ]
+
+ const languagesKnownByMe = [
+ new Language('Javascript', true),
+ new Language('English', false),
+ new Language('Ruby', true)
+ ]
+
+ compiledLanguages.isEvery('programmingLanguage'); // true
+ languagesKnownByMe.isEvery('programmingLanguage'); // false
+ ```
@method isEvery
@param {String} key the property to test
| false |
Other
|
emberjs
|
ember.js
|
fe400156e6ece41739e6dfbb6992fd35b3179a1d.json
|
Update EmberArray invoke docs to use native class
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -1183,14 +1183,19 @@ const ArrayMixin = Mixin.create(Enumerable, {
Prototype 1.6.
```javascript
- const Person = EmberObject.extend({
- name: null,
+ class Person {
+ name = null;
+
+ constructor(name) {
+ this.name = name;
+ }
+
greet(prefix='Hello') {
return `${prefix} ${this.name}`;
- },
-
- });
- let people = [Person.create('Joe'), Person.create('Matt')];
+ }
+ }
+
+ let people = [new Person('Joe'), new Person('Matt')];
people.invoke('greet'); // ['Hello Joe', 'Hello Matt']
people.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
| false |
Other
|
emberjs
|
ember.js
|
c20639593b23463cb5ca48446335bd4eb80045da.json
|
add code example for EmberArray reject
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -278,7 +278,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
```javascript
let peopleToMoon = ['Armstrong', 'Aldrin'];
-
+
peopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']
peopleToMoon.set('[]', ['Collins']); // ['Collins']
@@ -311,7 +311,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
vowels.reverseObjects();
vowels.firstObject; // 'u'
-
+
vowels.clear();
vowels.firstObject; // undefined
```
@@ -381,7 +381,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
Returns the index if found, -1 if no match is found.
The optional `startAt` argument can be used to pass a starting
- index to search from, effectively slicing the searchable portion
+ index to search from, effectively slicing the searchable portion
of the array. If it's negative it will add the array length to
the startAt value passed in as the index to search from. If less
than or equal to `-1 * array.length` the entire array is searched.
@@ -595,7 +595,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
editPost(post, newContent) {
let oldContent = post.body,
postIndex = this.posts.indexOf(post);
-
+
this.posts.arrayContentWillChange(postIndex, 0, 0); // attemptsToModify = 1
post.set('body', newContent);
@@ -709,7 +709,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
```javascript
let people = [{name: 'Joe'}, {name: 'Matt'}];
-
+
people.setEach('zipCode', '10011);
// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
```
@@ -853,6 +853,15 @@ const ArrayMixin = Mixin.create(Enumerable, {
object that will be set as "this" on the context. This is a good way
to give your iterator function access to the current object.
+ Example Usage:
+
+ ```javascript
+ const food = Ember.A().addObjects([{food: 'apple', isFruit: true}, {food: 'bread', isFruit: false}, food: 'banana', isFruit: true}]);
+ const nonFruits = food.reject(function(thing) {
+ return thing.isFruit;
+ }); // [{food: 'beans', isFruit: false}]
+ ```
+
@method reject
@param {Function} callback The callback to execute
@param {Object} [target] The target object to use
@@ -936,7 +945,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
Note that in addition to a callback, you can also pass an optional target
object that will be set as `this` on the context. This is a good way
to give your iterator function access to the current object.
-
+
Example Usage:
```javascript
@@ -1188,7 +1197,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
greet(prefix='Hello') {
return `${prefix} ${this.name}`;
},
-
+
});
let people = [Person.create('Joe'), Person.create('Matt')];
@@ -1243,7 +1252,7 @@ const ArrayMixin = Mixin.create(Enumerable, {
Returns `true` if found, `false` otherwise.
The optional `startAt` argument can be used to pass a starting
- index to search from, effectively slicing the searchable portion
+ index to search from, effectively slicing the searchable portion
of the array. If it's negative it will add the array length to
the startAt value passed in as the index to search from. If less
than or equal to `-1 * array.length` the entire array is searched.
@@ -1282,10 +1291,10 @@ const ArrayMixin = Mixin.create(Enumerable, {
{ name: 'green', weight: 600 },
{ name: 'blue', weight: 500 }
];
-
+
colors.sortBy('name');
// [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]
-
+
colors.sortBy('weight', 'name');
// [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
```
| false |
Other
|
emberjs
|
ember.js
|
acc2e37274dc398fe38713fe27b3fa97fcddece9.json
|
Add v3.14.0-beta.5 to CHANGELOG
[ci skip]
(cherry picked from commit 7e28edc17abc3db47da6ab72ed198e89fc4fbe2c)
|
CHANGELOG.md
|
@@ -1,5 +1,10 @@
# Ember Changelog
+### v3.14.0-beta.5 (October 14, 2019)
+
+- [#18476](https://github.com/emberjs/ember.js/pull/18476) [BUGFIX] Ensure model can be observed by sync observers
+- [#18458](https://github.com/emberjs/ember.js/pull/18458) [BUGFIX] Using query params helper outside of link-to
+
### v3.14.0-beta.4 (October 7, 2019)
- [#18462](https://github.com/emberjs/ember.js/pull/18462) [BUGFIX] Prevents observer re-entry
| false |
Other
|
emberjs
|
ember.js
|
05594308c5684408961e389cfbc1e1749b340152.json
|
remove unreachable code
|
packages/@ember/-internals/glimmer/lib/utils/references.ts
|
@@ -37,7 +37,7 @@ import {
PrimitiveReference,
UNDEFINED_REFERENCE,
} from '@glimmer/runtime';
-import { Option, unreachable } from '@glimmer/util';
+import { Option } from '@glimmer/util';
import { HelperFunction, HelperInstance, RECOMPUTE_TAG } from '../helper';
import emberToBool from './to-bool';
@@ -505,8 +505,6 @@ export function referenceFromParts(
return reference;
}
-type Primitive = undefined | null | boolean | number | string;
-
function isObject(value: unknown): value is object {
return value !== null && typeof value === 'object';
}
@@ -515,7 +513,7 @@ function isFunction(value: unknown): value is Function {
return typeof value === 'function';
}
-function isPrimitive(value: unknown): value is Primitive {
+function ensurePrimitive(value: unknown) {
if (DEBUG) {
let label;
@@ -534,8 +532,6 @@ function isPrimitive(value: unknown): value is Primitive {
typeof value === 'string'
);
}
-
- return true;
}
function valueToRef<T = unknown>(value: T, bound = true): VersionedPathReference<T> {
@@ -545,25 +541,9 @@ function valueToRef<T = unknown>(value: T, bound = true): VersionedPathReference
} else if (isFunction(value)) {
// ember doesn't do observing with functions
return new UnboundReference(value);
- } else if (isPrimitive(value)) {
- return PrimitiveReference.create(value);
- } else if (DEBUG) {
- let type = typeof value;
- let output: Option<string>;
-
- try {
- output = String(value);
- } catch (e) {
- output = null;
- }
-
- if (output) {
- throw unreachable(`[BUG] Unexpected ${type} (${output})`);
- } else {
- throw unreachable(`[BUG] Unexpected ${type}`);
- }
} else {
- throw unreachable();
+ ensurePrimitive(value);
+ return PrimitiveReference.create(value as any);
}
}
@@ -574,24 +554,8 @@ function valueKeyToRef(value: unknown, key: string): VersionedPathReference<Opaq
} else if (isFunction(value)) {
// ember doesn't do observing with functions
return new UnboundReference(value[key]);
- } else if (isPrimitive(value)) {
- return UNDEFINED_REFERENCE;
- } else if (DEBUG) {
- let type = typeof value;
- let output: Option<string>;
-
- try {
- output = String(value);
- } catch (e) {
- output = null;
- }
-
- if (output) {
- throw unreachable(`[BUG] Unexpected ${type} (${output})`);
- } else {
- throw unreachable(`[BUG] Unexpected ${type}`);
- }
} else {
- throw unreachable();
+ ensurePrimitive(value);
+ return UNDEFINED_REFERENCE;
}
}
| false |
Other
|
emberjs
|
ember.js
|
72553a0a51b24b392d5619d445cc3f1c3bab1448.json
|
Add v3.14.0-beta.4 to CHANGELOG
[ci skip]
(cherry picked from commit 369235c286326e4db11b7eee81d6a5c12cefa25b)
|
CHANGELOG.md
|
@@ -1,5 +1,9 @@
# Ember Changelog
+### v3.14.0-beta.4 (October 7, 2019)
+
+- [#18462](https://github.com/emberjs/ember.js/pull/18462) [BUGFIX] Prevents observer re-entry
+
### v3.14.0-beta.3 (October 1, 2019)
- [#18429](https://github.com/emberjs/ember.js/pull/18429) [BUGFIX] Fix incorrect error message for octane features.
| false |
Other
|
emberjs
|
ember.js
|
f2412282271df9b94cff63be9853ebdec047c8f9.json
|
#18228 update forEach example to include side effects
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -661,10 +661,18 @@ const ArrayMixin = Mixin.create(Enumerable, {
Example Usage:
```javascript
- let foods = ['apple', 'banana', carrot'];
+ let foods = [
+ { name: 'apple', eaten: false },
+ { name: 'banana', eaten: false },
+ { name: carrot': eaten: false }
+ ];
+
+ foods.forEach((food) => food.eaten = true);
- foods.forEach(food => console.log(`You should eat a ${food}`));
- foods.forEach((item, index, array) => console.log(`${index + 1}/${array.length}) ${item}`));
+ let output = '';
+ foods.forEach((item, index, array) =>
+ output += `${index + 1}/${array.length}) ${item}\n`
+ );
```
@method forEach
| false |
Other
|
emberjs
|
ember.js
|
076ffe9ecdfc800f26e46ddab05b01604f312384.json
|
#18228 Update documentation for EmberArray.includes
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -1225,20 +1225,25 @@ const ArrayMixin = Mixin.create(Enumerable, {
},
/**
- Returns `true` if the passed object can be found in the array.
+ Used to determine if the array contains the passed object.
+ Returns `true` if found, `false` otherwise.
+
+ The optional `startAt` argument can be used to pass a starting
+ index to search from, effectively slicing the searchable portion
+ of the array. If it's negative it will add the array length to
+ the startAt value passed in as the index to search from. If less
+ than or equal to `-1 * array.length` the entire array is searched.
+
This method is a Polyfill for ES 2016 Array.includes.
- If no `startAt` argument is given, the starting location to
- search is 0. If it's negative, searches from the index of
- `this.length + startAt` by asc.
```javascript
[1, 2, 3].includes(2); // true
[1, 2, 3].includes(4); // false
[1, 2, 3].includes(3, 2); // true
[1, 2, 3].includes(3, 3); // false
- [1, 2, 3].includes(3, -1); // true
- [1, 2, 3].includes(1, -1); // false
- [1, 2, 3].includes(1, -4); // true
+ [1, 2, 3].includes(3, -1); // true, equivalent to includes(3, 2)
+ [1, 2, 3].includes(1, -1); // false, equivalent to includes(1, 2)
+ [1, 2, 3].includes(1, -4); // true, searches entire array
[1, 2, NaN].includes(NaN); // true
```
| false |
Other
|
emberjs
|
ember.js
|
11126b705eda0d4369a3de5ae8613ef86197f37a.json
|
#18228 Add example to EmberArray.forEach documentation
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -658,6 +658,15 @@ const ArrayMixin = Mixin.create(Enumerable, {
object that will be set as `this` on the context. This is a good way
to give your iterator function access to the current object.
+ Example Usage:
+
+ ```javascript
+ let foods = ['apple', 'banana', carrot'];
+
+ foods.forEach(food => console.log(`You should eat a ${food}`));
+ foods.forEach((item, index, array) => console.log(`${index + 1}/${array.length}) ${item}`));
+ ```
+
@method forEach
@param {Function} callback The callback to execute
@param {Object} [target] The target object to use
| false |
Other
|
emberjs
|
ember.js
|
8c567f53acf0921dfcf73c4f34e44214ba46f98a.json
|
tests: Add failing test for QP helper with let
Using (query-params) helper outside of a link-to is incorrectly failing
|
packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-curly-test.js
|
@@ -76,13 +76,16 @@ moduleFor(
this.addTemplate(
'index',
- `{{#let (query-params foo='456' bar='NAW') as |qp|}}{{link-to 'Index' 'index' qp}}{{/let}}`
+ `{{#let (query-params foo='456' alon='BUKAI') as |qp|}}{{link-to 'Index' 'index' qp}}{{/let}}`
);
- return assert.rejectsAssertion(
- this.visit('/'),
- /The `\(query-params\)` helper can only be used when invoking the `{{link-to}}` component\./
- );
+ return this.visit('/').then(() => {
+ this.assertComponentElement(this.firstChild, {
+ tagName: 'a',
+ attrs: { href: '/?alon=BUKAI&foo=456', class: classMatcher('ember-view') },
+ content: 'Index',
+ });
+ });
}
}
);
| false |
Other
|
emberjs
|
ember.js
|
bc435eb0a11868f7e0f8381f9a4bb2ba7728d9e8.json
|
Add v3.13.2 to CHANGELOG.
(cherry picked from commit 17838f0779f54659b838e020c87efdfa979d2664)
|
CHANGELOG.md
|
@@ -18,6 +18,10 @@
- [#18381](https://github.com/emberjs/ember.js/pull/18381) Drop Node 6 and 11 support.
- [#18410](https://github.com/emberjs/ember.js/pull/18410) Use ember-cli-htmlbars for inline precompilation if possible.
+### v3.13.2 (September 25, 2019)
+
+- [#18429](https://github.com/emberjs/ember.js/pull/18429) [BUGFIX] Fix incorrect error message when opting into using Octane, and missing optional features.
+
### v3.13.1 (September 23, 2019)
- [#18273](https://github.com/emberjs/ember.js/pull/18273) [BUGFIX] Fix issues with SSR rehydration of <title>.
| false |
Other
|
emberjs
|
ember.js
|
1db41748d5563538add872084d8ebedd2eb420e2.json
|
Add v3.14.0-beta.3 to CHANGELOG
[ci skip]
(cherry picked from commit 2f15e4a80580ed1552175687cccae70bbba44ec6)
|
CHANGELOG.md
|
@@ -1,5 +1,9 @@
# Ember Changelog
+### v3.14.0-beta.3 (October 1, 2019)
+
+- [#18429](https://github.com/emberjs/ember.js/pull/18429) [BUGFIX] Fix incorrect error message for octane features.
+
### v3.14.0-beta.2 (September 24, 2019)
- [#18273](https://github.com/emberjs/ember.js/pull/18273) [BUGFIX] Fix issues with SSR rehydration of <title>.
| false |
Other
|
emberjs
|
ember.js
|
f6f9f5210754155c8d081a65d78f37a561d928f7.json
|
improve fn & on undefined callback message
|
packages/@ember/-internals/glimmer/lib/helpers/fn.ts
|
@@ -86,8 +86,9 @@ function fnHelper({ positional }: ICapturedArguments) {
if (DEBUG && typeof callbackRef[INVOKE] !== 'function') {
let callback = callbackRef.value();
+ const debug = (<any>callbackRef).debug && (<any>callbackRef).debug();
assert(
- `You must pass a function as the \`fn\` helpers first argument, you passed ${callback}`,
+ `You must pass a function as the \`fn\` helpers first argument, you passed ${debug} to \`fn\` but it was ${callback}`,
typeof callback === 'function'
);
}
| true |
Other
|
emberjs
|
ember.js
|
f6f9f5210754155c8d081a65d78f37a561d928f7.json
|
improve fn & on undefined callback message
|
packages/@ember/-internals/glimmer/lib/modifiers/on.ts
|
@@ -101,11 +101,15 @@ export class OnModifierState {
this.eventName = eventName;
this.shouldUpdate = true;
}
+ if (DEBUG) {
+ const debug = args.positional.at(1) && (<any>args.positional.at(1)).debug();
+ const value = args.positional.at(1) && args.positional.at(1).value();
+ assert(
+ `You must pass a function as the second argument to the \`on\` modifier, you passed ${debug} to \`on\` but it was ${value}`,
+ value !== undefined && typeof value === 'function'
+ );
+ }
- assert(
- 'You must pass a function as the second argument to the `on` modifier',
- args.positional.at(1) !== undefined && typeof args.positional.at(1).value() === 'function'
- );
let userProvidedCallback = args.positional.at(1).value() as EventListener;
if (userProvidedCallback !== this.userProvidedCallback) {
this.userProvidedCallback = userProvidedCallback;
| true |
Other
|
emberjs
|
ember.js
|
f6f9f5210754155c8d081a65d78f37a561d928f7.json
|
improve fn & on undefined callback message
|
packages/@ember/-internals/glimmer/tests/integration/helpers/fn-test.js
|
@@ -127,7 +127,7 @@ moduleFor(
arg1: 'foo',
arg2: 'bar',
});
- }, /You must pass a function as the `fn` helpers first argument, you passed null/);
+ }, /You must pass a function as the `fn` helpers first argument, you passed this.myFunc to `fn` but it was null/);
}
'@test asserts if the provided function accesses `this` without being bound prior to passing to fn'(
| true |
Other
|
emberjs
|
ember.js
|
1b9349622c4c96f909e22d07474f79ebf1848084.json
|
Add v3.14.0-beta.2 to CHANGELOG
[ci skip]
(cherry picked from commit da9520671790fd6cf14304647c9fb9803a1b6f4b)
|
CHANGELOG.md
|
@@ -1,5 +1,11 @@
# Ember Changelog
+### v3.14.0-beta.2 (September 24, 2019)
+
+- [#18273](https://github.com/emberjs/ember.js/pull/18273) [BUGFIX] Fix issues with SSR rehydration of <title>.
+- [#18415](https://github.com/emberjs/ember.js/pull/18415) [BUGFIX] Fix hbs import path in test blueprint.
+- [#18418](https://github.com/emberjs/ember.js/pull/18418) / [#18419](https://github.com/emberjs/ember.js/pull/18419) [BUGFIX] Require Octane features when using Octane preview.
+
### v3.14.0-beta.1 (September 19, 2019)
- [#18345](https://github.com/emberjs/ember.js/pull/18345) / [#18363](https://github.com/emberjs/ember.js/pull/18363) [FEATURE] Implement the [Provide @model named argument to route templates](https://github.com/emberjs/rfcs/blob/master/text/0523-model-argument-for-route-templates.md RFC.
@@ -10,8 +16,8 @@
### v3.13.1 (September 23, 2019)
-- [#18273](https://github.com/emberjs/ember.js/pull/18273) [BUGFIX] Fix issues with SSR rehydration of <title>. (#18273)
-- [#18418](https://github.com/emberjs/ember.js/pull/18418) / [#18418](https://github.com/emberjs/ember.js/pull/18418) [BUGFIX] Require Octane features when using Octane preview (#18418)
+- [#18273](https://github.com/emberjs/ember.js/pull/18273) [BUGFIX] Fix issues with SSR rehydration of <title>.
+- [#18418](https://github.com/emberjs/ember.js/pull/18418) / [#18419](https://github.com/emberjs/ember.js/pull/18419) [BUGFIX] Require Octane features when using Octane preview.
### v3.13.0 (September 19, 2019)
| false |
Other
|
emberjs
|
ember.js
|
af661414bf9ee5e8ac5565e15a280e330ce69510.json
|
Add v3.13.1 to CHANGELOG.md.
[ci skip]
(cherry picked from commit d9df4ed57260de3f5e30d47286b012764177d793)
|
CHANGELOG.md
|
@@ -8,6 +8,11 @@
- [#18381](https://github.com/emberjs/ember.js/pull/18381) Drop Node 6 and 11 support.
- [#18410](https://github.com/emberjs/ember.js/pull/18410) Use ember-cli-htmlbars for inline precompilation if possible.
+### v3.13.1 (September 23, 2019)
+
+- [#18273](https://github.com/emberjs/ember.js/pull/18273) [BUGFIX] Fix issues with SSR rehydration of <title>. (#18273)
+- [#18418](https://github.com/emberjs/ember.js/pull/18418) / [#18418](https://github.com/emberjs/ember.js/pull/18418) [BUGFIX] Require Octane features when using Octane preview (#18418)
+
### v3.13.0 (September 19, 2019)
- [#16366](https://github.com/emberjs/ember.js/pull/16366) / [#16903](https://github.com/emberjs/ember.js/pull/16903) / [#17572](https://github.com/emberjs/ember.js/pull/17572) / [#17682](https://github.com/emberjs/ember.js/pull/17682) / [#17765](https://github.com/emberjs/ember.js/pull/17765) / [#17751](https://github.com/emberjs/ember.js/pull/17751) / [#17835](https://github.com/emberjs/ember.js/pull/17835) / [#18059](https://github.com/emberjs/ember.js/pull/18059) / [#17951](https://github.com/emberjs/ember.js/pull/17951) / [#18069](https://github.com/emberjs/ember.js/pull/18069) / [#18074](https://github.com/emberjs/ember.js/pull/18074) / [#18073](https://github.com/emberjs/ember.js/pull/18073) / [#18091](https://github.com/emberjs/ember.js/pull/18091) / [#18186](https://github.com/emberjs/ember.js/pull/18186) / [#18223](https://github.com/emberjs/ember.js/pull/18223) / [#18358](https://github.com/emberjs/ember.js/pull/18358) / [#18266](https://github.com/emberjs/ember.js/pull/18266) [FEATURE] Implement the [Tracked Properties](https://github.com/emberjs/rfcs/blob/master/text/0410-tracked-properties.md) and [Tracked Property Updates](https://github.com/emberjs/rfcs/blob/master/text/0478-tracked-properties-updates.md) RFCs.
| false |
Other
|
emberjs
|
ember.js
|
6a7e8f536f9f1bafc40db008f2eb7dd72f340b35.json
|
Add v3.14.0-beta.1 to CHANGELOG
[ci skip]
(cherry picked from commit c5705c71067a443b80cc5a3f7161429c0a40a586)
|
CHANGELOG.md
|
@@ -1,5 +1,13 @@
# Ember Changelog
+### v3.14.0-beta.1 (September 19, 2019)
+
+- [#18345](https://github.com/emberjs/ember.js/pull/18345) / [#18363](https://github.com/emberjs/ember.js/pull/18363) [FEATURE] Implement the [Provide @model named argument to route templates](https://github.com/emberjs/rfcs/blob/master/text/0523-model-argument-for-route-templates.md RFC.
+- [#18387](https://github.com/emberjs/ember.js/pull/18387) [BUGFIX] Ensure `updateComponent` is fired consistently
+- [#18372](https://github.com/emberjs/ember.js/pull/18372) Debug Render Tree (for Ember Inspector)
+- [#18381](https://github.com/emberjs/ember.js/pull/18381) Drop Node 6 and 11 support.
+- [#18410](https://github.com/emberjs/ember.js/pull/18410) Use ember-cli-htmlbars for inline precompilation if possible.
+
### v3.13.0 (September 19, 2019)
- [#16366](https://github.com/emberjs/ember.js/pull/16366) / [#16903](https://github.com/emberjs/ember.js/pull/16903) / [#17572](https://github.com/emberjs/ember.js/pull/17572) / [#17682](https://github.com/emberjs/ember.js/pull/17682) / [#17765](https://github.com/emberjs/ember.js/pull/17765) / [#17751](https://github.com/emberjs/ember.js/pull/17751) / [#17835](https://github.com/emberjs/ember.js/pull/17835) / [#18059](https://github.com/emberjs/ember.js/pull/18059) / [#17951](https://github.com/emberjs/ember.js/pull/17951) / [#18069](https://github.com/emberjs/ember.js/pull/18069) / [#18074](https://github.com/emberjs/ember.js/pull/18074) / [#18073](https://github.com/emberjs/ember.js/pull/18073) / [#18091](https://github.com/emberjs/ember.js/pull/18091) / [#18186](https://github.com/emberjs/ember.js/pull/18186) / [#18223](https://github.com/emberjs/ember.js/pull/18223) / [#18358](https://github.com/emberjs/ember.js/pull/18358) / [#18266](https://github.com/emberjs/ember.js/pull/18266) [FEATURE] Implement the [Tracked Properties](https://github.com/emberjs/rfcs/blob/master/text/0410-tracked-properties.md) and [Tracked Property Updates](https://github.com/emberjs/rfcs/blob/master/text/0478-tracked-properties-updates.md) RFCs.
| false |
Other
|
emberjs
|
ember.js
|
eb4c26fa6f473dd813797a2ae3f3381725d300c6.json
|
Add v3.13.0 to CHANGELOG
[ci skip]
(cherry picked from commit d96d88ddc1f5b6f7f9dd734890268370cd35f0f6)
|
CHANGELOG.md
|
@@ -1,38 +1,28 @@
# Ember Changelog
-### v3.13.0-beta.5 (September 3, 2019)
-
+### v3.13.0 (September 19, 2019)
+
+- [#16366](https://github.com/emberjs/ember.js/pull/16366) / [#16903](https://github.com/emberjs/ember.js/pull/16903) / [#17572](https://github.com/emberjs/ember.js/pull/17572) / [#17682](https://github.com/emberjs/ember.js/pull/17682) / [#17765](https://github.com/emberjs/ember.js/pull/17765) / [#17751](https://github.com/emberjs/ember.js/pull/17751) / [#17835](https://github.com/emberjs/ember.js/pull/17835) / [#18059](https://github.com/emberjs/ember.js/pull/18059) / [#17951](https://github.com/emberjs/ember.js/pull/17951) / [#18069](https://github.com/emberjs/ember.js/pull/18069) / [#18074](https://github.com/emberjs/ember.js/pull/18074) / [#18073](https://github.com/emberjs/ember.js/pull/18073) / [#18091](https://github.com/emberjs/ember.js/pull/18091) / [#18186](https://github.com/emberjs/ember.js/pull/18186) / [#18223](https://github.com/emberjs/ember.js/pull/18223) / [#18358](https://github.com/emberjs/ember.js/pull/18358) / [#18266](https://github.com/emberjs/ember.js/pull/18266) [FEATURE] Implement the [Tracked Properties](https://github.com/emberjs/rfcs/blob/master/text/0410-tracked-properties.md) and [Tracked Property Updates](https://github.com/emberjs/rfcs/blob/master/text/0478-tracked-properties-updates.md) RFCs.
+- [#18158](https://github.com/emberjs/ember.js/pull/18158) / [#18203](https://github.com/emberjs/ember.js/pull/18203) / [#18198](https://github.com/emberjs/ember.js/pull/18198) / [#18190](https://github.com/emberjs/ember.js/pull/18190) / [#18394](https://github.com/emberjs/ember.js/pull/18394) [FEATURE] Implement the [Component Templates Co-location](https://github.com/emberjs/rfcs/blob/master/text/0481-component-templates-co-location.md) RFC, including the setComponentTemplate(), getComponentTemplate() and templateOnlyComponent() APIs. Note that while these low-level APIs are enabled, the co-location feature is only enabled in Octane apps as of this release. This restriction will be removed in a future version.
+- [#18241](https://github.com/emberjs/ember.js/pull/18241) / [#18383](https://github.com/emberjs/ember.js/pull/18383) [FEATURE] Add `updateHook` component-manager capability
+- [#18396](https://github.com/emberjs/ember.js/pull/18396) [FEATURE] Implement component-class generator
+- [#18389](https://github.com/emberjs/ember.js/pull/18389) [FEATURE] Use @ember/edition-utils to detect the edition that is in use
+- [#18214](https://github.com/emberjs/ember.js/pull/18214) [DEPRECATION] Implement the [Deprecate support for mouseEnter/Leave/Move Ember events RFC](https://github.com/emberjs/rfcs/blob/master/text/0486-deprecate-mouseenter.md).
+- [#18395](https://github.com/emberjs/ember.js/pull/18395) [BUGFIX] Use `<Nested::Invocation>` in component tests blueprint
+- [#18406](https://github.com/emberjs/ember.js/pull/18406) [BUGFIX] Prevent infinite cycles from lazy computed computation
- [#18314](https://github.com/emberjs/ember.js/pull/18314) [BUGFIX] Use class inheritance for getters and setters
- [#18329](https://github.com/emberjs/ember.js/pull/18329) [BUGFIX] Eagerly consume aliases
-
-### v3.13.0-beta.4 (August 26, 2019)
-
- [#18278](https://github.com/emberjs/ember.js/pull/18278) [BUGFIX] Bump ember-router-generator from v1.2.3 to v2.0.0 to support parsing `app/router.js` with native class.
- [#18291](https://github.com/emberjs/ember.js/pull/18291) [BUGFIX] Adds the babel-helpers injection plugin back and include `ember-template-compiler` in the vendor folder for Ember.
- [#18296](https://github.com/emberjs/ember.js/pull/18296) [BUGFIX] Ensure {{each-in}} can iterate over keys with periods
-- [#18304](https://github.com/emberjs/ember.js/pull/18304) [BUGFIX] Check the EMBER_ENV environment variable after it is set
-
-### v3.13.0-beta.3 (August 19, 2019)
-
-- [#18223](https://github.com/emberjs/ember.js/pull/18223) [FEATURE] Tracked Props Performance Tuning
+- [#18304](https://github.com/emberjs/ember.js/pull/18304) [BUGFIX] Correctly determine the environment by checking the EMBER_ENV environment variable only after it is set
- [#18208](https://github.com/emberjs/ember.js/pull/18208) [BUGFIX] Compile Ember dynamically in consuming applications
-- [#18266](https://github.com/emberjs/ember.js/pull/18266) [BUGFIX] Autotrack Modifiers and Helpers
- [#18267](https://github.com/emberjs/ember.js/pull/18267) [BUGFIX] Router#url should not error when `location` is a string
- [#18270](https://github.com/emberjs/ember.js/pull/18270) [BUGFIX] Prevent cycle dependency with owner association.
- [#18274](https://github.com/emberjs/ember.js/pull/18274) [BUGFIX] Allow CPs to depend on nested args
- [#18276](https://github.com/emberjs/ember.js/pull/18276) [BUGFIX] Change the assertion for @each dependencies into a deprecation
- [#18281](https://github.com/emberjs/ember.js/pull/18281) [BUGFIX] Check length of targets
-
-### v3.13.0.beta.2 (August 12, 2019)
-
- [#18248](https://github.com/emberjs/ember.js/pull/18248) [BUGFIX] Ensures that observers are flushed after CPs are updated
-- [#18241](https://github.com/emberjs/ember.js/pull/18241) [BUGFIX] Adds Component Manager 3.13 Capabilities
-
-### v3.13.0-beta.1 (August 6, 2019)
-
-- [#16366](https://github.com/emberjs/ember.js/pull/16366) / [#16903](https://github.com/emberjs/ember.js/pull/16903) / [#17572](https://github.com/emberjs/ember.js/pull/17572) / [#17682](https://github.com/emberjs/ember.js/pull/17682) / [#17765](https://github.com/emberjs/ember.js/pull/17765) / [#17751](https://github.com/emberjs/ember.js/pull/17751) / [#17835](https://github.com/emberjs/ember.js/pull/17835) / [#18059](https://github.com/emberjs/ember.js/pull/18059) / [#17951](https://github.com/emberjs/ember.js/pull/17951) / [#18069](https://github.com/emberjs/ember.js/pull/18069) / [#18074](https://github.com/emberjs/ember.js/pull/18074) / [#18073](https://github.com/emberjs/ember.js/pull/18073) / [#18091](https://github.com/emberjs/ember.js/pull/18091) / [#18186](https://github.com/emberjs/ember.js/pull/18186) [FEATURE] Implement the [Tracked Properties](https://github.com/emberjs/rfcs/blob/master/text/0410-tracked-properties.md) and [Tracked Property Updates](https://github.com/emberjs/rfcs/blob/master/text/0478-tracked-properties-updates.md) RFCs.
-- [#18158](https://github.com/emberjs/ember.js/pull/18158) / [#18203](https://github.com/emberjs/ember.js/pull/18203) / [#18198](https://github.com/emberjs/ember.js/pull/18198) / [#18190](https://github.com/emberjs/ember.js/pull/18190) [FEATURE] Implement the [Component Templates Co-location](https://github.com/emberjs/rfcs/blob/master/text/0481-component-templates-co-location.md).
-- [#18214](https://github.com/emberjs/ember.js/pull/18214) [DEPRECATION] Implement the [Deprecate support for mouseEnter/Leave/Move Ember events](https://github.com/emberjs/rfcs/blob/master/text/0486-deprecate-mouseenter.md).
- [#18217](https://github.com/emberjs/ember.js/pull/18217) [BUGFIX] Adds ability for computed props to depend on args
- [#18222](https://github.com/emberjs/ember.js/pull/18222) [BUGFIX] Matches assertion behavior for CPs computing after destroy
| false |
Other
|
emberjs
|
ember.js
|
4427edd2db29b4fda0a246ac695315f10e23f0eb.json
|
Remove MU support in component blueprints
|
blueprints/component-test/index.js
|
@@ -6,7 +6,6 @@ const isPackageMissing = require('ember-cli-is-package-missing');
const getPathOption = require('ember-cli-get-component-path-option');
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
function needsCurlyBracketInvocation(options) {
let path = options.path || '';
@@ -34,47 +33,20 @@ module.exports = useTestFrameworkDetector({
],
fileMapTokens: function() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __test__() {
- return 'component-test';
- },
- __root__(options) {
- if (options.inRepoAddon) {
- return path.join('packages', options.inRepoAddon, 'src');
- }
- return 'src';
- },
- __testType__(options) {
- if (options.locals.testType === 'unit') {
- throw new Error("The --unit flag isn't supported within a module unification app");
- }
-
- return '';
- },
- __path__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
- return path.join('ui', 'components', options.dasherizedModuleName);
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__(options) {
- return options.locals.testType || 'integration';
- },
- __path__(options) {
- if (options.pod) {
- return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
- }
- return 'components';
- },
- };
- }
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__(options) {
+ return options.locals.testType || 'integration';
+ },
+ __path__(options) {
+ if (options.pod) {
+ return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
+ }
+ return 'components';
+ },
+ };
},
locals: function(options) {
@@ -93,16 +65,6 @@ module.exports = useTestFrameworkDetector({
if (options.pod && options.path !== 'components' && options.path !== '') {
componentPathName = [options.path, dasherizedModuleName].filter(Boolean).join('/');
- } else if (isModuleUnificationProject(this.project)) {
- if (options.inRepoAddon) {
- componentPathName = `${options.inRepoAddon}::${dasherizedModuleName}`;
- templateInvocation = `${stringUtil.classify(options.inRepoAddon)}::${classifiedModuleName}`;
- } else if (this.project.isEmberCLIAddon()) {
- componentPathName = `${this.project.pkg.name}::${dasherizedModuleName}`;
- templateInvocation = `${stringUtil.classify(
- this.project.pkg.name
- )}::${classifiedModuleName}`;
- }
}
if (needsCurlyBracketInvocation(options)) {
| true |
Other
|
emberjs
|
ember.js
|
4427edd2db29b4fda0a246ac695315f10e23f0eb.json
|
Remove MU support in component blueprints
|
blueprints/component/index.js
|
@@ -6,7 +6,6 @@ const stringUtil = require('ember-cli-string-utils');
const pathUtil = require('ember-cli-path-utils');
const getPathOption = require('ember-cli-get-component-path-option');
const normalizeEntityName = require('ember-cli-normalize-entity-name');
-const { isModuleUnificationProject } = require('../module-unification');
const { EOL } = require('os');
const { has } = require('@ember/edition-utils');
@@ -96,31 +95,7 @@ module.exports = {
fileMapTokens(options) {
let commandOptions = this.options;
- if (isModuleUnificationProject(this.project)) {
- return {
- __name__: function() {
- return 'component';
- },
- __root__(options) {
- if (options.inRepoAddon) {
- return path.join('packages', options.inRepoAddon, 'src');
- }
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'src');
- }
- return 'src';
- },
- __path__(options) {
- return path.join('ui', 'components', options.dasherizedModuleName);
- },
- __templatepath__(options) {
- return path.join('ui', 'components', options.dasherizedModuleName);
- },
- __templatename__: function() {
- return 'template';
- },
- };
- } else if (commandOptions.pod) {
+ if (commandOptions.pod) {
return {
__path__() {
return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
@@ -212,20 +187,18 @@ module.exports = {
let defaultExport = '';
let contents = '';
- if (!isModuleUnificationProject(this.project)) {
- // if we're in an addon, build import statement
- if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy)) {
- if (options.pod) {
- templatePath = './template';
- } else {
- templatePath =
- pathUtil.getRelativeParentPath(options.entity.name) +
- 'templates/components/' +
- stringUtil.dasherize(options.entity.name);
- }
- importTemplate = "import layout from '" + templatePath + "';" + EOL;
- contents = EOL + ' layout';
+ // if we're in an addon, build import statement
+ if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy)) {
+ if (options.pod) {
+ templatePath = './template';
+ } else {
+ templatePath =
+ pathUtil.getRelativeParentPath(options.entity.name) +
+ 'templates/components/' +
+ stringUtil.dasherize(options.entity.name);
}
+ importTemplate = "import layout from '" + templatePath + "';" + EOL;
+ contents = EOL + ' layout';
}
let componentClass = this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE
| true |
Other
|
emberjs
|
ember.js
|
4427edd2db29b4fda0a246ac695315f10e23f0eb.json
|
Remove MU support in component blueprints
|
node-tests/blueprints/component-test-test.js
|
@@ -5,20 +5,15 @@ const fs = require('fs-extra');
const blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
-const emberGenerate = blueprintHelpers.emberGenerate;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const modifyPackages = blueprintHelpers.modifyPackages;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
describe('Blueprint: component-test', function() {
setupTestHooks(this);
@@ -175,155 +170,6 @@ describe('Blueprint: component-test', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- describe('with [email protected]', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default.js')
- );
- });
- });
-
- it('component-test x-foo --unit', function() {
- return expectError(
- emberGenerate(['component-test', 'x-foo', '--unit']),
- "The --unit flag isn't supported within a module unification app"
- );
- });
-
- describe('with usePods=true', function() {
- beforeEach(function() {
- fs.writeFileSync(
- '.ember-cli',
- `{
- "disableAnalytics": false,
- "usePods": true
- }`
- );
- });
-
- it('component-test x-foo', function() {
- return expectError(
- emberGenerate(['component-test', 'x-foo']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
- });
-
- describe('with [email protected]', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/rfc232.js')
- );
- });
- });
-
- it('component-test x-foo --unit', function() {
- return expectError(
- emberGenerate(['component-test', 'x-foo', '--unit']),
- "The --unit flag isn't supported within a module unification app"
- );
- });
- });
-
- describe('with [email protected]', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-mocha', '0.11.0');
- });
-
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/mocha.js')
- );
- });
- });
-
- it('component-test x-foo --unit', function() {
- return expectError(
- emberGenerate(['component-test', 'x-foo', '--unit']),
- "The --unit flag isn't supported within a module unification app"
- );
- });
- });
-
- describe('with [email protected]', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-mocha', '0.12.0');
- });
-
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/mocha-0.12.js')
- );
- });
- });
-
- it('component-test x-foo --unit', function() {
- return expectError(
- emberGenerate(['component-test', 'x-foo', '--unit']),
- "The --unit flag isn't supported within a module unification app"
- );
- });
- });
-
- describe('with [email protected]', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
- generateFakePackageManifest('ember-mocha', '0.14.0');
- });
-
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/mocha-rfc232.js')
- );
- });
- });
-
- it('component-test x-foo --unit', function() {
- return expectError(
- emberGenerate(['component-test', 'x-foo', '--unit']),
- "The --unit flag isn't supported within a module unification app"
- );
- });
- });
- });
-
describe('in addon', function() {
beforeEach(function() {
return emberNew({ target: 'addon' })
| true |
Other
|
emberjs
|
ember.js
|
4427edd2db29b4fda0a246ac695315f10e23f0eb.json
|
Remove MU support in component blueprints
|
node-tests/blueprints/component-test.js
|
@@ -15,7 +15,6 @@ const generateFakePackageManifest = require('../helpers/generate-fake-package-ma
const fixture = require('../helpers/fixture');
const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
const enableOctane = setupTestEnvironment.enableOctane;
const { EMBER_SET_COMPONENT_TEMPLATE } = require('../../blueprints/component');
@@ -687,100 +686,6 @@ describe('Blueprint: component', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component foo', function() {
- return emberGenerateDestroy(['component', 'foo'], _file => {
- expect(_file('src/ui/components/foo/component.js')).to.equal(
- fixture('component/component.js')
- );
-
- expect(_file('src/ui/components/foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- });
- });
-
- it('component x-foo', function() {
- return emberGenerateDestroy(['component', 'x-foo'], _file => {
- expect(_file('src/ui/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('src/ui/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
- expect(_file('src/ui/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('src/ui/components/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-curly-template.js', {
- replace: {
- component: 'foo/x-foo',
- },
- })
- );
- });
- });
-
- it('component foo.js', function() {
- return emberGenerateDestroy(['component', 'foo.js'], _file => {
- expect(_file('src/ui/components/foo.js/component.js')).to.not.exist;
- expect(_file('src/ui/components/foo.js/template.hbs')).to.not.exist;
- expect(_file('src/ui/components/foo.js/component-test.js')).to.not.exist;
-
- expect(_file('src/ui/components/foo/component.js')).to.equal(
- fixture('component/component.js')
- );
-
- expect(_file('src/ui/components/foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- });
- });
- });
-
describe('in app - octane', function() {
enableOctane();
| true |
Other
|
emberjs
|
ember.js
|
c2ca5e80e969f4e04a2f6044a3b87cd171cec7a2.json
|
add async to Observable methods
|
packages/@ember/-internals/runtime/lib/mixins/observable.js
|
@@ -294,7 +294,7 @@ export default Mixin.create({
observer should be prepared to handle that.
There are two common invocation patterns for `.addObserver()`:
-
+
- Passing two arguments:
- the name of the property to observe (as a string)
- the function to invoke (an actual function)
@@ -362,11 +362,12 @@ export default Mixin.create({
@param {String} key The key to observe
@param {Object} target The target object to invoke
@param {String|Function} method The method to invoke
+ @param {Boolean} async Whether the observer is async or not
@return {Observable}
@public
*/
- addObserver(key, target, method) {
- addObserver(this, key, target, method);
+ addObserver(key, target, method, async) {
+ addObserver(this, key, target, method, async);
return this;
},
@@ -379,11 +380,12 @@ export default Mixin.create({
@param {String} key The key to observe
@param {Object} target The target object to invoke
@param {String|Function} method The method to invoke
+ @param {Boolean} async Whether the observer is async or not
@return {Observable}
@public
*/
- removeObserver(key, target, method) {
- removeObserver(this, key, target, method);
+ removeObserver(key, target, method, async) {
+ removeObserver(this, key, target, method, async);
return this;
},
| false |
Other
|
emberjs
|
ember.js
|
492ad6ac9ef0dc03d3950a866bb067698eeb3f30.json
|
remove unused feature flag
|
packages/@ember/canary-features/index.ts
|
@@ -72,9 +72,6 @@ export const EMBER_LIBRARIES_ISREGISTERED = featureValue(FEATURES.EMBER_LIBRARIE
export const EMBER_IMPROVED_INSTRUMENTATION = featureValue(FEATURES.EMBER_IMPROVED_INSTRUMENTATION);
export const EMBER_MODULE_UNIFICATION = featureValue(FEATURES.EMBER_MODULE_UNIFICATION);
export const EMBER_METAL_TRACKED_PROPERTIES = featureValue(FEATURES.EMBER_METAL_TRACKED_PROPERTIES);
-export const EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES = featureValue(
- FEATURES.EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES
-);
export const EMBER_CUSTOM_COMPONENT_ARG_PROXY = featureValue(
FEATURES.EMBER_CUSTOM_COMPONENT_ARG_PROXY
);
| false |
Other
|
emberjs
|
ember.js
|
7ae73e69fcf9c0a5ae18bc25f98460f0c5270bca.json
|
Add v3.13.0-beta.5 to CHANGELOG
[ci skip]
(cherry picked from commit 4b25250940989b7858e4b9ba3cbb94538a7c7f38)
|
CHANGELOG.md
|
@@ -1,5 +1,10 @@
# Ember Changelog
+### v3.13.0-beta.5 (September 3, 2019)
+
+- [#18314](https://github.com/emberjs/ember.js/pull/18314) [BUGFIX] Use class inheritance for getters and setters
+- [#18329](https://github.com/emberjs/ember.js/pull/18329) [BUGFIX] Eagerly consume aliases
+
### v3.13.0-beta.4 (August 26, 2019)
- [#18278](https://github.com/emberjs/ember.js/pull/18278) [BUGFIX] Bump ember-router-generator from v1.2.3 to v2.0.0 to support parsing `app/router.js` with native class.
| false |
Other
|
emberjs
|
ember.js
|
59d21e4d9869b040474a0df879a37564cc4911f8.json
|
Add a few targeted tests
This ensures `{{this.model}}` and the implicit `{{model}}` contunue
to be tested, to prevent any future regressions. It also tests the
behavior described in the RFC where `this.model` and `@model` could
diverge.
|
packages/@ember/-internals/glimmer/tests/integration/application/rendering-test.js
|
@@ -4,6 +4,8 @@ import { ENV } from '@ember/-internals/environment';
import Controller from '@ember/controller';
import { Route } from '@ember/-internals/routing';
import { Component } from '@ember/-internals/glimmer';
+import { set, tracked } from '@ember/-internals/metal';
+import { runTask } from '../../../../../../internal-test-helpers/lib/run';
moduleFor(
'Application test: rendering',
@@ -38,7 +40,7 @@ moduleFor(
});
}
- ['@feature(!EMBER_ROUTING_MODEL_ARG) it can access the model provided by the route']() {
+ ['@feature(EMBER_ROUTING_MODEL_ARG) it can access the model provided by the route via @model']() {
this.add(
'route:application',
Route.extend({
@@ -52,7 +54,7 @@ moduleFor(
'application',
strip`
<ul>
- {{#each this.model as |item|}}
+ {{#each @model as |item|}}
<li>{{item}}</li>
{{/each}}
</ul>
@@ -96,7 +98,7 @@ moduleFor(
});
}
- ['@feature(EMBER_ROUTING_MODEL_ARG) it can access the model provided by the route']() {
+ ['@test it can access the model provided by the route via this.model']() {
this.add(
'route:application',
Route.extend({
@@ -110,7 +112,39 @@ moduleFor(
'application',
strip`
<ul>
- {{#each @model as |item|}}
+ {{#each this.model as |item|}}
+ <li>{{item}}</li>
+ {{/each}}
+ </ul>
+ `
+ );
+
+ return this.visit('/').then(() => {
+ this.assertInnerHTML(strip`
+ <ul>
+ <li>red</li>
+ <li>yellow</li>
+ <li>blue</li>
+ </ul>
+ `);
+ });
+ }
+
+ ['@test it can access the model provided by the route via implicit this fallback']() {
+ this.add(
+ 'route:application',
+ Route.extend({
+ model() {
+ return ['red', 'yellow', 'blue'];
+ },
+ })
+ );
+
+ this.addTemplate(
+ 'application',
+ strip`
+ <ul>
+ {{#each model as |item|}}
<li>{{item}}</li>
{{/each}}
</ul>
@@ -128,6 +162,251 @@ moduleFor(
});
}
+ async ['@feature(EMBER_ROUTING_MODEL_ARG) interior mutations on the model with set'](assert) {
+ this.router.map(function() {
+ this.route('color', { path: '/:color' });
+ });
+
+ this.add(
+ 'route:color',
+ Route.extend({
+ model({ color }) {
+ return { color };
+ },
+ })
+ );
+
+ this.addTemplate(
+ 'color',
+ strip`
+ [@model: {{@model.color}}]
+ [this.model: {{this.model.color}}]
+ [model: {{model.color}}]
+ `
+ );
+
+ await this.visit('/red');
+
+ assert.equal(this.currentURL, '/red');
+
+ this.assertInnerHTML(strip`
+ [@model: red]
+ [this.model: red]
+ [model: red]
+ `);
+
+ await this.visit('/yellow');
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: yellow]
+ [this.model: yellow]
+ [model: yellow]
+ `);
+
+ runTask(() => {
+ let { model } = this.controllerFor('color');
+ set(model, 'color', 'blue');
+ });
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: blue]
+ [this.model: blue]
+ [model: blue]
+ `);
+ }
+
+ async ['@feature(EMBER_ROUTING_MODEL_ARG, EMBER_METAL_TRACKED_PROPERTIES) interior mutations on the model with tracked properties'](
+ assert
+ ) {
+ class Model {
+ @tracked color;
+
+ constructor(color) {
+ this.color = color;
+ }
+ }
+
+ this.router.map(function() {
+ this.route('color', { path: '/:color' });
+ });
+
+ this.add(
+ 'route:color',
+ Route.extend({
+ model({ color }) {
+ return new Model(color);
+ },
+ })
+ );
+
+ this.addTemplate(
+ 'color',
+ strip`
+ [@model: {{@model.color}}]
+ [this.model: {{this.model.color}}]
+ [model: {{model.color}}]
+ `
+ );
+
+ await this.visit('/red');
+
+ assert.equal(this.currentURL, '/red');
+
+ this.assertInnerHTML(strip`
+ [@model: red]
+ [this.model: red]
+ [model: red]
+ `);
+
+ await this.visit('/yellow');
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: yellow]
+ [this.model: yellow]
+ [model: yellow]
+ `);
+
+ runTask(() => {
+ this.controllerFor('color').model.color = 'blue';
+ });
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: blue]
+ [this.model: blue]
+ [model: blue]
+ `);
+ }
+
+ async ['@feature(EMBER_ROUTING_MODEL_ARG) exterior mutations on the model with set'](assert) {
+ this.router.map(function() {
+ this.route('color', { path: '/:color' });
+ });
+
+ this.add(
+ 'route:color',
+ Route.extend({
+ model({ color }) {
+ return color;
+ },
+ })
+ );
+
+ this.addTemplate(
+ 'color',
+ strip`
+ [@model: {{@model}}]
+ [this.model: {{this.model}}]
+ [model: {{model}}]
+ `
+ );
+
+ await this.visit('/red');
+
+ assert.equal(this.currentURL, '/red');
+
+ this.assertInnerHTML(strip`
+ [@model: red]
+ [this.model: red]
+ [model: red]
+ `);
+
+ await this.visit('/yellow');
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: yellow]
+ [this.model: yellow]
+ [model: yellow]
+ `);
+
+ runTask(() => {
+ let controller = this.controllerFor('color');
+ set(controller, 'model', 'blue');
+ });
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: yellow]
+ [this.model: blue]
+ [model: blue]
+ `);
+ }
+
+ async ['@feature(EMBER_ROUTING_MODEL_ARG, EMBER_METAL_TRACKED_PROPERTIES) exterior mutations on the model with tracked properties'](
+ assert
+ ) {
+ this.router.map(function() {
+ this.route('color', { path: '/:color' });
+ });
+
+ this.add(
+ 'route:color',
+ Route.extend({
+ model({ color }) {
+ return color;
+ },
+ })
+ );
+
+ this.add(
+ 'controller:color',
+ class ColorController extends Controller {
+ @tracked model;
+ }
+ );
+
+ this.addTemplate(
+ 'color',
+ strip`
+ [@model: {{@model}}]
+ [this.model: {{this.model}}]
+ [model: {{model}}]
+ `
+ );
+
+ await this.visit('/red');
+
+ assert.equal(this.currentURL, '/red');
+
+ this.assertInnerHTML(strip`
+ [@model: red]
+ [this.model: red]
+ [model: red]
+ `);
+
+ await this.visit('/yellow');
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: yellow]
+ [this.model: yellow]
+ [model: yellow]
+ `);
+
+ runTask(() => {
+ this.controllerFor('color').model = 'blue';
+ });
+
+ assert.equal(this.currentURL, '/yellow');
+
+ this.assertInnerHTML(strip`
+ [@model: yellow]
+ [this.model: blue]
+ [model: blue]
+ `);
+ }
+
['@feature(!EMBER_ROUTING_MODEL_ARG) it can render a nested route']() {
this.router.map(function() {
this.route('lists', function() {
| true |
Other
|
emberjs
|
ember.js
|
59d21e4d9869b040474a0df879a37564cc4911f8.json
|
Add a few targeted tests
This ensures `{{this.model}}` and the implicit `{{model}}` contunue
to be tested, to prevent any future regressions. It also tests the
behavior described in the RFC where `this.model` and `@model` could
diverge.
|
packages/ember/tests/routing/decoupled_basic_test.js
|
@@ -75,10 +75,6 @@ moduleFor(
return currentPath;
}
- get currentURL() {
- return this.appRouter.get('currentURL');
- }
-
handleURLRejectsWith(context, assert, path, expectedReason) {
return context
.visit(path)
| true |
Other
|
emberjs
|
ember.js
|
59d21e4d9869b040474a0df879a37564cc4911f8.json
|
Add a few targeted tests
This ensures `{{this.model}}` and the implicit `{{model}}` contunue
to be tested, to prevent any future regressions. It also tests the
behavior described in the RFC where `this.model` and `@model` could
diverge.
|
packages/internal-test-helpers/lib/module-for.js
|
@@ -79,7 +79,7 @@ export function setupTestClass(hooks, TestClass, ...mixins) {
return this.instance[name](assert);
});
} else {
- let match = /^@feature\(([A-Z_a-z-!]+)\) /.exec(name);
+ let match = /^@feature\(([A-Z_a-z-! ,]+)\) /.exec(name);
if (match) {
let features = match[1].replace(/ /g, '').split(',');
| true |
Other
|
emberjs
|
ember.js
|
59d21e4d9869b040474a0df879a37564cc4911f8.json
|
Add a few targeted tests
This ensures `{{this.model}}` and the implicit `{{model}}` contunue
to be tested, to prevent any future regressions. It also tests the
behavior described in the RFC where `this.model` and `@model` could
diverge.
|
packages/internal-test-helpers/lib/test-cases/application.js
|
@@ -33,9 +33,16 @@ export default class ApplicationTestCase extends TestResolverApplicationTestCase
return this.applicationInstance.lookup('router:main');
}
+ get currentURL() {
+ return this.appRouter.get('currentURL');
+ }
+
async transitionTo() {
await this.appRouter.transitionTo(...arguments);
-
await runLoopSettled();
}
+
+ controllerFor(name) {
+ return this.applicationInstance.lookup(`controller:${name}`);
+ }
}
| true |
Other
|
emberjs
|
ember.js
|
2522a99d539119b6307dcc712f549649b7a4814e.json
|
fix code fence
|
packages/@ember/-internals/routing/lib/services/router.ts
|
@@ -197,6 +197,7 @@ export default class RouterService extends Service {
}
}
}
+ ```
Just like with `transitionTo` and `replaceWith`, `urlFor` can also handle
query parameters.
| false |
Other
|
emberjs
|
ember.js
|
9f6bece75648d11222c54b828c18b47477bcdb1a.json
|
Update documentation for EmberArray.find
Add code examples for `EmberArray.find` method.
Issue #18228
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -778,6 +778,20 @@ const ArrayMixin = Mixin.create(Enumerable, {
Note that in addition to a callback, you can also pass an optional target
object that will be set as `this` on the context. This is a good way
to give your iterator function access to the current object.
+
+ Example Usage:
+
+ ```javascript
+ let users = [
+ { id: 1, name: 'Yehuda' },
+ { id: 2, name: 'Tom' },
+ { id: 3, name: 'Melanie' },
+ { id: 4, name: 'Leah' }
+ ];
+
+ users.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]
+ users.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
+ ```
@method find
@param {Function} callback The callback to execute
| false |
Other
|
emberjs
|
ember.js
|
92dcebf8ccea4f2ff53d4138b5a8b3c935e9b503.json
|
Add v3.13.0-beta.4 to CHANGELOG
[ci skip]
(cherry picked from commit 29d67b93df69cb57a94e16c0d9c082ba363fae16)
|
CHANGELOG.md
|
@@ -1,5 +1,12 @@
# Ember Changelog
+### v3.13.0-beta.4 (August 26, 2019)
+
+- [#18278](https://github.com/emberjs/ember.js/pull/18278) [BUGFIX] Bump ember-router-generator from v1.2.3 to v2.0.0 to support parsing `app/router.js` with native class.
+- [#18291](https://github.com/emberjs/ember.js/pull/18291) [BUGFIX] Adds the babel-helpers injection plugin back and include `ember-template-compiler` in the vendor folder for Ember.
+- [#18296](https://github.com/emberjs/ember.js/pull/18296) [BUGFIX] Ensure {{each-in}} can iterate over keys with periods
+- [#18304](https://github.com/emberjs/ember.js/pull/18304) [BUGFIX] Check the EMBER_ENV environment variable after it is set
+
### v3.13.0-beta.3 (August 19, 2019)
- [#18223](https://github.com/emberjs/ember.js/pull/18223) [FEATURE] Tracked Props Performance Tuning
| false |
Other
|
emberjs
|
ember.js
|
86c1a48a735bab9a0130ee4463efa40a9d118634.json
|
Add v3.13.0-beta.3 to CHANGELOG
[ci skip]
(cherry picked from commit f4650a010f532e7d8c4f95bfdc7ab009f274bc25)
|
CHANGELOG.md
|
@@ -1,5 +1,16 @@
# Ember Changelog
+### v3.13.0-beta.3 (August 19, 2019)
+
+- [#18223](https://github.com/emberjs/ember.js/pull/18223) [FEATURE] Tracked Props Performance Tuning
+- [#18208](https://github.com/emberjs/ember.js/pull/18208) [BUGFIX] Compile Ember dynamically in consuming applications
+- [#18266](https://github.com/emberjs/ember.js/pull/18266) [BUGFIX] Autotrack Modifiers and Helpers
+- [#18267](https://github.com/emberjs/ember.js/pull/18267) [BUGFIX] Router#url should not error when `location` is a string
+- [#18270](https://github.com/emberjs/ember.js/pull/18270) [BUGFIX] Prevent cycle dependency with owner association.
+- [#18274](https://github.com/emberjs/ember.js/pull/18274) [BUGFIX] Allow CPs to depend on nested args
+- [#18276](https://github.com/emberjs/ember.js/pull/18276) [BUGFIX] Change the assertion for @each dependencies into a deprecation
+- [#18281](https://github.com/emberjs/ember.js/pull/18281) [BUGFIX] Check length of targets
+
### v3.13.0.beta.2 (August 12, 2019)
- [#18248](https://github.com/emberjs/ember.js/pull/18248) [BUGFIX] Ensures that observers are flushed after CPs are updated
| false |
Other
|
emberjs
|
ember.js
|
1d6bff0d18670e7655b65d80eb4938430aa467b0.json
|
Update documentation for EmberArray.findBy
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -790,6 +790,21 @@ const ArrayMixin = Mixin.create(Enumerable, {
This method works much like the more generic `find()` method.
+ Usage Example:
+
+ ```javascript
+ let users = [
+ { id: 1, name: 'Yehuda', isTom: false },
+ { id: 2, name: 'Tom', isTom: true },
+ { id: 3, name: 'Melanie', isTom: false },
+ { id: 4, name: 'Leah', isTom: false }
+ ];
+
+ users.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }
+ users.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }
+ users.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
+ ```
+
@method findBy
@param {String} key the property to test
@param {String} [value] optional value to test against.
| false |
Other
|
emberjs
|
ember.js
|
1787f810d530e2707f68526f192668fbec873ce5.json
|
Add code example for EmberArray.filter
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -637,12 +637,10 @@ const ArrayMixin = Mixin.create(Enumerable, {
mapBy,
/**
- Returns an array with all of the items in the enumeration that the passed
- function returns true for. This method corresponds to `filter()` defined in
- JavaScript 1.6.
+ Returns a new array with all of the items in the enumeration that the provided
+ callback function returns true for. This method corresponds to [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
- The callback method you provide should have the following signature (all
- parameters are optional):
+ The callback method should have the following signature:
```javascript
function(item, index, array);
@@ -652,12 +650,24 @@ const ArrayMixin = Mixin.create(Enumerable, {
- `index` is the current index in the iteration.
- `array` is the array itself.
- It should return `true` to include the item in the results, `false`
- otherwise.
+ All parameters are optional. The function should return `true` to include the item
+ in the results, and `false` otherwise.
- Note that in addition to a callback, you can also pass an optional target
- object that will be set as `this` on the context. This is a good way
- to give your iterator function access to the current object.
+ Example:
+
+ ```javascript
+ function isAdult(person) {
+ return person.age > 18;
+ };
+
+ let people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);
+
+ people.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
+ ```
+
+ Note that in addition to a callback, you can pass an optional target object
+ that will be set as `this` on the context. This is a good way to give your
+ iterator function access to the current object.
@method filter
@param {Function} callback The callback to execute
| false |
Other
|
emberjs
|
ember.js
|
f4ba42ab54ef660e62565b05b3556b560b79d72b.json
|
Add code example for EmberArray.addArrayObserver
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -452,6 +452,29 @@ const ArrayMixin = Mixin.create(Enumerable, {
`willChange` and `didChange` option.
@return {EmberArray} receiver
@public
+ @example
+ import Service from '@ember/service';
+
+ export default Service.extend({
+ data: Ember.A(),
+
+ init() {
+ this._super(...arguments);
+
+ this.data.addArrayObserver(this, {
+ willChange: 'dataWillChange',
+ didChange: 'dataDidChange'
+ });
+ },
+
+ dataWillChange(array, start, removeCount, addCount) {
+ console.log('array will change', array, start, removeCount, addCount);
+ },
+
+ dataDidChange(array, start, removeCount, addCount) {
+ console.log('array did change', array, start, removeCount, addCount);
+ }
+ });
*/
addArrayObserver(target, opts) {
| false |
Other
|
emberjs
|
ember.js
|
4ac76231331f444c78ecba99461f9ded016d3a6c.json
|
Fix typos and simplify EmberArray definition
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -186,10 +186,10 @@ function mapBy(key) {
concrete implementation, but it can be used up by other classes that want
to appear like arrays.
- For example, ArrayProxy is a concrete classes that can
- be instantiated to implement array-like behavior. Both of these classes use
- the Array Mixin by way of the MutableArray mixin, which allows observable
- changes to be made to the underlying array.
+ For example, ArrayProxy is a concrete class that can be instantiated to
+ implement array-like behavior. This class uses the Array Mixin by way of
+ the MutableArray mixin, which allows observable changes to be made to the
+ underlying array.
This mixin defines methods specifically for collections that provide
index-ordered access to their contents. When you are designing code that
@@ -203,8 +203,8 @@ function mapBy(key) {
as controllers and collections.
You can use the methods defined in this module to access and modify array
- contents in a KVO-friendly way. You can also be notified whenever the
- membership of an array changes by using `.observes('myArray.[]')`.
+ contents in an observable-friendly way. You can also be notified whenever
+ the membership of an array changes by using `.observes('myArray.[]')`.
To support `EmberArray` in your own class, you must override two
primitives to use it: `length()` and `objectAt()`.
| false |
Other
|
emberjs
|
ember.js
|
786ad9b6f5387a6e818244110b8c8e2377040cb9.json
|
Write test for _optionsForQueryParam
|
packages/@ember/-internals/routing/tests/system/route_test.js
|
@@ -163,6 +163,34 @@ moduleFor(
runDestroy(owner);
}
+ ["@test _optionsForQueryParam should work with nested properties"](assert) {
+ let route = EmberRoute.extend({
+ queryParams: {
+ 'nested.foo': {
+ // By default, controller query param properties don't
+ // cause a full transition when they are changed, but
+ // rather only cause the URL to update. Setting
+ // `refreshModel` to true will cause an "in-place"
+ // transition to occur, whereby the model hooks for
+ // this route (and any child routes) will re-fire, allowing
+ // you to reload models (e.g., from the server) using the
+ // updated query param values.
+ refreshModel: true,
+
+ // By default, the query param URL key is the same name as
+ // the controller property name. Use `as` to specify a
+ // different URL key.
+ as: 'foobar'
+ }
+ }
+ }).create();
+
+ assert.strictEqual(route._optionsForQueryParam({
+ prop: 'nested.foo',
+ urlKey: 'foobar'
+ }), route.queryParams['nested.foo']);
+ }
+
["@test modelFor doesn't require the routerMicrolib"](assert) {
let route = EmberRoute.create({
_router: { _routerMicrolib: null },
| false |
Other
|
emberjs
|
ember.js
|
bd7f49282a489663cccdb7a2a948a60c62a51f29.json
|
Add test for 18253
|
packages/@ember/-internals/glimmer/tests/integration/components/tracked-test.js
|
@@ -245,6 +245,10 @@ if (EMBER_METAL_TRACKED_PROPERTIES) {
runTask(() => this.$('button').click());
this.assertText('1');
+
+ runTask(() => this.$('button').click());
+
+ this.assertText('2');
}
'@test nested getters update when dependent properties are invalidated'() {
| false |
Other
|
emberjs
|
ember.js
|
f4eb13b345afdfea9e0bc041d1aae2426be085e0.json
|
fix prod tests
|
packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-curly-test.js
|
@@ -69,17 +69,20 @@ moduleFor(
}
['@test `(query-params)` must be used in conjunction with `{{link-to}}'](assert) {
- if (DEBUG) {
- this.addTemplate(
- 'index',
- `{{#let (query-params foo='456' bar='NAW') as |qp|}}{{link-to 'Index' 'index' qp}}{{/let}}`
- );
-
- return assert.rejectsAssertion(
- this.visit('/'),
- /The `\(query-params\)` helper can only be used when invoking the `{{link-to}}` component\./
- );
+ if (!DEBUG) {
+ assert.expect(0);
+ return;
}
+
+ this.addTemplate(
+ 'index',
+ `{{#let (query-params foo='456' bar='NAW') as |qp|}}{{link-to 'Index' 'index' qp}}{{/let}}`
+ );
+
+ return assert.rejectsAssertion(
+ this.visit('/'),
+ /The `\(query-params\)` helper can only be used when invoking the `{{link-to}}` component\./
+ );
}
}
);
| true |
Other
|
emberjs
|
ember.js
|
f4eb13b345afdfea9e0bc041d1aae2426be085e0.json
|
fix prod tests
|
packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-angle-test.js
|
@@ -5,6 +5,7 @@ import { alias } from '@ember/-internals/metal';
import { subscribe, reset } from '@ember/instrumentation';
import { Route, NoneLocation } from '@ember/-internals/routing';
import { EMBER_IMPROVED_INSTRUMENTATION } from '@ember/canary-features';
+import { DEBUG } from '@glimmer/env';
// IE includes the host name
function normalizeUrl(url) {
@@ -1416,7 +1417,10 @@ moduleFor(
}
async [`@test the <LinkTo /> component throws a useful error if you invoke it wrong`](assert) {
- assert.expect(1);
+ if (!DEBUG) {
+ assert.expect(0);
+ return;
+ }
this.router.map(function() {
this.route('post', { path: 'post/:post_id' });
| true |
Other
|
emberjs
|
ember.js
|
f4eb13b345afdfea9e0bc041d1aae2426be085e0.json
|
fix prod tests
|
packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-curly-test.js
|
@@ -5,6 +5,7 @@ import { alias } from '@ember/-internals/metal';
import { subscribe, reset } from '@ember/instrumentation';
import { Route, NoneLocation } from '@ember/-internals/routing';
import { EMBER_IMPROVED_INSTRUMENTATION } from '@ember/canary-features';
+import { DEBUG } from '@glimmer/env';
// IE includes the host name
function normalizeUrl(url) {
@@ -1656,7 +1657,10 @@ moduleFor(
}
async [`@test the {{link-to}} component throws a useful error if you invoke it wrong`](assert) {
- assert.expect(1);
+ if (!DEBUG) {
+ assert.expect(0);
+ return;
+ }
this.router.map(function() {
this.route('post', { path: 'post/:post_id' });
| true |
Other
|
emberjs
|
ember.js
|
2ee24e149401b3907ea96513a88d1b8516f8835e.json
|
Update documentation for EmberArray.any
Prior to this change, the wording was inaccurate. It was describing
filtering not the short circuit behaviour of `any()`.
This change attempts to fix that discrepancy and expand on the example
to include both context option and arrow function use.
Issue #18228
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -860,11 +860,10 @@ const ArrayMixin = Mixin.create(Enumerable, {
},
/**
- Returns `true` if the passed function returns true for any item in the
- enumeration.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
+ The any() method executes the callback function once for each element
+ present in the array until it finds the one where callback returns a truthy
+ value (i.e. `true`). If such an element is found, any() immediately returns
+ true. Otherwise, any() returns false.
```javascript
function(item, index, array);
@@ -874,18 +873,21 @@ const ArrayMixin = Mixin.create(Enumerable, {
- `index` is the current index in the iteration.
- `array` is the array object itself.
- It must return a truthy value (i.e. `true`) to include an item in the
- results. Any non-truthy return value will discard the item from the
- results.
-
Note that in addition to a callback, you can also pass an optional target
- object that will be set as `this` on the context. This is a good way
- to give your iterator function access to the current object.
+ object that will be set as `this` on the context. It can be a good way
+ to give your iterator function access to an object in cases where an ES6
+ arrow function would not be appropriate.
Usage Example:
```javascript
- if (people.any(isManager)) {
+ let includesManager = people.any(this.findPersonInManagersList, this);
+
+ let includesStockHolder = people.any(person => {
+ return this.findPersonInStockHoldersList(person)
+ });
+
+ if (includesManager || includesStockHolder) {
Paychecks.addBiggerBonus();
}
```
| false |
Other
|
emberjs
|
ember.js
|
1cc23ff1beebb252840a163410ee9b9e6c8c6eff.json
|
Add code example for EmberArray.every
|
packages/@ember/-internals/runtime/lib/mixins/array.js
|
@@ -802,10 +802,9 @@ const ArrayMixin = Mixin.create(Enumerable, {
/**
Returns `true` if the passed function returns true for every item in the
- enumeration. This corresponds with the `every()` method in JavaScript 1.6.
+ enumeration. This corresponds with the `Array.prototype.every()` method defined in ES5.
- The callback method you provide should have the following signature (all
- parameters are optional):
+ The callback method should have the following signature:
```javascript
function(item, index, array);
@@ -815,18 +814,21 @@ const ArrayMixin = Mixin.create(Enumerable, {
- `index` is the current index in the iteration.
- `array` is the array itself.
- It should return the `true` or `false`.
+ All params are optional. The method should return `true` or `false`.
Note that in addition to a callback, you can also pass an optional target
object that will be set as `this` on the context. This is a good way
to give your iterator function access to the current object.
- Example Usage:
+ Usage example:
```javascript
- if (people.every(isEngineer)) {
- Paychecks.addBigBonus();
- }
+ function isAdult(person) {
+ return person.age > 18;
+ };
+
+ const people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);
+ const areAllAdults = people.every(isAdult);
```
@method every
| false |
Other
|
emberjs
|
ember.js
|
2a5e2c7bf99755a0b270f36b8181e0dda3943ccc.json
|
Add missing runTask
|
packages/internal-test-helpers/lib/test-cases/abstract-application.js
|
@@ -18,7 +18,9 @@ export default class AbstractApplicationTestCase extends AbstractTestCase {
async visit(url, options) {
// Create the instance
- let instance = await this._ensureInstance(options).then(instance => instance.visit(url));
+ let instance = await this._ensureInstance(options).then(instance =>
+ runTask(() => instance.visit(url))
+ );
// Await all asynchronous actions
await runLoopSettled();
| false |
Other
|
emberjs
|
ember.js
|
1f5eee0f762a808d38ed1c466b5fa013fe0e6688.json
|
Add v3.13.0-beta.1 to CHANGELOG
[ci skip]
(cherry picked from commit 3e9e51811586f7aa50ced5780e224bb488a262a7)
|
CHANGELOG.md
|
@@ -1,5 +1,13 @@
# Ember Changelog
+### v3.13.0-beta.1 (August 6, 2019)
+
+- [#16366](https://github.com/emberjs/ember.js/pull/16366) / [#16903](https://github.com/emberjs/ember.js/pull/16903) / [#17572](https://github.com/emberjs/ember.js/pull/17572) / [#17682](https://github.com/emberjs/ember.js/pull/17682) / [#17765](https://github.com/emberjs/ember.js/pull/17765) / [#17751](https://github.com/emberjs/ember.js/pull/17751) / [#17835](https://github.com/emberjs/ember.js/pull/17835) / [#18059](https://github.com/emberjs/ember.js/pull/18059) / [#17951](https://github.com/emberjs/ember.js/pull/17951) / [#18069](https://github.com/emberjs/ember.js/pull/18069) / [#18074](https://github.com/emberjs/ember.js/pull/18074) / [#18073](https://github.com/emberjs/ember.js/pull/18073) / [#18091](https://github.com/emberjs/ember.js/pull/18091) / [#18186](https://github.com/emberjs/ember.js/pull/18186) [FEATURE] Implement the [Tracked Properties](https://github.com/emberjs/rfcs/blob/master/text/0410-tracked-properties.md) and [Tracked Property Updates](https://github.com/emberjs/rfcs/blob/master/text/0478-tracked-properties-updates.md) RFCs.
+- [#18158](https://github.com/emberjs/ember.js/pull/18158) / [#18203](https://github.com/emberjs/ember.js/pull/18203) / [#18198](https://github.com/emberjs/ember.js/pull/18198) / [#18190](https://github.com/emberjs/ember.js/pull/18190) [FEATURE] Implement the [Component Templates Co-location](https://github.com/emberjs/rfcs/blob/master/text/0481-component-templates-co-location.md).
+- [#18214](https://github.com/emberjs/ember.js/pull/18214) [DEPRECATION] Implement the [Deprecate support for mouseEnter/Leave/Move Ember events](https://github.com/emberjs/rfcs/blob/master/text/0486-deprecate-mouseenter.md).
+- [#18217](https://github.com/emberjs/ember.js/pull/18217) [BUGFIX] Adds ability for computed props to depend on args
+- [#18222](https://github.com/emberjs/ember.js/pull/18222) [BUGFIX] Matches assertion behavior for CPs computing after destroy
+
### v3.12.0 (August 5, 2019)
- [#18159](https://github.com/emberjs/ember.js/pull/18159) [BUGFIX] Update router.js to ensure buildRouteInfoMetadata does not eagerly cache routes in lazy Engines
| false |
Other
|
emberjs
|
ember.js
|
1479f4aa2b101ce94314527fa096eed74cff2126.json
|
Add v3.12.0 to CHANGELOG
[ci skip]
(cherry picked from commit e374285bc3c1c615bf35db66afc157cd80420790)
|
CHANGELOG.md
|
@@ -1,7 +1,9 @@
# Ember Changelog
-# v3.12.0-beta.1 (June 27, 2019)
+### v3.12.0 (August 5, 2019)
+- [#18159](https://github.com/emberjs/ember.js/pull/18159) [BUGFIX] Update router.js to ensure buildRouteInfoMetadata does not eagerly cache routes in lazy Engines
+- [#18226](https://github.com/emberjs/ember.js/pull/18226) [BUGFIX] Fix routing path with double slash (#18226)
- [#17406](https://github.com/emberjs/ember.js/pull/17406) [BUGFIX] Properties observed through `Ember.Observer` can be set to `undefined`
- [#18150](https://github.com/emberjs/ember.js/pull/18150) [BUGFIX] Fix a memory retention issue with string-based event listeners
- [#18124](https://github.com/emberjs/ember.js/pull/18124) [CLEANUP] Remove deprecated `NAME_KEY`
| false |
Other
|
emberjs
|
ember.js
|
77b4bc6c14f603de7d2ff1a8b2d8d5f901a8edd4.json
|
Avoid assertions for Symbol when not present.
Co-authored-by: Godfrey Chan <[email protected]>
|
packages/@ember/-internals/glimmer/tests/integration/components/component-template-test.js
|
@@ -4,6 +4,7 @@ import {
EMBER_GLIMMER_SET_COMPONENT_TEMPLATE,
EMBER_MODULE_UNIFICATION,
} from '@ember/canary-features';
+import { HAS_NATIVE_SYMBOL } from '@ember/-internals/utils';
import { Component, compile } from '../../utils/helpers';
import { setComponentTemplate, getComponentTemplate } from '../../..';
@@ -74,9 +75,11 @@ if (EMBER_GLIMMER_SET_COMPONENT_TEMPLATE) {
setComponentTemplate(compile('foo'), 'foo');
}, /Cannot call `setComponentTemplate` on `foo`/);
- expectAssertion(() => {
- setComponentTemplate(compile('foo'), Symbol('foo'));
- }, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
+ if (HAS_NATIVE_SYMBOL) {
+ expectAssertion(() => {
+ setComponentTemplate(compile('foo'), Symbol('foo'));
+ }, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
+ }
}
'@test calling it twice on the same object asserts'() {
| false |
Other
|
emberjs
|
ember.js
|
c4cdae990ce827d8e143b95c6fcd0331b967c7aa.json
|
Implement component co-location blueprints (#18203)
Implement component co-location blueprints
Co-authored-by: Robert Jackson <[email protected]>
|
blueprints/component-addon/native-files/__root__/__templatepath__/__templatename__.js
|
@@ -1 +0,0 @@
-export { default } from '<%= templatePath %>';
| true |
Other
|
emberjs
|
ember.js
|
c4cdae990ce827d8e143b95c6fcd0331b967c7aa.json
|
Implement component co-location blueprints (#18203)
Implement component co-location blueprints
Co-authored-by: Robert Jackson <[email protected]>
|
blueprints/component/files/__root__/__path__/__name__.js
|
@@ -1,4 +1,3 @@
-import Component from '@ember/component';
+<%= importComponent %>
<%= importTemplate %>
-export default Component.extend({<%= contents %>
-});
+export default <%= defaultExport %>
| true |
Other
|
emberjs
|
ember.js
|
c4cdae990ce827d8e143b95c6fcd0331b967c7aa.json
|
Implement component co-location blueprints (#18203)
Implement component co-location blueprints
Co-authored-by: Robert Jackson <[email protected]>
|
blueprints/component/index.js
|
@@ -1,15 +1,25 @@
'use strict';
const path = require('path');
+const SilentError = require('silent-error');
const stringUtil = require('ember-cli-string-utils');
const pathUtil = require('ember-cli-path-utils');
const getPathOption = require('ember-cli-get-component-path-option');
const normalizeEntityName = require('ember-cli-normalize-entity-name');
-const useEditionDetector = require('../edition-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
-const EOL = require('os').EOL;
+const { isModuleUnificationProject } = require('../module-unification');
+const { EOL } = require('os');
+
+const OCTANE = process.env.EMBER_VERSION === 'octane';
+
+// TODO: this should be reading from the @ember/canary-features module
+// need to refactor broccoli/features.js to be able to work more similarly
+// to https://github.com/emberjs/data/pull/6231
+const EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = OCTANE;
+
+// intentionally avoiding use-edition-detector
+module.exports = {
+ EMBER_GLIMMER_SET_COMPONENT_TEMPLATE,
-module.exports = useEditionDetector({
description: 'Generates a component.',
availableOptions: [
@@ -19,9 +29,66 @@ module.exports = useEditionDetector({
default: 'components',
aliases: [{ 'no-path': '' }],
},
+ {
+ name: 'component-class',
+ type: ['@ember/component', '@glimmer/component', '@ember/component/template-only', ''],
+ default: OCTANE ? '--no-component-class' : '@ember/component',
+ aliases: [
+ { cc: '@ember/component' },
+ { gc: '@glimmer/component' },
+ { tc: '@ember/component/template-only' },
+ { nc: '' },
+ { 'no-component-class': '' },
+ ],
+ },
+ {
+ name: 'component-structure',
+ type: ['flat', 'nested', 'classic'],
+ default: OCTANE ? 'flat' : 'classic',
+ aliases: [{ fs: 'flat' }, { ns: 'nested' }, { cs: 'classic' }],
+ },
],
- fileMapTokens: function() {
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ let isOctane = process.env.EMBER_VERSION === 'OCTANE';
+
+ this.availableOptions.forEach(option => {
+ if (option.name === 'component-class') {
+ if (isOctane) {
+ option.default = '--no-component-class';
+ } else {
+ option.default = '@ember/component';
+ }
+ } else if (option.name === 'component-structure') {
+ option.default = isOctane ? 'flat' : 'classic';
+ }
+ });
+
+ this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = EMBER_GLIMMER_SET_COMPONENT_TEMPLATE || isOctane;
+ },
+
+ install(options) {
+ if (!this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE) {
+ if (options.componentClass !== '@ember/component') {
+ throw new SilentError(
+ 'Usage of --component-class argument to `ember generate component` is only available on canary'
+ );
+ }
+
+ if (options.componentStructure !== 'classic') {
+ throw new SilentError(
+ 'Usage of --component-structure argument to `ember generate component` is only available on canary'
+ );
+ }
+ }
+
+ return this._super.install.apply(this, arguments);
+ },
+
+ fileMapTokens(options) {
+ let commandOptions = this.options;
+
if (isModuleUnificationProject(this.project)) {
return {
__name__: function() {
@@ -46,40 +113,96 @@ module.exports = useEditionDetector({
return 'template';
},
};
- } else {
+ } else if (commandOptions.pod) {
return {
- __path__: function(options) {
- if (options.pod) {
- return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
- } else {
- return 'components';
- }
+ __path__() {
+ return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
},
- __templatepath__: function(options) {
- if (options.pod) {
- return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
- }
+ __templatepath__() {
+ return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
+ },
+ __templatename__() {
+ return 'template';
+ },
+ };
+ } else if (
+ !this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE ||
+ commandOptions.componentStructure === 'classic'
+ ) {
+ return {
+ __path__() {
+ return 'components';
+ },
+ __templatepath__() {
return 'templates/components';
},
- __templatename__: function(options) {
- if (options.pod) {
- return 'template';
- }
+ __templatename__() {
return options.dasherizedModuleName;
},
};
+ } else if (
+ this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE &&
+ commandOptions.componentStructure === 'flat'
+ ) {
+ return {
+ __path__() {
+ return 'components';
+ },
+ __templatepath__() {
+ return 'components';
+ },
+ __templatename__() {
+ return options.dasherizedModuleName;
+ },
+ };
+ } else if (
+ this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE &&
+ commandOptions.componentStructure === 'nested'
+ ) {
+ return {
+ __path__() {
+ return `components/${options.dasherizedModuleName}`;
+ },
+ __name__() {
+ return 'index';
+ },
+ __templatepath__() {
+ return `components/${options.dasherizedModuleName}`;
+ },
+ __templatename__() {
+ return `index`;
+ },
+ };
}
},
- normalizeEntityName: function(entityName) {
+ files() {
+ let files = this._super.files.apply(this, arguments);
+
+ if (
+ this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE &&
+ (this.options.componentClass === '' || this.options.componentClass === '--no-component-class')
+ ) {
+ files = files.filter(file => !file.endsWith('.js'));
+ }
+
+ return files;
+ },
+
+ normalizeEntityName(entityName) {
return normalizeEntityName(
entityName.replace(/\.js$/, '') //Prevent generation of ".js.js" files
);
},
- locals: function(options) {
+ locals(options) {
+ let sanitizedModuleName = options.entity.name.replace(/\//g, '-');
+ let classifiedModuleName = stringUtil.classify(sanitizedModuleName);
+
let templatePath = '';
+ let importComponent = '';
let importTemplate = '';
+ let defaultExport = '';
let contents = '';
if (!isModuleUnificationProject(this.project)) {
@@ -98,10 +221,32 @@ module.exports = useEditionDetector({
}
}
+ let componentClass = this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE
+ ? options.componentClass
+ : '@ember/component';
+
+ switch (componentClass) {
+ case '@ember/component':
+ importComponent = `import Component from '@ember/component';`;
+ defaultExport = `Component.extend({${contents}\n});`;
+ break;
+ case '@glimmer/component':
+ importComponent = `import Component from '@glimmer/component';`;
+ defaultExport = `class ${classifiedModuleName}Component extends Component {\n}`;
+ break;
+ case '':
+ case '@ember/component/template-only':
+ importComponent = `import templateOnly from '@ember/component/template-only';`;
+ defaultExport = `templateOnly();`;
+ break;
+ }
+
return {
- importTemplate: importTemplate,
- contents: contents,
+ importTemplate,
+ importComponent,
+ defaultExport,
path: getPathOption(options),
+ componentClass: options.componentClass,
};
},
-});
+};
| true |
Other
|
emberjs
|
ember.js
|
c4cdae990ce827d8e143b95c6fcd0331b967c7aa.json
|
Implement component co-location blueprints (#18203)
Implement component co-location blueprints
Co-authored-by: Robert Jackson <[email protected]>
|
blueprints/component/native-files/__root__/__path__/__name__.js
|
@@ -1,4 +0,0 @@
-import Component from '@glimmer/component';
-
-export default class <%= classifiedModuleName %>Component extends Component {
-}
| true |
Other
|
emberjs
|
ember.js
|
c4cdae990ce827d8e143b95c6fcd0331b967c7aa.json
|
Implement component co-location blueprints (#18203)
Implement component co-location blueprints
Co-authored-by: Robert Jackson <[email protected]>
|
blueprints/component/native-files/__root__/__templatepath__/__templatename__.hbs
|
@@ -1 +0,0 @@
-{{yield}}
\ No newline at end of file
| true |
Other
|
emberjs
|
ember.js
|
c4cdae990ce827d8e143b95c6fcd0331b967c7aa.json
|
Implement component co-location blueprints (#18203)
Implement component co-location blueprints
Co-authored-by: Robert Jackson <[email protected]>
|
node-tests/blueprints/component-test.js
|
@@ -1,5 +1,6 @@
'use strict';
+const fs = require('fs');
const blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
@@ -17,6 +18,25 @@ const setupTestEnvironment = require('../helpers/setup-test-environment');
const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
const enableOctane = setupTestEnvironment.enableOctane;
+const { EMBER_SET_COMPONENT_TEMPLATE } = require('../../blueprints/component');
+
+const glimmerComponentContents = `import Component from '@glimmer/component';
+
+export default class FooComponent extends Component {
+}
+`;
+
+const emberComponentContents = `import Component from '@ember/component';
+
+export default Component.extend({
+});
+`;
+
+const templateOnlyContents = `import templateOnly from '@ember/component/template-only';
+
+export default templateOnly();
+`;
+
describe('Blueprint: component', function() {
setupTestHooks(this);
@@ -34,7 +54,7 @@ describe('Blueprint: component', function() {
it('component foo', function() {
return emberGenerateDestroy(['component', 'foo'], _file => {
- expect(_file('app/components/foo.js')).to.equal(fixture('component/component.js'));
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
@@ -49,6 +69,200 @@ describe('Blueprint: component', function() {
});
});
+ if (EMBER_SET_COMPONENT_TEMPLATE) {
+ // classic default
+ it('component foo --component-structure=classic --component-class=@ember/component', function() {
+ return emberGenerateDestroy(
+ [
+ 'component',
+ 'foo',
+ '--component-structure',
+ 'classic',
+ '--component-class',
+ '@ember/component',
+ ],
+ _file => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
+
+ expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ // Octane default
+ it('component foo --component-structure=flat --component-class=@glimmer/component', function() {
+ return emberGenerateDestroy(
+ [
+ 'component',
+ '--component-structure',
+ 'flat',
+ '--component-class',
+ '@glimmer/component',
+ 'foo',
+ ],
+ _file => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
+
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ it('component foo --component-structure=flat', function() {
+ return emberGenerateDestroy(
+ ['component', '--component-structure', 'flat', 'foo'],
+ _file => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
+
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ it('component foo --component-structure=nested', function() {
+ return emberGenerateDestroy(
+ ['component', '--component-structure', 'nested', 'foo'],
+ _file => {
+ expect(_file('app/components/foo/index.js')).to.equal(emberComponentContents);
+
+ expect(_file('app/components/foo/index.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ it('component foo --component-structure=classic', function() {
+ return emberGenerateDestroy(
+ ['component', '--component-structure', 'classic', 'foo'],
+ _file => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
+
+ expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ it('component foo --component-class=@ember/component', function() {
+ return emberGenerateDestroy(
+ ['component', '--component-class', '@ember/component', 'foo'],
+ _file => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
+
+ expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ it('component foo --component-class=@glimmer/component', function() {
+ return emberGenerateDestroy(
+ ['component', '--component-class', '@glimmer/component', 'foo'],
+ _file => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
+
+ expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ it('component foo --component-class=@ember/component/template-only', function() {
+ return emberGenerateDestroy(
+ ['component', '--component-class', '@ember/component/template-only', 'foo'],
+ _file => {
+ expect(_file('app/components/foo.js')).to.equal(templateOnlyContents);
+
+ expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ }
+ );
+ });
+
+ it('component foo --no-component-class', function() {
+ return emberGenerateDestroy(['component', '--no-component-class', 'foo'], _file => {
+ expect(fs.existsSync('app/components/foo.js')).to.equal(false);
+
+ expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ });
+ });
+ }
it('component x-foo', function() {
return emberGenerateDestroy(['component', 'x-foo'], _file => {
expect(_file('app/components/x-foo.js')).to.equal(fixture('component/component-dash.js'));
@@ -583,9 +797,8 @@ describe('Blueprint: component', function() {
it('component foo', function() {
return emberGenerateDestroy(['component', 'foo'], _file => {
- expect(_file('app/components/foo.js')).to.equal(fixture('component/native-component.js'));
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+ expect(_file('app/components/foo.js')).to.not.exist;
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
@@ -600,11 +813,8 @@ describe('Blueprint: component', function() {
it('component x-foo', function() {
return emberGenerateDestroy(['component', 'x-foo'], _file => {
- expect(_file('app/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
-
- expect(_file('app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('app/components/x-foo.js')).to.not.exist;
+ expect(_file('app/components/x-foo.hbs')).to.equal('{{yield}}');
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
@@ -619,15 +829,12 @@ describe('Blueprint: component', function() {
it('component x-foo.js', function() {
return emberGenerateDestroy(['component', 'x-foo.js'], _file => {
+ expect(_file('app/components/x-foo.js')).to.not.exist;
expect(_file('app/components/x-foo.js.js')).to.not.exist;
expect(_file('app/templates/components/x-foo.js.hbs')).to.not.exist;
expect(_file('tests/integration/components/x-foo-test.js.js')).to.not.exist;
- expect(_file('app/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
-
- expect(_file('app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('app/components/x-foo.hbs')).to.equal('{{yield}}');
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
@@ -642,11 +849,8 @@ describe('Blueprint: component', function() {
it('component foo/x-foo', function() {
return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
- expect(_file('app/components/foo/x-foo.js')).to.equal(
- fixture('component/native-component-nested.js')
- );
-
- expect(_file('app/templates/components/foo/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('app/components/foo/x-foo.js')).to.not.exist;
+ expect(_file('app/components/foo/x-foo.hbs')).to.equal('{{yield}}');
expect(_file('tests/integration/components/foo/x-foo-test.js')).to.equal(
fixture('component-test/default-curly-template.js', {
@@ -657,6 +861,26 @@ describe('Blueprint: component', function() {
);
});
});
+
+ it('component foo/x-foo --component-class="@glimmer/component"', function() {
+ return emberGenerateDestroy(
+ ['component', 'foo/x-foo', '--component-class', '@glimmer/component'],
+ _file => {
+ expect(_file('app/components/foo/x-foo.js')).to.equal(
+ glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
+ );
+ expect(_file('app/components/foo/x-foo.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/components/foo/x-foo-test.js')).to.equal(
+ fixture('component-test/default-curly-template.js', {
+ replace: {
+ component: 'foo/x-foo',
+ },
+ })
+ );
+ }
+ );
+ });
});
describe('in addon', function() {
@@ -836,152 +1060,6 @@ describe('Blueprint: component', function() {
});
});
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component foo', function() {
- return emberGenerateDestroy(['component', 'foo'], _file => {
- expect(_file('src/ui/components/foo/component.js')).to.equal(
- fixture('component/component.js')
- );
-
- expect(_file('src/ui/components/foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- path: 'my-addon::',
- pathInvocation: 'MyAddon::',
- },
- })
- );
- });
- });
-
- it('component x-foo', function() {
- return emberGenerateDestroy(['component', 'x-foo'], _file => {
- expect(_file('src/ui/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('src/ui/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'my-addon::',
- pathInvocation: 'MyAddon::',
- },
- })
- );
- });
- });
-
- it('component x-foo.js', function() {
- return emberGenerateDestroy(['component', 'x-foo.js'], _file => {
- expect(_file('src/ui/components/x-foo.js/component.js')).to.not.exist;
- expect(_file('src/ui/components/x-foo.js/template.hbs')).to.not.exist;
- expect(_file('src/ui/components/x-foo.js/component-test.js')).to.not.exist;
-
- expect(_file('src/ui/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('src/ui/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'my-addon::',
- pathInvocation: 'MyAddon::',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
- expect(_file('src/ui/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('src/ui/components/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-curly-template.js', {
- replace: {
- component: 'foo/x-foo',
- path: 'my-addon::',
- },
- })
- );
- });
- });
-
- it('component x-foo --dummy', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('tests/dummy/src/ui/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/x-foo/component.js')).to.not.exist;
-
- expect(_file('src/ui/components/x-foo/component-test.js')).to.not.exist;
- });
- });
-
- it('component x-foo.js --dummy', function() {
- return emberGenerateDestroy(['component', 'x-foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/components/x-foo.js/component.js')).to.not.exist;
- expect(_file('tests/dummy/src/ui/components/x-foo.js/template.hbs')).to.not.exist;
-
- expect(_file('tests/dummy/src/ui/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('tests/dummy/src/ui/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/x-foo/component.js')).to.not.exist;
-
- expect(_file('src/ui/components/x-foo/component-test.js')).to.not.exist;
- });
- });
-
- it('component foo/x-foo --dummy', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('tests/dummy/src/ui/components/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('src/ui/components/foo/x-foo/component.js')).to.not.exist;
-
- expect(_file('src/ui/components/foo/x-foo/component-test.js')).to.not.exist;
- });
- });
- });
-
describe('in addon - octane', function() {
enableOctane();
@@ -998,17 +1076,15 @@ describe('Blueprint: component', function() {
it('component foo', function() {
return emberGenerateDestroy(['component', 'foo'], _file => {
- expect(_file('addon/components/foo.js')).to.equal(fixture('component/native-component.js'));
+ expect(_file('addon/components/foo.js')).to.not.exist;
- expect(_file('addon/templates/components/foo.hbs')).to.equal('{{yield}}');
+ expect(_file('addon/components/foo.hbs')).to.equal('{{yield}}');
expect(_file('app/components/foo.js')).to.contain(
"export { default } from 'my-addon/components/foo';"
);
- expect(_file('app/templates/components/foo.js')).to.contain(
- "export { default } from 'my-addon/templates/components/foo';"
- );
+ expect(_file('app/templates/components/foo.js')).to.not.exist;
expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
@@ -1023,52 +1099,16 @@ describe('Blueprint: component', function() {
it('component x-foo', function() {
return emberGenerateDestroy(['component', 'x-foo'], _file => {
- expect(_file('addon/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
+ expect(_file('addon/components/x-foo.js')).to.not.exist;
- expect(_file('addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('addon/components/x-foo.hbs')).to.equal('{{yield}}');
expect(_file('app/components/x-foo.js')).to.contain(
"export { default } from 'my-addon/components/x-foo';"
);
- expect(_file('app/templates/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/templates/components/x-foo';"
- );
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo.js', function() {
- return emberGenerateDestroy(['component', 'x-foo.js'], _file => {
- expect(_file('addon/components/x-foo.js.js')).to.not.exist;
- expect(_file('addon/templates/components/x-foo.js.hbs')).to.not.exist;
- expect(_file('app/components/x-foo.js.js')).to.not.exist;
- expect(_file('app/templates/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/integration/components/x-foo.js-test.js')).to.not.exist;
-
- expect(_file('addon/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
-
- expect(_file('addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
-
- expect(_file('app/templates/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/templates/components/x-foo';"
- );
+ expect(_file('app/templates/components/x-foo.js')).to.not.exist;
+ expect(_file('app/components/x-foo.hbs')).to.not.exist;
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
@@ -1083,19 +1123,15 @@ describe('Blueprint: component', function() {
it('component foo/x-foo', function() {
return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
- expect(_file('addon/components/foo/x-foo.js')).to.equal(
- fixture('component/native-component-nested.js')
- );
+ expect(_file('addon/components/foo/x-foo.js')).to.not.exist;
- expect(_file('addon/templates/components/foo/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('addon/components/foo/x-foo.hbs')).to.equal('{{yield}}');
expect(_file('app/components/foo/x-foo.js')).to.contain(
"export { default } from 'my-addon/components/foo/x-foo';"
);
- expect(_file('app/templates/components/foo/x-foo.js')).to.contain(
- "export { default } from 'my-addon/templates/components/foo/x-foo';"
- );
+ expect(_file('app/templates/components/foo/x-foo.js')).to.not.exist;
expect(_file('tests/integration/components/foo/x-foo-test.js')).to.equal(
fixture('component-test/default-curly-template.js', {
@@ -1109,31 +1145,12 @@ describe('Blueprint: component', function() {
it('component x-foo --dummy', function() {
return emberGenerateDestroy(['component', 'x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
-
- expect(_file('tests/dummy/app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('app/components/x-foo.js')).to.not.exist;
- expect(_file('app/templates/components/x-foo.js')).to.not.exist;
+ expect(_file('tests/dummy/app/components/x-foo.js')).to.not.exist;
- expect(_file('tests/integration/components/x-foo-test.js')).to.not.exist;
- });
- });
-
- it('component x-foo.js --dummy', function() {
- return emberGenerateDestroy(['component', 'x-foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/dummy/app/templates/components/x-foo.js.hbs')).to.not.exist;
-
- expect(_file('tests/dummy/app/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
-
- expect(_file('tests/dummy/app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('tests/dummy/app/components/x-foo.hbs')).to.equal('{{yield}}');
expect(_file('app/components/x-foo.js')).to.not.exist;
+ expect(_file('app/components/x-foo.hbs')).to.not.exist;
expect(_file('app/templates/components/x-foo.js')).to.not.exist;
expect(_file('tests/integration/components/x-foo-test.js')).to.not.exist;
@@ -1142,13 +1159,13 @@ describe('Blueprint: component', function() {
it('component foo/x-foo --dummy', function() {
return emberGenerateDestroy(['component', 'foo/x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/foo/x-foo.js')).to.equal(
- fixture('component/native-component-nested.js')
- );
+ expect(_file('tests/dummy/app/components/foo/x-foo.js')).to.not.exist;
- expect(_file('tests/dummy/app/templates/components/foo/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('tests/dummy/app/components/foo/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('tests/dummy/app/templates/components/foo/x-foo.hbs')).to.not.exist;
expect(_file('app/components/foo/x-foo.js')).to.not.exist;
+ expect(_file('app/components/foo/x-foo.hbs')).to.not.exist;
expect(_file('app/templates/components/foo/x-foo.js')).to.not.exist;
expect(_file('tests/integration/components/foo/x-foo-test.js')).to.not.exist;
@@ -1351,93 +1368,6 @@ describe('Blueprint: component', function() {
});
});
- describe('in in-repo-addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'in-repo-addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('packages/my-addon/src/ui/components/foo/component.js')).to.equal(
- fixture('component/component.js')
- );
-
- expect(_file('packages/my-addon/src/ui/components/foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('packages/my-addon/src/ui/components/foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- path: 'my-addon::',
- pathInvocation: 'MyAddon::',
- },
- })
- );
- });
- });
-
- it('component x-foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('packages/my-addon/src/ui/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('packages/my-addon/src/ui/components/x-foo/template.hbs')).to.equal(
- '{{yield}}'
- );
-
- expect(_file('packages/my-addon/src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'my-addon::',
- pathInvocation: 'MyAddon::',
- },
- })
- );
- });
- });
-
- it('component x-foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'x-foo.js', '--in-repo-addon=my-addon'], _file => {
- expect(_file('packages/my-addon/src/ui/components/x-foo/component.js.js')).to.not.exist;
- expect(_file('packages/my-addon/src/ui/components/x-foo/template.js.hbs')).to.not.exist;
- expect(_file('packages/my-addon/src/ui/components/x-foo/component-test.js.js')).to.not
- .exist;
-
- expect(_file('packages/my-addon/src/ui/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('packages/my-addon/src/ui/components/x-foo/template.hbs')).to.equal(
- '{{yield}}'
- );
-
- expect(_file('packages/my-addon/src/ui/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'my-addon::',
- pathInvocation: 'MyAddon::',
- },
- })
- );
- });
- });
- });
-
describe('in in-repo-addon - octane', function() {
enableOctane();
@@ -1454,19 +1384,16 @@ describe('Blueprint: component', function() {
it('component foo --in-repo-addon=my-addon', function() {
return emberGenerateDestroy(['component', 'foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/foo.js')).to.equal(
- fixture('component/native-component.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/components/foo.hbs')).to.equal('{{yield}}');
+ expect(_file('lib/my-addon/addon/components/foo.js')).to.not.exist;
+ expect(_file('lib/my-addon/addon/components/foo.hbs')).to.equal('{{yield}}');
+ expect(_file('lib/my-addon/addon/templates/components/foo.hbs')).to.not.exist;
expect(_file('lib/my-addon/app/components/foo.js')).to.contain(
"export { default } from 'my-addon/components/foo';"
);
- expect(_file('lib/my-addon/app/templates/components/foo.js')).to.contain(
- "export { default } from 'my-addon/templates/components/foo';"
- );
+ expect(_file('lib/my-addon/app/templates/components/foo.js')).to.not.exist;
+ expect(_file('lib/my-addon/app/components/foo.hbs')).to.not.exist;
expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
@@ -1481,52 +1408,16 @@ describe('Blueprint: component', function() {
it('component x-foo --in-repo-addon=my-addon', function() {
return emberGenerateDestroy(['component', 'x-foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('lib/my-addon/app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
-
- expect(_file('lib/my-addon/app/templates/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/templates/components/x-foo';"
- );
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'x-foo.js', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/x-foo.js.js')).to.not.exist;
- expect(_file('lib/my-addon/addon/templates/components/x-foo.js.hbs')).to.not.exist;
- expect(_file('lib/my-addon/app/components/x-foo.js.js')).to.not.exist;
- expect(_file('lib/my-addon/app/templates/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/integration/components/x-foo-test.js.js')).to.not.exist;
-
- expect(_file('lib/my-addon/addon/components/x-foo.js')).to.equal(
- fixture('component/native-component-dash.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('lib/my-addon/addon/components/x-foo.js')).to.not.exist;
+ expect(_file('lib/my-addon/addon/components/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('lib/my-addon/addon/templates/components/x-foo.hbs')).to.not.exist;
expect(_file('lib/my-addon/app/components/x-foo.js')).to.contain(
"export { default } from 'my-addon/components/x-foo';"
);
- expect(_file('lib/my-addon/app/templates/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/templates/components/x-foo';"
- );
+ expect(_file('lib/my-addon/app/templates/components/x-foo.js')).to.not.exist;
+ expect(_file('lib/my-addon/app/components/x-foo.hbs')).to.not.exist;
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
| true |
Other
|
emberjs
|
ember.js
|
c4cdae990ce827d8e143b95c6fcd0331b967c7aa.json
|
Implement component co-location blueprints (#18203)
Implement component co-location blueprints
Co-authored-by: Robert Jackson <[email protected]>
|
package.json
|
@@ -73,7 +73,8 @@
"ember-router-generator": "^1.2.3",
"inflection": "^1.12.0",
"jquery": "^3.4.1",
- "resolve": "^1.11.1"
+ "resolve": "^1.11.1",
+ "silent-error": "^1.1.1"
},
"devDependencies": {
"@babel/helper-module-imports": "^7.0.0",
| true |
Other
|
emberjs
|
ember.js
|
d922666b2d0383e59cdbdaa5af9bb836dbc2390b.json
|
Fix linting errors
|
packages/@ember/-internals/glimmer/lib/component.ts
|
@@ -754,7 +754,7 @@ const Component = CoreView.extend(
id: 'ember-views.event-dispatcher.mouseenter-leave-move',
until: '4.0.0',
url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move',
- },
+ }
);
deprecate(
`Using \`mouseLeave\` event handler methods in components has been deprecated.`,
@@ -763,7 +763,7 @@ const Component = CoreView.extend(
id: 'ember-views.event-dispatcher.mouseenter-leave-move',
until: '4.0.0',
url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move',
- },
+ }
);
deprecate(
`Using \`mouseMove\` event handler methods in components has been deprecated.`,
@@ -772,7 +772,7 @@ const Component = CoreView.extend(
id: 'ember-views.event-dispatcher.mouseenter-leave-move',
until: '4.0.0',
url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move',
- },
+ }
);
},
| true |
Other
|
emberjs
|
ember.js
|
d922666b2d0383e59cdbdaa5af9bb836dbc2390b.json
|
Fix linting errors
|
packages/@ember/-internals/glimmer/lib/modifiers/action.ts
|
@@ -244,12 +244,14 @@ export default class ActionModifierManager implements ModifierManager<ActionStat
deprecate(
`Using the \`{{action}}\` modifier with \`${actionState.eventName}\` events has been deprecated.`,
- actionState.eventName !== 'mouseEnter' && actionState.eventName !== 'mouseLeave' && actionState.eventName !== 'mouseMove',
+ actionState.eventName !== 'mouseEnter' &&
+ actionState.eventName !== 'mouseLeave' &&
+ actionState.eventName !== 'mouseMove',
{
id: 'ember-views.event-dispatcher.mouseenter-leave-move',
until: '4.0.0',
url: 'https://emberjs.com/deprecations/v3.x#toc_action-mouseenter-leave-move',
- },
+ }
);
return actionState;
| true |
Other
|
emberjs
|
ember.js
|
d922666b2d0383e59cdbdaa5af9bb836dbc2390b.json
|
Fix linting errors
|
packages/@ember/-internals/glimmer/tests/integration/event-dispatcher-test.js
|
@@ -292,7 +292,9 @@ moduleFor(
assert.strictEqual(receivedLeaveEvents[0].target, outer);
}
- ['@test [DEPRECATED] delegated event listeners work for mouseEnter/Leave with skipped events'](assert) {
+ ['@test [DEPRECATED] delegated event listeners work for mouseEnter/Leave with skipped events'](
+ assert
+ ) {
let receivedEnterEvents = [];
let receivedLeaveEvents = [];
| true |
Other
|
emberjs
|
ember.js
|
d922666b2d0383e59cdbdaa5af9bb836dbc2390b.json
|
Fix linting errors
|
packages/@ember/-internals/glimmer/tests/integration/helpers/element-action-test.js
|
@@ -1680,7 +1680,8 @@ moduleFor(
template: '<div id="inner" {{action "show" on="mouseEnter"}}></div>',
});
- expectDeprecation(() => this.render('{{example-component id="outer"}}'),
+ expectDeprecation(
+ () => this.render('{{example-component id="outer"}}'),
'Using the `{{action}}` modifier with `mouseEnter` events has been deprecated.'
);
@@ -1713,7 +1714,8 @@ moduleFor(
template: '<div id="inner" {{action "show" on="mouseLeave"}}></div>',
});
- expectDeprecation(() => this.render('{{example-component id="outer"}}'),
+ expectDeprecation(
+ () => this.render('{{example-component id="outer"}}'),
'Using the `{{action}}` modifier with `mouseLeave` events has been deprecated.'
);
@@ -1746,7 +1748,8 @@ moduleFor(
template: '<div id="inner" {{action "show" on="mouseMove"}}></div>',
});
- expectDeprecation(() => this.render('{{example-component id="outer"}}'),
+ expectDeprecation(
+ () => this.render('{{example-component id="outer"}}'),
'Using the `{{action}}` modifier with `mouseMove` events has been deprecated.'
);
@@ -1774,7 +1777,8 @@ moduleFor(
template: '<div id="inner" {{action "show" on=eventType}}></div>',
});
- expectDeprecation(() => this.render('{{example-component id="outer"}}'),
+ expectDeprecation(
+ () => this.render('{{example-component id="outer"}}'),
'Using the `{{action}}` modifier with `mouseMove` events has been deprecated.'
);
| true |
Other
|
emberjs
|
ember.js
|
d922666b2d0383e59cdbdaa5af9bb836dbc2390b.json
|
Fix linting errors
|
packages/@ember/-internals/views/lib/system/event_dispatcher.js
|
@@ -94,11 +94,14 @@ export default EmberObject.extend({
drop: 'drop',
dragend: 'dragEnd',
},
- MOUSE_ENTER_LEAVE_MOVE_EVENTS ? {
- mouseenter: 'mouseEnter',
- mouseleave: 'mouseLeave',
- mousemove: 'mouseMove',
- } : {}),
+ MOUSE_ENTER_LEAVE_MOVE_EVENTS
+ ? {
+ mouseenter: 'mouseEnter',
+ mouseleave: 'mouseLeave',
+ mousemove: 'mouseMove',
+ }
+ : {}
+ ),
/**
The root DOM element to which event listeners should be attached. Event
| true |
Other
|
emberjs
|
ember.js
|
50fb52c6e44668c244473e4b8f977cd0b0573ecc.json
|
Remove deprecated events from docs
|
packages/@ember/-internals/glimmer/lib/component.ts
|
@@ -642,11 +642,8 @@ export const BOUNDS = symbol('BOUNDS');
* `contextMenu`
* `click`
* `doubleClick`
- * `mouseMove`
* `focusIn`
* `focusOut`
- * `mouseEnter`
- * `mouseLeave`
Form events:
| false |
Other
|
emberjs
|
ember.js
|
d3330598f0fec81d6700448daeef8768483d31df.json
|
Add code example for recognize
|
packages/@ember/-internals/routing/lib/services/router.ts
|
@@ -277,6 +277,27 @@ export default class RouterService extends Service {
by the URL. Returns `null` if the URL is not recognized. This method expects to
receive the actual URL as seen by the browser including the app's `rootURL`.
+ See [RouteInfo](/ember/release/classes/RouteInfo) for more info.
+
+ In the following example `recognize` is used to verify if a path belongs to our
+ application before transitioning to it.
+
+ ```
+ import Component from '@ember/component';
+ import { inject as service } from '@ember/service';
+
+ export default Component.extend({
+ router: service(),
+ path: '/',
+
+ click() {
+ if(this.router.recognize(this.path)) {
+ this.router.transitionTo(this.path);
+ }
+ }
+ });
+ ```
+
@method recognize
@param {String} url
@public
| false |
Other
|
emberjs
|
ember.js
|
1717a2ff363694dc33b58a41c204f41efc591118.json
|
Correct property name in @union cp example
The example usage of `@union` defines `ediblePlants` but uses `hamster.uniqueFruits` instead.
Change `ediblePlants` to `uniqueFruits`.
|
packages/@ember/object/lib/computed/reduce_computed_macros.js
|
@@ -948,7 +948,7 @@ export function uniqBy(dependentKey, propertyKey) {
set(this, 'vegetables', vegetables);
}
- @union('fruits', 'vegetables') ediblePlants;
+ @union('fruits', 'vegetables') uniqueFruits;
});
let hamster = new, Hamster(
| false |
Other
|
emberjs
|
ember.js
|
84ab4ea5a6ce6780f5166efaef648308609b76ee.json
|
Add code example for replaceWith
|
packages/@ember/-internals/routing/lib/services/router.ts
|
@@ -141,6 +141,20 @@ export default class RouterService extends Service {
This behavior is different from calling `replaceWith` on a route.
See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.
+ Usage example:
+
+ ```app/routes/application.js
+ import Route from '@ember/routing/route';
+
+ export default Route.extend({
+ beforeModel() {
+ if (!authorized()){
+ this.replaceWith('unauthorized');
+ }
+ }
+ });
+ ```
+
@method replaceWith
@param {String} routeNameOrUrl the name of the route or a URL
@param {...Object} models the model(s) or identifier(s) to be used while
| false |
Other
|
emberjs
|
ember.js
|
5e40cbdac4eac70bf0999d94d5cea4f3a46f7de2.json
|
Add code example for transitionTo
|
packages/@ember/-internals/routing/lib/services/router.ts
|
@@ -90,6 +90,24 @@ export default class RouterService extends Service {
This behavior is different from calling `transitionTo` on a route or `transitionToRoute` on a controller.
See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.
+ In the following example we use the Router service to navigate to a route with a
+ specific model from a Component.
+
+ ```javascript
+ import Component from '@ember/component';
+ import { inject as service } from '@ember/service';
+
+ export default Component.extend({
+ router: service(),
+
+ actions: {
+ goToComments(post) {
+ this.router.transitionTo('comments', post);
+ }
+ }
+ });
+ ```
+
@method transitionTo
@param {String} routeNameOrUrl the name of the route or a URL
@param {...Object} models the model(s) or identifier(s) to be used while
| false |
Other
|
emberjs
|
ember.js
|
32bac7b4c751f4f5bc774ea05d0a85b8087de7c7.json
|
Add more tests for inherited listeners. (#18160)
Add more tests for inherited listeners.
|
packages/@ember/-internals/meta/tests/listeners_test.js
|
@@ -18,24 +18,52 @@ moduleFor(
}
['@test inheritance'](assert) {
+ let matching;
let target = {};
let parent = {};
let parentMeta = meta(parent);
parentMeta.addToListeners('hello', target, 'm', 0);
- let child = Object.create(parent);
- let m = meta(child);
+ let child1 = Object.create(parent);
+ let m1 = meta(child1);
+
+ let child2 = Object.create(parent);
+ let m2 = meta(child2);
+
+ let child3 = Object.create(parent);
+ let m3 = meta(child3);
+
+ m3.removeFromListeners('hello', target, 'm');
+
+ matching = m3.matchingListeners('hello');
+ assert.deepEqual(matching, undefined, 'no listeners for child3');
+
+ m3.addToListeners('hello', target, 'm', 0);
+
+ matching = m3.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child1');
+
+ m3.removeFromListeners('hello', target, 'm');
+
+ matching = m3.matchingListeners('hello');
+ assert.deepEqual(matching, undefined, 'no listeners for child3');
+
+ matching = m1.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child1');
+
+ matching = m2.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child2');
+
+ m1.removeFromListeners('hello', target, 'm');
+
+ matching = m1.matchingListeners('hello');
+ assert.equal(matching, undefined, 'listener removed from child1');
+
+ matching = m2.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child2');
- let matching = m.matchingListeners('hello');
- assert.equal(matching.length, 3);
- assert.equal(matching[0], target);
- assert.equal(matching[1], 'm');
- assert.equal(matching[2], 0);
- m.removeFromListeners('hello', target, 'm');
- matching = m.matchingListeners('hello');
- assert.equal(matching, undefined);
matching = parentMeta.matchingListeners('hello');
- assert.equal(matching.length, 3);
+ assert.deepEqual(matching, [target, 'm', false], 'listener still present for parent');
}
['@test deduplication'](assert) {
| false |
Other
|
emberjs
|
ember.js
|
1e00da7922598523bbf7af0052d508b8051df275.json
|
Add v3.8.3 to CHANGELOG.md.
[ci skip]
|
CHANGELOG.md
|
@@ -66,6 +66,12 @@
- [#17874](https://github.com/emberjs/ember.js/pull/17874) [BUGFIX] Fix issue with `event.stopPropagation()` in component event handlers when jQuery is disabled.
- [#17876](https://github.com/emberjs/ember.js/pull/17876) [BUGFIX] Fix issue with multiple `{{action}}` modifiers on the same element when jQuery is disabled.
+### v3.8.3 (June 28, 2019)
+
+- [#18159](https://github.com/emberjs/ember.js/pull/18159) [BUGFIX] Ensure `RouteInfo` object's do not eagerly cache routes in lazy Engines
+- [#18150](https://github.com/emberjs/ember.js/pull/18150) [BUGFIX] Ensure string based event listeners that are removed are not retained
+- [#18080](https://github.com/emberjs/ember.js/pull/18080) [BUGFIX] Fix `ember-template-compiler` compatibility with Fastboot.
+
### v3.8.2 (June, 4, 2019)
- [#18071](https://github.com/emberjs/ember.js/pull/18071) [BUGFIX] Ensure modifiers do not run in FastBoot modes. (#18071)
| false |
Other
|
emberjs
|
ember.js
|
d97d74ddff1a2407c5012777cfe185f85db0495d.json
|
Add v3.11.1 to CHANGELOG.
[ci skip]
|
CHANGELOG.md
|
@@ -6,6 +6,11 @@
- [#18150](https://github.com/emberjs/ember.js/pull/18150) [BUGFIX] Fix a memory retention issue with string-based event listeners
- [#18124](https://github.com/emberjs/ember.js/pull/18124) [CLEANUP] Remove deprecated `NAME_KEY`
+### v3.11.1 (June 27, 2019)
+
+- [#18159](https://github.com/emberjs/ember.js/pull/18159) Ensure `RouteInfo` object's do not eagerly cache routes in lazy Engines
+- [#18150](https://github.com/emberjs/ember.js/pull/18150) Ensure string based event listeners that are removed are not retained
+
### v3.11.0 (June 24, 2019)
- [#17842](https://github.com/emberjs/ember.js/pull/17842) / [#17901](https://github.com/emberjs/ember.js/pull/17901) [FEATURE] Implement the [Forwarding Element Modifiers with "Splattributes" RFC](https://github.com/emberjs/rfcs/blob/master/text/0435-modifier-splattributes.md).
| false |
Other
|
emberjs
|
ember.js
|
6a877c80255294821d07c47231c65dc8b336f8cd.json
|
Add more tests for inherited listeners.
Added a test to confirm that removing from one child does not affect
the other children. This case was not previously covered.
|
packages/@ember/-internals/meta/tests/listeners_test.js
|
@@ -18,24 +18,52 @@ moduleFor(
}
['@test inheritance'](assert) {
+ let matching;
let target = {};
let parent = {};
let parentMeta = meta(parent);
parentMeta.addToListeners('hello', target, 'm', 0);
- let child = Object.create(parent);
- let m = meta(child);
+ let child1 = Object.create(parent);
+ let m1 = meta(child1);
+
+ let child2 = Object.create(parent);
+ let m2 = meta(child2);
+
+ let child3 = Object.create(parent);
+ let m3 = meta(child3);
+
+ m3.removeFromListeners('hello', target, 'm');
+
+ matching = m3.matchingListeners('hello');
+ assert.deepEqual(matching, undefined, 'no listeners for child3');
+
+ m3.addToListeners('hello', target, 'm', 0);
+
+ matching = m3.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child1');
+
+ m3.removeFromListeners('hello', target, 'm');
+
+ matching = m3.matchingListeners('hello');
+ assert.deepEqual(matching, undefined, 'no listeners for child3');
+
+ matching = m1.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child1');
+
+ matching = m2.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child2');
+
+ m1.removeFromListeners('hello', target, 'm');
+
+ matching = m1.matchingListeners('hello');
+ assert.equal(matching, undefined, 'listener removed from child1');
+
+ matching = m2.matchingListeners('hello');
+ assert.deepEqual(matching, [target, 'm', false], 'listener still exists for child2');
- let matching = m.matchingListeners('hello');
- assert.equal(matching.length, 3);
- assert.equal(matching[0], target);
- assert.equal(matching[1], 'm');
- assert.equal(matching[2], 0);
- m.removeFromListeners('hello', target, 'm');
- matching = m.matchingListeners('hello');
- assert.equal(matching, undefined);
matching = parentMeta.matchingListeners('hello');
- assert.equal(matching.length, 3);
+ assert.deepEqual(matching, [target, 'm', false], 'listener still present for parent');
}
['@test deduplication'](assert) {
| false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.