Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fail test for each-in not accessing props properly whose keys contain a period #17535

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b3ad58e
Disable non-enabled features
kategengler Jan 7, 2019
bc4cbf0
Remove the alpha section of travis config
kategengler Jan 7, 2019
2ddd49b
Add v3.8.0-beta.1 to CHANGELOG
kategengler Jan 7, 2019
58160e1
Release v3.8.0-beta.1
kategengler Jan 7, 2019
58edec5
[BUGFIX] Fix substate interactions with aborts
chadhietala Jan 9, 2019
24612b2
Merge pull request #17467 from emberjs/substates-beta
rwjblue Jan 10, 2019
e231200
[DOC LTS] Update documentation for sendAction deprecation
locks Jan 8, 2019
a2dd42f
Add v3.8.0-beta.2 to CHANGELOG
kategengler Jan 15, 2019
423a6c0
Release v3.8.0-beta.2
kategengler Jan 15, 2019
a8335bf
Add v3.7.1 to CHANGELOG
kategengler Jan 21, 2019
3990377
Don't remove dep keys in `didUnwatch`
gitKrystan Jan 17, 2019
bcfad69
Merge pull request #17498 from gitKrystan/backport-didunwatch-fix
rwjblue Jan 22, 2019
ac7fb3b
Add v3.4.8 to CHANGELOG.
rwjblue Jan 22, 2019
ba395fa
Add v3.7.2 to CHANGELOG.md.
rwjblue Jan 22, 2019
13a678a
[BUGFIX beta] Update to glimmer-vm 0.37.1.
rwjblue Jan 22, 2019
c367baa
[BUGFIX beta] Add failing test for yielding inside a contextual compo…
cibernox Oct 30, 2018
4ab3af1
[BUGFIX beta] Add failing test ensuring that splattributes can be for…
rwjblue Oct 23, 2018
835a6c9
[BUGFIX beta] Add tests for positional params with custom component m…
dfreeman Jan 15, 2019
4056b97
[DOC beta] Update (at)ember/string documentation for imported utils i…
locks Jan 25, 2019
a832a34
Update index.ts
locks Jan 26, 2019
4d7a496
Add v3.8.0-beta.3 to CHANGELOG
kategengler Jan 29, 2019
38b9060
Release v3.8.0-beta.3
kategengler Jan 29, 2019
eec6bb2
chore: fail test for issue-17529
jasonmit Jan 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions .travis.yml
Expand Up @@ -96,9 +96,3 @@ jobs:
- PUBLISH=true
script:
- "./bin/publish_builds"

- env:
- BUILD_TYPE=alpha
- PUBLISH=true
script:
- "./bin/publish_builds"
42 changes: 42 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,40 @@
# Ember Changelog

### v3.8.0-beta.3 (January 28, 2019)

- [#17498](https://github.com/emberjs/ember.js/pull/17498) [BUGFIX] Don't remove dep keys in `didUnwatch`
- [#17499](https://github.com/emberjs/ember.js/pull/17499) [BUGFIX] Update to glimmer-vm 0.37.1.

### v3.8.0-beta.2 (January 14, 2019)

- [#17467](https://github.com/emberjs/ember.js/pull/17467) [BUGFIX] Fix substate interactions with aborts

### v3.8.0-beta.1 (January 7, 2019)

- [#17143](https://github.com/emberjs/ember.js/pull/17143) / [#17375](https://github.com/emberjs/ember.js/pull/17375) [FEATURE] Implement Element Modifier Manager RFC (see [emberjs/rfcs#0373](https://github.com/emberjs/rfcs/blob/master/text/0373-Element-Modifier-Managers.md)).
- [#17054](https://github.com/emberjs/ember.js/pull/17054) / [#17376](https://github.com/emberjs/ember.js/pull/17376) [FEATURE] Implement `array` helper RFC (see [emberjs/rfcs#0318](https://github.com/emberjs/rfcs/blob/master/text/0318-array-helper.md))
- [#16735](https://github.com/emberjs/ember.js/pull/16735) [BUGFIX] Observed properties not being marked as enum
- [#17319](https://github.com/emberjs/ember.js/pull/17319) [CLEANUP] Remove deprecated 'POSITIONAL_PARAM_CONFLICT'
- [#17394](https://github.com/emberjs/ember.js/pull/17394) [CLEANUP] Remove deprecated code in mixins/array
- [#17166](https://github.com/emberjs/ember.js/pull/17166) Improve performance of get() / set()
- [#16710](https://github.com/emberjs/ember.js/pull/16710) Deprecation of (private) `NAME_KEY`
- [#17244](https://github.com/emberjs/ember.js/pull/17244) Upgrade to Glimmer VM 0.37.0
- [#17216](https://github.com/emberjs/ember.js/pull/17216) Use native Error instead of custom Error subclass.
- [#17340](https://github.com/emberjs/ember.js/pull/17340) Remove unused `hooks` variable from qunit-rfc-232 util-test blueprint
- [#17357](https://github.com/emberjs/ember.js/pull/17357) Allow notifyPropertyChange to be imported from @ember/object
- [#17413](https://github.com/emberjs/ember.js/pull/17413) Fix missing import in instance-initializer blueprint for ember-mocha

### v3.7.2 (January 22, 2019)

* Upgrade @glimmer/* packages to 0.35.10. Fixes a few issues:
* Usage of positional arguments with custom components.
* Forwarding attributes via `...attributes` to a dynamic component.
* Prevent errors when rendering many template blocks (`Error: Operand over 16-bits. Got 65536`).

### v3.7.1 (January 21, 2019)

- [#17461](https://github.com/emberjs/ember.js/pull/17461) [BUGFIX] Fix substate interactions with aborts

### v3.7.0 (January 7, 2019)

- [#17254](https://github.com/emberjs/ember.js/pull/17254) [BREAKING] Explicitly drop support for Node 4
Expand Down Expand Up @@ -54,6 +89,13 @@
- [#16978](https://github.com/emberjs/ember.js/pull/16978) [BUGFIX] Properly teardown alias
- [#16877](https://github.com/emberjs/ember.js/pull/16877) [CLEANUP] Allow routes to be named "array" and "object"

### v3.4.8 (January 22, 2019)

* Upgrade @glimmer/* packages to 0.35.10. Fixes a few issues:
* Usage of positional arguments with custom components.
* Forwarding attributes via `...attributes` to a dynamic component.
* Prevent errors when rendering many template blocks (`Error: Operand over 16-bits. Got 65536`).

### v3.4.7 (December 7, 2018)

- #17271 [BUGFIX] Update `backburner.js` to 2.4.2.
Expand Down
18 changes: 9 additions & 9 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "ember-source",
"version": "3.8.0",
"version": "3.8.0-beta.3",
"description": "A JavaScript framework for creating ambitious web applications",
"keywords": [
"ember-addon"
Expand Down Expand Up @@ -89,14 +89,14 @@
"@babel/plugin-transform-shorthand-properties": "^7.2.0",
"@babel/plugin-transform-spread": "^7.2.2",
"@babel/plugin-transform-template-literals": "^7.2.0",
"@glimmer/compiler": "^0.37.0",
"@glimmer/compiler": "^0.37.1",
"@glimmer/env": "^0.1.7",
"@glimmer/interfaces": "^0.37.0",
"@glimmer/node": "^0.37.0",
"@glimmer/opcode-compiler": "^0.37.0",
"@glimmer/program": "^0.37.0",
"@glimmer/reference": "^0.37.0",
"@glimmer/runtime": "^0.37.0",
"@glimmer/interfaces": "^0.37.1",
"@glimmer/node": "^0.37.1",
"@glimmer/opcode-compiler": "^0.37.1",
"@glimmer/program": "^0.37.1",
"@glimmer/reference": "^0.37.1",
"@glimmer/runtime": "^0.37.1",
"@types/qunit": "^2.5.3",
"@types/rsvp": "^4.0.2",
"auto-dist-tag": "^1.0.0",
Expand Down Expand Up @@ -148,7 +148,7 @@
"puppeteer": "^1.11.0",
"qunit": "^2.8.0",
"route-recognizer": "^0.3.4",
"router_js": "^6.2.1",
"router_js": "^6.2.2",
"rsvp": "^4.8.4",
"semver": "^5.5.0",
"serve-static": "^1.13.2",
Expand Down
5 changes: 4 additions & 1 deletion packages/@ember/-internals/glimmer/lib/helpers/action.ts
Expand Up @@ -92,12 +92,15 @@ import { ACTION, INVOKE, UnboundReference } from '../utils/references';
additional arguments are passed to the action function. This has interesting
properties combined with currying of arguments. For example:
```app/templates/components/my-component.hbs
{{input on-input=(action (action 'setName' model) value="target.value")}}
```
```app/components/my-component.js
import Component from '@ember/component';
export default Component.extend({
actions: {
// Usage {{input on-input=(action (action 'setName' model) value="target.value")}}
setName(model, name) {
model.set('name', name);
}
Expand Down
Expand Up @@ -855,6 +855,70 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION) {
});
}

'@test can forward ...attributes to dynamic component invocation ("splattributes")'() {
this.registerComponent('x-outer', {
ComponentClass: Component.extend({ tagName: '' }),
template: '<XInner ...attributes>{{yield}}</XInner>',
});

this.registerComponent('x-inner', {
ComponentClass: Component.extend({ tagName: '' }),
template: '<div ...attributes>{{yield}}</div>',
});

this.render(strip`
{{#let (component 'x-outer') as |Thing|}}
<Thing data-foo>Hello!</Thing>
{{/let}}
`);

this.assertElement(this.firstChild, {
tagName: 'div',
attrs: { 'data-foo': '' },
content: 'Hello!',
});
}

'@test an inner angle invocation can forward ...attributes through dynamic component invocation ("splattributes")'() {
this.registerComponent('x-outer', {
ComponentClass: Component.extend({ tagName: '' }),
template: `{{#let (component 'x-inner') as |Thing|}}<Thing ...attributes>{{yield}}</Thing>{{/let}}`,
});

this.registerComponent('x-inner', {
ComponentClass: Component.extend({ tagName: '' }),
template: '<div ...attributes>{{yield}}</div>',
});

this.render('<XOuter data-foo>Hello!</XOuter>');

this.assertElement(this.firstChild, {
tagName: 'div',
attrs: { 'data-foo': '' },
content: 'Hello!',
});
}

'@test an inner angle invocation can forward ...attributes through static component invocation ("splattributes")'() {
this.registerComponent('x-outer', {
ComponentClass: Component.extend({ tagName: '' }),
template: `<XInner ...attributes>{{yield}}</XInner>`,
});

this.registerComponent('x-inner', {
ComponentClass: Component.extend({ tagName: '' }),
template: '<div ...attributes>{{yield}}</div>',
});

this.render('<XOuter data-foo>Hello!</XOuter>');

this.assertElement(this.firstChild, {
tagName: 'div',
attrs: { 'data-foo': '' },
content: 'Hello!',
});
}

'@test can include `...attributes` in multiple elements in tagless component ("splattributes")'() {
this.registerComponent('foo-bar', {
ComponentClass: Component.extend({ tagName: '' }),
Expand Down Expand Up @@ -919,6 +983,41 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION) {
content: 'world',
});
}

'@test can yield content to contextual components invoked with angle-bracket components that receives splattributes'() {
this.registerComponent('foo-bar/inner', {
ComponentClass: Component.extend({ tagName: '' }),
template: '<h1 ...attributes>{{yield}}</h1>',
});
this.registerComponent('foo-bar', {
ComponentClass: Component.extend({ tagName: '' }),
// If <Inner> doesn't receive splattributes this test passes
template: strip`
{{#let (component "foo-bar/inner") as |Inner|}}
<Inner ...attributes>{{yield}}</Inner>
<h2>Inside the let</h2>
{{/let}}
<h3>Outside the let</h3>
`,
});

this.render('<FooBar>Yielded content</FooBar>');
this.assertElement(this.firstChild, {
tagName: 'h1',
attrs: {},
content: 'Yielded content',
});
this.assertElement(this.nthChild(1), {
tagName: 'h2',
attrs: {},
content: 'Inside the let',
});
this.assertElement(this.nthChild(2), {
tagName: 'h3',
attrs: {},
content: 'Outside the let',
});
}
}
);
}
Expand Up @@ -305,6 +305,58 @@ if (GLIMMER_CUSTOM_COMPONENT_MANAGER) {
this.assertHTML(`<p>Chad Hietala</p>`);
}

['@test it can set positional params on the component instance']() {
let ComponentClass = setComponentManager(
createBasicManager,
EmberObject.extend({
salutation: computed('args.positional', function() {
return this.args.positional[0] + ' ' + this.args.positional[1];
}),
})
);

this.registerComponent('foo-bar', {
template: `<p>{{salutation}}</p>`,
ComponentClass,
});

this.render('{{foo-bar "Yehuda" "Katz"}}');

this.assertHTML(`<p>Yehuda Katz</p>`);
}

['@test positional params are updated if they change']() {
let ComponentClass = setComponentManager(
createBasicManager,
EmberObject.extend({
salutation: computed('args.positional', function() {
return this.args.positional[0] + ' ' + this.args.positional[1];
}),
})
);

this.registerComponent('foo-bar', {
template: `<p>{{salutation}}</p>`,
ComponentClass,
});

this.render('{{foo-bar firstName lastName}}', {
firstName: 'Yehuda',
lastName: 'Katz',
});

this.assertHTML(`<p>Yehuda Katz</p>`);

runTask(() =>
setProperties(this.context, {
firstName: 'Chad',
lastName: 'Hietala',
})
);

this.assertHTML(`<p>Chad Hietala</p>`);
}

['@test it can opt-in to running destructor'](assert) {
let ComponentClass = setComponentManager(
() => {
Expand Down
Expand Up @@ -139,6 +139,31 @@ class AbstractEachInTest extends RenderingTestCase {
}

class EachInTest extends AbstractEachInTest {
[`@only each-in supports keys with a period in them`]() {
this.render(
strip`
<ul>
{{#each-in categories as |_ item|}}
<li>{{item.name}}</li>
{{/each-in}}
</ul>
`,
{
categories: {
// uncomment and run. notice `items` is undefined
'hello.world': { name: 'foo' },
},
}
);

// Empty
this.assertHTML(strip`
<ul>
<li>foo</li>
</ul>
`);
}

[`@test it repeats the given block for each item in the hash`]() {
this.makeHash({ Smartphones: 8203, 'JavaScript Frameworks': Infinity });

Expand Down
4 changes: 0 additions & 4 deletions packages/@ember/-internals/metal/lib/alias.ts
Expand Up @@ -46,10 +46,6 @@ export class AliasedProperty extends Descriptor implements DescriptorWithDepende
this.consume(obj, keyName, meta);
}

didUnwatch(obj: object, keyName: string, meta: Meta): void {
this.unconsume(obj, keyName, meta);
}

get(obj: object, keyName: string): any {
let ret = get(obj, this.altKey);
this.consume(obj, keyName, metaFor(obj));
Expand Down
10 changes: 5 additions & 5 deletions packages/@ember/canary-features/index.ts
Expand Up @@ -13,18 +13,18 @@ import { assign } from '@ember/polyfills';
*/

export const DEFAULT_FEATURES = {
EMBER_LIBRARIES_ISREGISTERED: null,
EMBER_IMPROVED_INSTRUMENTATION: null,
EMBER_LIBRARIES_ISREGISTERED: false,
EMBER_IMPROVED_INSTRUMENTATION: false,
EMBER_GLIMMER_NAMED_ARGUMENTS: true,
EMBER_ROUTING_ROUTER_SERVICE: true,
EMBER_ENGINES_MOUNT_PARAMS: true,
EMBER_MODULE_UNIFICATION: null,
EMBER_MODULE_UNIFICATION: false,
GLIMMER_CUSTOM_COMPONENT_MANAGER: true,
GLIMMER_MODIFIER_MANAGER: true,
EMBER_METAL_TRACKED_PROPERTIES: null,
EMBER_METAL_TRACKED_PROPERTIES: false,
EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION: true,
EMBER_GLIMMER_ARRAY_HELPER: true,
EMBER_ROUTING_BUILD_ROUTEINFO_METADATA: null,
EMBER_ROUTING_BUILD_ROUTEINFO_METADATA: false,
};

/**
Expand Down