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
6c3ac7ca39a33c1c478080f1412aeb311d2019e5.json
Fix types due to `owner.lookup` type changes We explicitly added `| undefined` to the return type in the previous commit Co-authored-by: Robert Jackson <[email protected]>
packages/@ember/-internals/glimmer/lib/component-managers/curly.ts
@@ -119,27 +119,28 @@ export default class CurlyComponentManager }; } - templateFor(component: Component): OwnedTemplate { - let { layout: _layout, layoutName } = component; + protected templateFor(component: Component): OwnedTemplate { + let { layout, layoutName } = component; let owner = getOwner(component); - let layout: TemplateFactory; + let factory: TemplateFactory; - if (_layout === undefined) { + if (layout === undefined) { if (layoutName !== undefined) { - layout = owner.lookup<TemplateFactory>(`template:${layoutName}`); - assert(`Layout \`${layoutName}\` not found!`, layout !== undefined); + let _factory = owner.lookup<TemplateFactory>(`template:${layoutName}`); + assert(`Layout \`${layoutName}\` not found!`, _factory !== undefined); + factory = _factory!; } else { - layout = owner.lookup(DEFAULT_LAYOUT); + factory = owner.lookup<TemplateFactory>(DEFAULT_LAYOUT)!; } - } else if (isTemplateFactory(_layout)) { - layout = _layout; + } else if (isTemplateFactory(layout)) { + factory = layout; } else { // we were provided an instance already - return _layout; + return layout; } - return layout(owner); + return factory(owner); } getDynamicLayout({ component }: ComponentStateBucket): Invocation {
true
Other
emberjs
ember.js
6c3ac7ca39a33c1c478080f1412aeb311d2019e5.json
Fix types due to `owner.lookup` type changes We explicitly added `| undefined` to the return type in the previous commit Co-authored-by: Robert Jackson <[email protected]>
packages/@ember/-internals/routing/lib/location/auto_location.ts
@@ -99,12 +99,11 @@ export default class AutoLocation extends EmberObject implements EmberLocation { implementation = 'none'; } - let concrete = getOwner(this).lookup(`location:${implementation}`); - set(concrete, 'rootURL', rootURL); + let concrete = getOwner(this).lookup<EmberLocation>(`location:${implementation}`); + assert(`Could not find location '${implementation}'.`, concrete !== undefined); - assert(`Could not find location '${implementation}'.`, Boolean(concrete)); - - set(this, 'concreteImplementation', concrete); + set(concrete!, 'rootURL', rootURL); + set(this, 'concreteImplementation', concrete!); } willDestroy() {
true
Other
emberjs
ember.js
6c3ac7ca39a33c1c478080f1412aeb311d2019e5.json
Fix types due to `owner.lookup` type changes We explicitly added `| undefined` to the return type in the previous commit Co-authored-by: Robert Jackson <[email protected]>
packages/@ember/-internals/routing/lib/system/generate_controller.ts
@@ -1,5 +1,6 @@ import { get } from '@ember/-internals/metal'; import { Factory, Owner } from '@ember/-internals/owner'; +import Controller from '@ember/controller'; import { info } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; /** @@ -39,11 +40,11 @@ export function generateControllerFactory(owner: Owner, controllerName: string): @private @since 1.3.0 */ -export default function generateController(owner: Owner, controllerName: string) { +export default function generateController(owner: Owner, controllerName: string): Controller { generateControllerFactory(owner, controllerName); let fullName = `controller:${controllerName}`; - let instance = owner.lookup(fullName); + let instance = owner.lookup<Controller>(fullName)!; if (DEBUG) { if (get(instance, 'namespace.LOG_ACTIVE_GENERATION')) {
true
Other
emberjs
ember.js
6c3ac7ca39a33c1c478080f1412aeb311d2019e5.json
Fix types due to `owner.lookup` type changes We explicitly added `| undefined` to the return type in the previous commit Co-authored-by: Robert Jackson <[email protected]>
packages/@ember/-internals/routing/lib/system/route.ts
@@ -18,6 +18,7 @@ import { typeOf, } from '@ember/-internals/runtime'; import { EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT } from '@ember/canary-features'; +import Controller from '@ember/controller'; import { assert, deprecate, info, isTesting } from '@ember/debug'; import { ROUTER_EVENTS } from '@ember/deprecated-features'; import { assign } from '@ember/polyfills'; @@ -235,9 +236,9 @@ class Route extends EmberObject implements IRoute { @public */ paramsFor(name: string) { - let route: Route = getOwner(this).lookup(`route:${name}`); + let route = getOwner(this).lookup<Route>(`route:${name}`); - if (!route) { + if (route === undefined) { return {}; } @@ -1272,7 +1273,7 @@ class Route extends EmberObject implements IRoute { @since 1.0.0 @public */ - setupController(controller: any, context: {}, _transition: Transition) { + setupController(controller: Controller, context: {}, _transition: Transition) { // eslint-disable-line no-unused-vars if (controller && context !== undefined) { set(controller, 'model', context); @@ -1303,26 +1304,25 @@ class Route extends EmberObject implements IRoute { @since 1.0.0 @public */ - controllerFor(name: string, _skipAssert: boolean) { + controllerFor(name: string, _skipAssert: boolean): Controller { let owner = getOwner(this); - let route: Route = owner.lookup(`route:${name}`); - let controller: string; + let route = owner.lookup<Route>(`route:${name}`); if (route && route.controllerName) { name = route.controllerName; } - controller = owner.lookup(`controller:${name}`); + let controller = owner.lookup<Controller>(`controller:${name}`); // NOTE: We're specifically checking that skipAssert is true, because according // to the old API the second parameter was model. We do not want people who // passed a model to skip the assertion. assert( `The controller named '${name}' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.`, - Boolean(controller) || _skipAssert === true + controller !== undefined || _skipAssert === true ); - return controller; + return controller!; } /** @@ -1408,7 +1408,7 @@ class Route extends EmberObject implements IRoute { name = _name; } - let route: Route = owner.lookup(`route:${name}`); + let route = owner.lookup<Route>(`route:${name}`); // If we are mid-transition, we want to try and look up // resolved parent contexts on the current transitionEvent. if (transition !== undefined && transition !== null) { @@ -1812,7 +1812,9 @@ function buildRenderOptions( ); let owner = getOwner(route); - let name, templateName, into, outlet, controller: string | {}, model; + let name, templateName, into, outlet, model; + let controller: Controller | string | undefined = undefined; + if (options) { into = options.into && options.into.replace(/\//g, '.'); outlet = options.outlet; @@ -1829,31 +1831,32 @@ function buildRenderOptions( templateName = name; } - if (!controller!) { + if (controller === undefined) { if (isDefaultRender) { - controller = route.controllerName || owner.lookup(`controller:${name}`); + controller = route.controllerName || owner.lookup<Controller>(`controller:${name}`); } else { - controller = owner.lookup(`controller:${name}`) || route.controllerName || route.routeName; + controller = + owner.lookup<Controller>(`controller:${name}`) || route.controllerName || route.routeName; } } - if (typeof controller! === 'string') { - let controllerName = controller!; - controller = owner.lookup(`controller:${controllerName}`); + if (typeof controller === 'string') { + let controllerName = controller; + controller = owner.lookup<Controller>(`controller:${controllerName}`); assert( `You passed \`controller: '${controllerName}'\` into the \`render\` method, but no such controller could be found.`, - isDefaultRender || Boolean(controller) + isDefaultRender || controller !== undefined ); } if (model) { (controller! as any).set('model', model); } - let template: TemplateFactory = owner.lookup(`template:${templateName}`); + let template = owner.lookup<TemplateFactory>(`template:${templateName}`); assert( `Could not find "${templateName}" template, view, or component.`, - isDefaultRender || Boolean(template) + isDefaultRender || template !== undefined ); let parent: any; @@ -1866,7 +1869,7 @@ function buildRenderOptions( into, outlet, name, - controller: controller! as any, + controller, template: template !== undefined ? template(owner) : route._topLevelViewTemplate(owner), }; @@ -2228,7 +2231,7 @@ Route.reopen(ActionHandler, Evented, { let controllerName = this.controllerName || this.routeName; let owner = getOwner(this); - let controller = owner.lookup(`controller:${controllerName}`); + let controller = owner.lookup<Controller>(`controller:${controllerName}`); let queryParameterConfiguraton = get(this, 'queryParams'); let hasRouterDefinedQueryParams = Object.keys(queryParameterConfiguraton).length > 0; @@ -2278,7 +2281,7 @@ Route.reopen(ActionHandler, Evented, { } let urlKey = desc.as || this.serializeQueryParamKey(propName); - let defaultValue = get(controller, propName); + let defaultValue = get(controller!, propName); defaultValue = copyDefaultValue(defaultValue); @@ -2287,7 +2290,7 @@ Route.reopen(ActionHandler, Evented, { let defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); let scopedPropertyName = `${controllerName}:${propName}`; let qp = { - undecoratedDefaultValue: get(controller, propName), + undecoratedDefaultValue: get(controller!, propName), defaultValue, serializedDefaultValue: defaultValueSerialized, serializedValue: defaultValueSerialized,
true
Other
emberjs
ember.js
6c3ac7ca39a33c1c478080f1412aeb311d2019e5.json
Fix types due to `owner.lookup` type changes We explicitly added `| undefined` to the return type in the previous commit Co-authored-by: Robert Jackson <[email protected]>
packages/@ember/-internals/routing/lib/system/router.ts
@@ -150,7 +150,7 @@ class EmberRouter extends EmberObject { let seen = Object.create(null); class PrivateRouter extends Router<Route> { - getRoute(name: string) { + getRoute(name: string): Route { let routeName = name; let routeOwner = owner; let engineInfo = router._engineInfoByRoute[routeName]; @@ -164,10 +164,10 @@ class EmberRouter extends EmberObject { let fullRouteName = `route:${routeName}`; - let route: Route = routeOwner.lookup(fullRouteName); + let route = routeOwner.lookup<Route>(fullRouteName); if (seen[name]) { - return route; + return route!; } seen[name] = true; @@ -184,15 +184,15 @@ class EmberRouter extends EmberObject { } } - route._setRouteName(routeName); + route!._setRouteName(routeName); - if (engineInfo && !hasDefaultSerialize(route)) { + if (engineInfo && !hasDefaultSerialize(route!)) { throw new Error( 'Defining a custom serialize method on an Engine route is not supported.' ); } - return route; + return route!; } getSerializer(name: string) {
true
Other
emberjs
ember.js
6c3ac7ca39a33c1c478080f1412aeb311d2019e5.json
Fix types due to `owner.lookup` type changes We explicitly added `| undefined` to the return type in the previous commit Co-authored-by: Robert Jackson <[email protected]>
packages/@ember/controller/index.d.ts
@@ -0,0 +1,8 @@ +export default interface Controller { + isController: true; + target?: unknown; + store?: unknown; + model?: unknown; +} + +export function inject(name?: string): Controller;
true
Other
emberjs
ember.js
de4234af72a6ce14b539baf1b5a1e1c273f8c03f.json
Add v3.12.0-beta.1 to CHANGELOG [ci skip] (cherry picked from commit e5d5133746a5495cd99f54a38fc94a27657a7ed7)
CHANGELOG.md
@@ -1,5 +1,11 @@ # Ember Changelog +# v3.12.0-beta.1 (June 27, 2019) + +- [#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` + ### 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
b9a7e031df1c588453feac1f9b003c95d0ed995b.json
Add v3.11.0 to CHANGELOG [ci skip] (cherry picked from commit cc2d5ece206b1e64025cdb036b420a4c3d64724d)
CHANGELOG.md
@@ -1,29 +1,16 @@ # Ember Changelog -### v3.11.0-beta.4 (June 17, 2019) - -- [#17971](https://github.com/emberjs/ember.js/pull/17971) [BUGFIX] Ensure query param only link-to's work in error states. - -### v3.11.0-beta.3 (June 10, 2019) - -- [#18080](https://github.com/emberjs/ember.js/pull/18080) [BUGFIX] Fix `ember-template-compiler` compatibility with Fastboot. -- [#18071](https://github.com/emberjs/ember.js/pull/18071) [BUGFIX] Ensure modifiers do not run in FastBoot modes. - -### v3.11.0-beta.2 (June 3, 2019) - -- [#18064](https://github.com/emberjs/ember.js/pull/18064) [BUGFIX] Fix 'hasAttribute is not a function' when jQuery is disabled - -### v3.11.0-beta.1 (May 13, 2019) +### 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). - [#17941](https://github.com/emberjs/ember.js/pull/17941) / [#17961](https://github.com/emberjs/ember.js/pull/17961) [FEATURE] Implement the [{{fn}} rfc](https://github.com/emberjs/rfcs/blob/master/text/0470-fn-helper.md). -- [#17960](https://github.com/emberjs/ember.js/pull/17960) [FEATURE] Implement the [{{on}} modifier RFC](https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md) -- [#17858](https://github.com/emberjs/ember.js/pull/17858) [FEATURE] Implement the [Inject Parameter Normalization RFC](https://github.com/emberjs/rfcs/blob/master/text/0451-injection-parameter-normalization.md). +- [#17960](https://github.com/emberjs/ember.js/pull/17960) / [#18026](https://github.com/emberjs/ember.js/pull/18026) [FEATURE] Implement the [{{on}} modifier RFC](https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md) +- [#17858](https://github.com/emberjs/ember.js/pull/17858) / [#18026](https://github.com/emberjs/ember.js/pull/18026) [FEATURE] Implement the [Inject Parameter Normalization RFC](https://github.com/emberjs/rfcs/blob/master/text/0451-injection-parameter-normalization.md). - [#17910](https://github.com/emberjs/ember.js/pull/17910) [DEPRECATION] Add deprecation for Function.prototype extensions. - [#17845](https://github.com/emberjs/ember.js/pull/17845) [CLEANUP] Removes various deprecated APIs - [#17843](https://github.com/emberjs/ember.js/pull/17843) [CLEANUP] Remove deprecated intimate apis in the router - [#17940](https://github.com/emberjs/ember.js/pull/17940) [CLEANUP] Remove `sync` queue from @ember/runloop. -- [#18026](https://github.com/emberjs/ember.js/pull/18026) Enabling featured discussed in 2019-05-03 core team meeting. +- [#18110](https://github.com/emberjs/ember.js/pull/18110) [BUGFIX] Ensure calling `recompute` on a class-based helper causes it to recompute ### v3.10.2 (June 18, 2019)
false
Other
emberjs
ember.js
68ef63c7b2307ba35034132aa36a26cabc61fd0a.json
remove usage of `get` helpers in location classes (#18123) remove usage of `get` helpers in location classes
packages/@ember/-internals/routing/lib/location/api.ts
@@ -1,4 +1,3 @@ -import { location } from '@ember/-internals/browser-environment'; import { assert } from '@ember/debug'; export interface EmberLocation { @@ -111,5 +110,4 @@ export default { }, implementations: {}, - _location: location, };
true
Other
emberjs
ember.js
68ef63c7b2307ba35034132aa36a26cabc61fd0a.json
remove usage of `get` helpers in location classes (#18123) remove usage of `get` helpers in location classes
packages/@ember/-internals/routing/lib/location/auto_location.ts
@@ -1,10 +1,9 @@ import { history, location, userAgent, window } from '@ember/-internals/browser-environment'; -import { get, set } from '@ember/-internals/metal'; +import { set } from '@ember/-internals/metal'; import { getOwner } from '@ember/-internals/owner'; import { Object as EmberObject } from '@ember/-internals/runtime'; import { tryInvoke } from '@ember/-internals/utils'; import { assert } from '@ember/debug'; - import { EmberLocation, UpdateCallback } from './api'; import { getFullPath, @@ -109,7 +108,7 @@ export default class AutoLocation extends EmberObject implements EmberLocation { } willDestroy() { - let concreteImplementation = get(this, 'concreteImplementation'); + let { concreteImplementation } = this; if (concreteImplementation) { concreteImplementation.destroy(); @@ -196,7 +195,7 @@ AutoLocation.reopen({ function delegateToConcreteImplementation(methodName: string) { return function(this: AutoLocation, ...args: any[]) { - let concreteImplementation = get(this, 'concreteImplementation'); + let { concreteImplementation } = this; assert( "AutoLocation's detect() method should be called before calling any other hooks.", Boolean(concreteImplementation)
true
Other
emberjs
ember.js
68ef63c7b2307ba35034132aa36a26cabc61fd0a.json
remove usage of `get` helpers in location classes (#18123) remove usage of `get` helpers in location classes
packages/@ember/-internals/routing/lib/location/hash_location.ts
@@ -1,7 +1,6 @@ -import { get, set } from '@ember/-internals/metal'; -import { bind } from '@ember/runloop'; - +import { set } from '@ember/-internals/metal'; import { Object as EmberObject } from '@ember/-internals/runtime'; +import { bind } from '@ember/runloop'; import { EmberLocation, UpdateCallback } from './api'; import { getHash } from './util'; @@ -41,8 +40,7 @@ export default class HashLocation extends EmberObject implements EmberLocation { implementation = 'hash'; init() { - set(this, 'location', get(this, '_location') || window.location); - + set(this, 'location', this._location || window.location); this._hashchangeHandler = undefined; } @@ -55,7 +53,7 @@ export default class HashLocation extends EmberObject implements EmberLocation { @method getHash */ getHash() { - return getHash(get(this, 'location')); + return getHash(this.location); } /** @@ -98,7 +96,7 @@ export default class HashLocation extends EmberObject implements EmberLocation { @param path {String} */ setURL(path: string) { - get(this, 'location').hash = path; + this.location.hash = path; set(this, 'lastSetURL', path); } @@ -111,7 +109,7 @@ export default class HashLocation extends EmberObject implements EmberLocation { @param path {String} */ replaceURL(path: string) { - get(this, 'location').replace(`#${path}`); + this.location.replace(`#${path}`); set(this, 'lastSetURL', path); } @@ -128,7 +126,7 @@ export default class HashLocation extends EmberObject implements EmberLocation { this._removeEventListener(); this._hashchangeHandler = bind(this, function(this: HashLocation) { let path = this.getURL(); - if (get(this, 'lastSetURL') === path) { + if (this.lastSetURL === path) { return; }
true
Other
emberjs
ember.js
68ef63c7b2307ba35034132aa36a26cabc61fd0a.json
remove usage of `get` helpers in location classes (#18123) remove usage of `get` helpers in location classes
packages/@ember/-internals/routing/lib/location/history_location.ts
@@ -1,5 +1,4 @@ -import { get, set } from '@ember/-internals/metal'; - +import { set } from '@ember/-internals/metal'; import { Object as EmberObject } from '@ember/-internals/runtime'; import { EmberLocation, UpdateCallback } from './api'; import { getHash } from './util'; @@ -68,7 +67,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio @method getHash */ getHash() { - return getHash(get(this, 'location')); + return getHash(this.location); } init() { @@ -81,7 +80,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio } set(this, 'baseURL', baseURL); - set(this, 'location', get(this, 'location') || window.location); + set(this, 'location', this.location || window.location); this._popstateHandler = undefined; } @@ -93,7 +92,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio @method initState */ initState() { - let history = get(this, 'history') || window.history; + let history = this.history || window.history; set(this, 'history', history); if (history && 'state' in history) { @@ -119,12 +118,9 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio @return url {String} */ getURL() { - let location = get(this, 'location'); + let { location, rootURL, baseURL } = this; let path = location.pathname; - let rootURL = get(this, 'rootURL'); - let baseURL = get(this, 'baseURL'); - // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); baseURL = baseURL.replace(/\/$/, ''); @@ -190,7 +186,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio */ getState() { if (this.supportsHistory) { - return get(this, 'history').state; + return this.history.state; } return this._historyState; @@ -206,7 +202,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio pushState(path: string) { let state = { path, uuid: _uuid() }; - get(this, 'history').pushState(state, null, path); + this.history.pushState(state, null, path); this._historyState = state; @@ -224,7 +220,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio replaceState(path: string) { let state = { path, uuid: _uuid() }; - get(this, 'history').replaceState(state, null, path); + this.history.replaceState(state, null, path); this._historyState = state; @@ -266,8 +262,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio @return formatted url {String} */ formatURL(url: string) { - let rootURL = get(this, 'rootURL'); - let baseURL = get(this, 'baseURL'); + let { rootURL, baseURL } = this; if (url !== '') { // remove trailing slashes if they exists
true
Other
emberjs
ember.js
68ef63c7b2307ba35034132aa36a26cabc61fd0a.json
remove usage of `get` helpers in location classes (#18123) remove usage of `get` helpers in location classes
packages/@ember/-internals/routing/lib/location/none_location.ts
@@ -1,4 +1,4 @@ -import { get, set } from '@ember/-internals/metal'; +import { set } from '@ember/-internals/metal'; import { Object as EmberObject } from '@ember/-internals/runtime'; import { assert } from '@ember/debug'; import { EmberLocation, UpdateCallback } from './api'; @@ -26,7 +26,7 @@ export default class NoneLocation extends EmberObject implements EmberLocation { implementation = 'none'; detect() { - let rootURL = this.rootURL; + let { rootURL } = this; assert( 'rootURL must end with a trailing forward slash e.g. "/app/"', @@ -42,8 +42,7 @@ export default class NoneLocation extends EmberObject implements EmberLocation { @return {String} path */ getURL() { - let path = get(this, 'path'); - let rootURL = get(this, 'rootURL'); + let { path, rootURL } = this; // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); @@ -102,7 +101,7 @@ export default class NoneLocation extends EmberObject implements EmberLocation { @return {String} url */ formatURL(url: string) { - let rootURL = get(this, 'rootURL'); + let { rootURL } = this; if (url !== '') { // remove trailing slashes if they exists
true
Other
emberjs
ember.js
e3cf6cae68497c5006b2579522c5035d5d25d4c0.json
Add v3.11.0-beta.4 to CHANGELOG [ci skip] (cherry picked from commit 2f7f91d168f2705c4d90b339607124deaa054450)
CHANGELOG.md
@@ -1,5 +1,9 @@ # Ember Changelog +### v3.11.0-beta.4 (June 17, 2019) + +- [#17971](https://github.com/emberjs/ember.js/pull/17971) [BUGFIX] Ensure query param only link-to's work in error states. + ### v3.11.0-beta.3 (June 10, 2019) - [#18080](https://github.com/emberjs/ember.js/pull/18080) [BUGFIX] Fix `ember-template-compiler` compatibility with Fastboot.
false
Other
emberjs
ember.js
8ead9d08387c460c9d70079b5fbe8fc2bee2ef38.json
Add v3.10.2 to CHANGELOG.md. [ci skip]
CHANGELOG.md
@@ -21,6 +21,10 @@ - [#17940](https://github.com/emberjs/ember.js/pull/17940) [CLEANUP] Remove `sync` queue from @ember/runloop. - [#18026](https://github.com/emberjs/ember.js/pull/18026) Enabling featured discussed in 2019-05-03 core team meeting. +### v3.10.2 (June 17, 2019) + +- [#17971](https://github.com/emberjs/ember.js/pull/17971) [BUGFIX] Ensure query param only link-to's work in error states. + ### v3.10.1 (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
de467207177d67d9b2b8a23a81046b4a8cb84574.json
Update documentation for currentRoute
packages/@ember/-internals/routing/lib/services/router.ts
@@ -439,7 +439,7 @@ RouterService.reopen(Evented, { the application, '/' by default. This prefix is assumed on all routes defined on this app. - IF you change the `rootURL` in your environment configuration + If you change the `rootURL` in your environment configuration like so: ```config/environment.js @@ -464,10 +464,28 @@ RouterService.reopen(Evented, { rootURL: readOnly('_router.rootURL'), /** - A `RouteInfo` that represents the current leaf route. - It is guaranteed to change whenever a route transition - happens (even when that transition only changes parameters - and doesn't change the active route) + The `currentRoute` property contains metadata about the current leaf route. + It returns a `RouteInfo` object that has information like the route name, + params, query params and more. + + See [RouteInfo](/ember/release/classes/RouteInfo) for more info. + + This property is guaranteed to change whenever a route transition + happens (even when that transition only changes parameters + and doesn't change the active route). + + Usage example: + ```app/components/header.js + import Component from '@ember/component'; + import { inject as service } from '@ember/service'; + import { computed } from '@ember/object'; + + export default Component.extend({ + router: service(), + + isChildRoute: computed.notEmpty('router.currentRoute.child') + }); + ``` @property currentRoute @type RouteInfo
false
Other
emberjs
ember.js
d7a2737078dbb389b5ec2356512be9680076a9fd.json
Add v3.11.0-beta.3 to CHANGELOG [ci skip] (cherry picked from commit 68c69e7819c2f8e545185ed28a772bddf3117538)
CHANGELOG.md
@@ -1,5 +1,10 @@ # Ember Changelog +### v3.11.0-beta.3 (June 10, 2019) + +- [#18080](https://github.com/emberjs/ember.js/pull/18080) [BUGFIX] Fix `ember-template-compiler` compatibility with Fastboot. +- [#18071](https://github.com/emberjs/ember.js/pull/18071) [BUGFIX] Ensure modifiers do not run in FastBoot modes. + ### v3.11.0-beta.2 (June 3, 2019) - [#18064](https://github.com/emberjs/ember.js/pull/18064) [BUGFIX] Fix 'hasAttribute is not a function' when jQuery is disabled
false
Other
emberjs
ember.js
1664f6fcdd30667b25b9fd46058560c081adae73.json
Fix function name in documentation example Renamed `this.args.selected` to `this.args.select`
packages/@ember/-internals/glimmer/lib/helpers/fn.ts
@@ -49,7 +49,7 @@ const context = buildUntouchableThis('`fn` helper'); - When invoked as `this.args.select()` the `handleSelected` function will receive the `item` from the loop as its first and only argument. - - When invoked as `this.args.selected('foo')` the `handleSelected` function + - When invoked as `this.args.select('foo')` the `handleSelected` function will receive the `item` from the loop as its first argument and the string `'foo'` as its second argument.
false
Other
emberjs
ember.js
25fd4829145e454ffaae02151f5511bf13b49cfd.json
Add v3.10.1 to CHANGELOG.md. [ci skip]
CHANGELOG.md
@@ -16,6 +16,10 @@ - [#17940](https://github.com/emberjs/ember.js/pull/17940) [CLEANUP] Remove `sync` queue from @ember/runloop. - [#18026](https://github.com/emberjs/ember.js/pull/18026) Enabling featured discussed in 2019-05-03 core team meeting. +### v3.10.1 (June 4, 2019) + +- [#18071](https://github.com/emberjs/ember.js/pull/18071) [BUGFIX] Ensure modifiers do not run in FastBoot modes. (#18071) +- [#18064](https://github.com/emberjs/ember.js/pull/18064) [BUGFIX] Fix 'hasAttribute is not a function' when jQuery is disabled (#18064) ### v3.10.0 (May 13, 2019)
false
Other
emberjs
ember.js
5eca0045b4ef3606923e4b124034f6063a813b6f.json
Add v3.8.2 to CHANGELOG.md. [ci skip]
CHANGELOG.md
@@ -50,6 +50,13 @@ - [#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.2 (June, 4, 2019) + +- [#18071](https://github.com/emberjs/ember.js/pull/18071) [BUGFIX] Ensure modifiers do not run in FastBoot modes. (#18071) +- [#18064](https://github.com/emberjs/ember.js/pull/18064) [BUGFIX] Fix 'hasAttribute is not a function' when jQuery is disabled (#18064) +- [#17974](https://github.com/emberjs/ember.js/pull/17974) [BUGFIX] Ensure inheritable observers on object proxies are string based +- [#17859](https://github.com/emberjs/ember.js/pull/17859) [BUGFIX] Fixes a regression in the legacy build + ### v3.8.1 (April 02, 2019) - [#17684](https://github.com/emberjs/ember.js/pull/17684) [BUGFIX] Enable maximum rerendering limit to be customized.
false
Other
emberjs
ember.js
16f9cd2905865c112e05859b6c56e68ac9cf1497.json
Add v3.11.0-beta.2 to CHANGELOG [ci skip] (cherry picked from commit 934d74fef88db9e1c0719c5225a0debf4794fe00)
CHANGELOG.md
@@ -1,5 +1,9 @@ # Ember Changelog +### v3.11.0-beta.2 (June 3, 2019) + +- [#18064](https://github.com/emberjs/ember.js/pull/18064) [BUGFIX] Fix 'hasAttribute is not a function' when jQuery is disabled + ### v3.11.0-beta.1 (May 13, 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
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/index.ts
@@ -63,14 +63,16 @@ )}}></span> ``` - Ember's built-in helpers are described under the [Ember.Templates.helpers](/api/ember/release/classes/Ember.Templates.helpers) + Ember's built-in helpers are described under the [Ember.Templates.helpers](/ember/release/classes/Ember.Templates.helpers) namespace. Documentation on creating custom helpers can be found under - [Helper](/api/classes/Ember.Helper.html). + [helper](/ember/release/functions/@ember%2Fcomponent%2Fhelper/helper) (or + under [Helper](/ember/release/classes/Helper) if a helper requires access to + dependency injection). ### Invoking a Component Ember components represent state to the UI of an application. Further - reading on components can be found under [Component](/api/ember/release/classes/Component). + reading on components can be found under [Component](/ember/release/classes/Component). @module @ember/component @main @ember/component
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/component.ts
@@ -372,7 +372,7 @@ export const BOUNDS = symbol('BOUNDS'); will be removed. Both `classNames` and `classNameBindings` are concatenated properties. See - [EmberObject](/api/ember/release/classes/EmberObject) documentation for more + [EmberObject](/ember/release/classes/EmberObject) documentation for more information about concatenated properties. ### Other HTML Attributes @@ -514,7 +514,7 @@ export const BOUNDS = symbol('BOUNDS'); update of the HTML attribute in the component's HTML output. `attributeBindings` is a concatenated property. See - [EmberObject](/api/ember/release/classes/EmberObject) documentation for more + [EmberObject](/ember/release/classes/EmberObject) documentation for more information about concatenated properties. ## Layouts
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/components/checkbox.ts
@@ -12,7 +12,7 @@ import layout from '../templates/empty'; The internal class used to create text inputs when the `{{input}}` helper is used with `type` of `checkbox`. - See [Ember.Templates.helpers.input](/api/ember/release/classes/Ember.Templates.helpers/methods/input?anchor=input) for usage details. + See [Ember.Templates.helpers.input](/ember/release/classes/Ember.Templates.helpers/methods/input?anchor=input) for usage details. ## Direct manipulation of `checked`
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/components/input.ts
@@ -11,7 +11,7 @@ let Input: any; if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { /** - See [Ember.Templates.components.Input](/api/ember/release/classes/Ember.Templates.components/methods/Input?anchor=Input). + See [Ember.Templates.components.Input](/ember/release/classes/Ember.Templates.components/methods/Input?anchor=Input). @method input @for Ember.Templates.helpers @@ -87,7 +87,7 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { the helper to `TextField`'s `create` method. Subclassing `TextField` is supported but not recommended. - See [TextField](/api/ember/release/classes/TextField) + See [TextField](/ember/release/classes/TextField) ### Checkbox
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/components/link-to.ts
@@ -1165,7 +1165,7 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { {{/link-to}} ``` - See [LinkComponent](/api/ember/release/classes/LinkComponent) for a + See [LinkComponent](/ember/release/classes/LinkComponent) for a complete list of overrideable properties. Be sure to also check out inherited properties of `LinkComponent`.
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/components/text-field.ts
@@ -33,7 +33,7 @@ function canSetTypeOfInput(type: string): boolean { /** The internal class used to create text inputs when the `Input` component is used with `type` of `text`. - See [Ember.Templates.components.Input](/api/ember/release/classes/Ember.Templates.components/methods/Input?anchor=Input) for usage details. + See [Ember.Templates.components.Input](/ember/release/classes/Ember.Templates.components/methods/Input?anchor=Input) for usage details. ## Layout and LayoutName properties
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/helpers/action.ts
@@ -87,7 +87,7 @@ import { ACTION, INVOKE, UnboundReference } from '../utils/references'; Closure actions curry both their scope and any arguments. When invoked, any additional arguments are added to the already curried list. - Actions should be invoked using the [sendAction](/api/ember/release/classes/Component/methods/sendAction?anchor=sendAction) + Actions should be invoked using the [sendAction](/ember/release/classes/Component/methods/sendAction?anchor=sendAction) method. The first argument to `sendAction` is the action to be called, and additional arguments are passed to the action function. This has interesting properties combined with currying of arguments. For example: @@ -208,7 +208,7 @@ import { ACTION, INVOKE, UnboundReference } from '../utils/references'; If you need the default handler to trigger you should either register your own event handler, or use event methods on your view class. See - ["Responding to Browser Events"](/api/ember/release/classes/Component) + ["Responding to Browser Events"](/ember/release/classes/Component) in the documentation for `Component` for more information. ### Specifying DOM event type @@ -223,7 +223,7 @@ import { ACTION, INVOKE, UnboundReference } from '../utils/references'; </div> ``` - See ["Event Names"](/api/ember/release/classes/Component) for a list of + See ["Event Names"](/ember/release/classes/Component) for a list of acceptable DOM event names. ### Specifying whitelisted modifier keys
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/helpers/component.ts
@@ -4,7 +4,7 @@ /** The `{{component}}` helper lets you add instances of `Component` to a - template. See [Component](/api/ember/release/classes/Component) for + template. See [Component](/ember/release/classes/Component) for additional information on how a `Component` functions. `{{component}}`'s primary use is for cases where you want to dynamically change which type of component is rendered as the state of your application
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/helpers/loc.ts
@@ -6,7 +6,7 @@ import { loc } from '@ember/string'; import { helper } from '../helper'; /** - Calls [loc](/api/classes/Ember.String.html#method_loc) with the + Calls [String.loc](/ember/release/classes/String/methods/loc?anchor=loc) with the provided string. This is a convenient way to localize text within a template. For example: @@ -28,7 +28,7 @@ import { helper } from '../helper'; </div> ``` - See [String.loc](/api/ember/release/classes/String/methods/loc?anchor=loc) for how to + See [String.loc](/ember/release/classes/String/methods/loc?anchor=loc) for how to set up localized string references. @method loc
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/glimmer/lib/syntax/input.ts
@@ -29,7 +29,7 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { /** The `{{input}}` helper lets you create an HTML `<input />` component. It causes a `TextField` component to be rendered. For more info, - see the [TextField](/api/ember/release/classes/TextField) docs and + see the [TextField](/ember/release/classes/TextField) docs and the [templates guide](https://guides.emberjs.com/release/templates/input-helpers/). ```handlebars @@ -97,7 +97,7 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { ```handlebars {{input focus-out="alertMessage"}} ``` - See more about [Text Support Actions](/api/ember/release/classes/TextField) + See more about [Text Support Actions](/ember/release/classes/TextField) ### Extending `TextField` @@ -117,7 +117,7 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { Keep in mind when writing `TextField` subclasses that `TextField` itself extends `Component`. Expect isolated component semantics, not legacy 1.x view semantics (like `controller` being present). - See more about [Ember components](/api/ember/release/classes/Component) + See more about [Ember components](/ember/release/classes/Component) ### Checkbox
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/routing/lib/ext/controller.ts
@@ -136,7 +136,7 @@ ControllerMixin.reopen({ aController.transitionToRoute({ queryParams: { sort: 'date' } }); ``` - See also [replaceRoute](/api/ember/release/classes/Ember.ControllerMixin/methods/replaceRoute?anchor=replaceRoute). + See also [replaceRoute](/ember/release/classes/Ember.ControllerMixin/methods/replaceRoute?anchor=replaceRoute). @param {String} name the name of the route or a URL @param {...Object} models the model(s) or identifier(s) to be used
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/routing/lib/location/api.ts
@@ -27,10 +27,10 @@ export type UpdateCallback = (url: string) => void; You can pass an implementation name (`hash`, `history`, `none`, `auto`) to force a particular implementation to be used in your application. - See [HashLocation](/api/ember/release/classes/HashLocation). - See [HistoryLocation](/api/ember/release/classes/HistoryLocation). - See [NoneLocation](/api/ember/release/classes/NoneLocation). - See [AutoLocation](/api/ember/release/classes/AutoLocation). + See [HashLocation](/ember/release/classes/HashLocation). + See [HistoryLocation](/ember/release/classes/HistoryLocation). + See [NoneLocation](/ember/release/classes/NoneLocation). + See [AutoLocation](/ember/release/classes/AutoLocation). ## Location API
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/routing/lib/services/router.ts
@@ -84,7 +84,7 @@ export default class RouterService extends Service { Transition the application into another route. The route may be either a single route or route path: - See [transitionTo](/api/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info. + See [transitionTo](/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info. Calling `transitionTo` from the Router service will cause default query parameter values to be included in the URL. This behavior is different from calling `transitionTo` on a route or `transitionToRoute` on a controller. @@ -117,7 +117,7 @@ export default class RouterService extends Service { Transition into another route while replacing the current URL, if possible. The route may be either a single route or route path: - See [replaceWith](/api/ember/release/classes/Route/methods/replaceWith?anchor=replaceWith) for more info. + See [replaceWith](/ember/release/classes/Route/methods/replaceWith?anchor=replaceWith) for more info. Calling `replaceWith` from the Router service will cause default query parameter values to be included in the URL. This behavior is different from calling `replaceWith` on a route.
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/routing/lib/system/router.ts
@@ -497,7 +497,7 @@ class EmberRouter extends EmberObject { Transition the application into another route. The route may be either a single route or route path: - See [transitionTo](/api/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info. + See [transitionTo](/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info. @method transitionTo @param {String} name the name of the route or a URL
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/-internals/runtime/lib/ext/function.js
@@ -68,7 +68,7 @@ if (FUNCTION_PROTOTYPE_EXTENSIONS && ENV.EXTEND_PROTOTYPES.Function) { will instead clear the cache so that it is updated when the next `get` is called on the property. - See [ComputedProperty](/api/ember/release/classes/ComputedProperty), [@ember/object/computed](/api/ember/release/classes/@ember%2Fobject%2Fcomputed). + See [ComputedProperty](/ember/release/classes/ComputedProperty), [@ember/object/computed](/ember/release/classes/@ember%2Fobject%2Fcomputed). @method property @for Function
true
Other
emberjs
ember.js
e039f3f7fda6f640eeab3e322d1587b415ebc40a.json
Fix links in documentation Documentation links were pointing at `/api/`, when the Ember documentation does not live at https://api.emberjs.com under that path. Thus all these links have been broken. And correct a few broken for other reasons.
packages/@ember/string/index.ts
@@ -281,7 +281,7 @@ export function capitalize(str: string): string { if (ENV.EXTEND_PROTOTYPES.String) { Object.defineProperties(String.prototype, { /** - See [String.w](/api/ember/release/classes/String/methods/w?anchor=w). + See [String.w](/ember/release/classes/String/methods/w?anchor=w). @method w @for @ember/string @@ -298,7 +298,7 @@ if (ENV.EXTEND_PROTOTYPES.String) { }, /** - See [String.loc](/api/ember/release/classes/String/methods/loc?anchor=loc). + See [String.loc](/ember/release/classes/String/methods/loc?anchor=loc). @method loc @for @ember/string @@ -315,7 +315,7 @@ if (ENV.EXTEND_PROTOTYPES.String) { }, /** - See [String.camelize](/api/ember/release/classes/String/methods/camelize?anchor=camelize). + See [String.camelize](/ember/release/classes/String/methods/camelize?anchor=camelize). @method camelize @for @ember/string @@ -332,7 +332,7 @@ if (ENV.EXTEND_PROTOTYPES.String) { }, /** - See [String.decamelize](/api/ember/release/classes/String/methods/decamelize?anchor=decamelize). + See [String.decamelize](/ember/release/classes/String/methods/decamelize?anchor=decamelize). @method decamelize @for @ember/string @@ -349,7 +349,7 @@ if (ENV.EXTEND_PROTOTYPES.String) { }, /** - See [String.dasherize](/api/ember/release/classes/String/methods/dasherize?anchor=dasherize). + See [String.dasherize](/ember/release/classes/String/methods/dasherize?anchor=dasherize). @method dasherize @for @ember/string @@ -383,7 +383,7 @@ if (ENV.EXTEND_PROTOTYPES.String) { }, /** - See [String.classify](/api/ember/release/classes/String/methods/classify?anchor=classify). + See [String.classify](/ember/release/classes/String/methods/classify?anchor=classify). @method classify @for @ember/string @@ -400,7 +400,7 @@ if (ENV.EXTEND_PROTOTYPES.String) { }, /** - See [String.capitalize](/api/ember/release/classes/String/methods/capitalize?anchor=capitalize). + See [String.capitalize](/ember/release/classes/String/methods/capitalize?anchor=capitalize). @method capitalize @for @ember/string
true
Other
emberjs
ember.js
d418c4f69ccb53dcb924f49c5b29fc26e637431e.json
update license to 2019
LICENSE
@@ -1,4 +1,4 @@ -Copyright (c) 2018 Yehuda Katz, Tom Dale and Ember.js contributors +Copyright (c) 2019 Yehuda Katz, Tom Dale and Ember.js contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in
true
Other
emberjs
ember.js
d418c4f69ccb53dcb924f49c5b29fc26e637431e.json
update license to 2019
generators/license.js
@@ -1,6 +1,6 @@ /*! * @overview Ember - JavaScript Application Framework - * @copyright Copyright 2011-2018 Tilde Inc. and contributors + * @copyright Copyright 2011-2019 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license
true
Other
emberjs
ember.js
5d3da3d783a66ffd533058ba5303d54d469776d5.json
improve tests scenarios on link-to
packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-curly-test.js
@@ -41,6 +41,21 @@ moduleFor( }); } + ['@test populates href with fully supplied query param values, but without @route param']() { + this.addTemplate( + 'index', + `{{#link-to (query-params foo='2' bar='NAW')}}QueryParams{{/link-to}}` + ); + + return this.visit('/').then(() => { + this.assertComponentElement(this.firstChild, { + tagName: 'a', + attrs: { href: '/?bar=NAW&foo=2' }, + content: 'QueryParams', + }); + }); + } + ['@test populates href with partially supplied query param values, but omits if value is default value']() { this.addTemplate('index', `{{#link-to 'index' (query-params foo='123')}}Index{{/link-to}}`); @@ -748,6 +763,50 @@ moduleFor( }); } + ['@test the {{link-to}} does not throw an error if called without a @route argument, but with a @query argument']( + assert + ) { + this.addTemplate( + 'index', + ` + {{#link-to (query-params page=pageNumber) id='page-link'}} + Index + {{/link-to}} + ` + ); + + this.add( + 'route:index', + Route.extend({ + model() { + return [ + { id: 'yehuda', name: 'Yehuda Katz' }, + { id: 'tom', name: 'Tom Dale' }, + { id: 'erik', name: 'Erik Brynroflsson' }, + ]; + }, + }) + ); + + this.add( + 'controller:index', + Controller.extend({ + queryParams: ['page'], + page: 1, + pageNumber: 5, + }) + ); + + return this.visit('/') + .then(() => { + this.shouldNotBeActive(assert, '#page-link'); + return this.visit('/?page=5'); + }) + .then(() => { + this.shouldBeActive(assert, '#page-link'); + }); + } + ['@test [GH#17869] it does not cause shadowing assertion with `hash` local variable']() { this.router.map(function() { this.route('post', { path: '/post/:id' });
false
Other
emberjs
ember.js
106bb03e87f982657edd4595652579bfeae3f06a.json
Bring release branch change to master (#18027) Bring release branch change to master Co-authored-by: Lukas Kohler <[email protected]>
packages/@ember/-internals/routing/lib/services/router.ts
@@ -46,7 +46,7 @@ function cleanURL(url: string, rootURL: string) { actions: { next() { - this.get('router').transitionTo('other.route'); + this.router.transitionTo('other.route'); } } });
false
Other
emberjs
ember.js
3ef8521abb10cab42587d8bf058bd3035acb7228.json
Add v3.11.0-beta.1 to CHANGELOG [ci skip] (cherry picked from commit 1bf5cec780787406b10fd201c2dddb9cdbff8d6d)
CHANGELOG.md
@@ -1,5 +1,18 @@ # Ember Changelog +### v3.11.0-beta.1 (May 13, 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). +- [#17941](https://github.com/emberjs/ember.js/pull/17941) / [#17961](https://github.com/emberjs/ember.js/pull/17961) [FEATURE] Implement the [{{fn}} rfc](https://github.com/emberjs/rfcs/blob/master/text/0470-fn-helper.md). +- [#17960](https://github.com/emberjs/ember.js/pull/17960) [FEATURE] Implement the [{{on}} modifier RFC](https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md) +- [#17858](https://github.com/emberjs/ember.js/pull/17858) [FEATURE] Implement the [Inject Parameter Normalization RFC](https://github.com/emberjs/rfcs/blob/master/text/0451-injection-parameter-normalization.md). +- [#17910](https://github.com/emberjs/ember.js/pull/17910) [DEPRECATION] Add deprecation for Function.prototype extensions. +- [#17845](https://github.com/emberjs/ember.js/pull/17845) [CLEANUP] Removes various deprecated APIs +- [#17843](https://github.com/emberjs/ember.js/pull/17843) [CLEANUP] Remove deprecated intimate apis in the router +- [#17940](https://github.com/emberjs/ember.js/pull/17940) [CLEANUP] Remove `sync` queue from @ember/runloop. +- [#18026](https://github.com/emberjs/ember.js/pull/18026) Enabling featured discussed in 2019-05-03 core team meeting. + + ### v3.10.0 (May 13, 2019) - [#17836](https://github.com/emberjs/ember.js/pull/17836) [BREAKING] Explicitly drop support for Node 6
false
Other
emberjs
ember.js
24e4292d0720bdad45c84b5cb30f0e7ea6d391cd.json
Add v3.10.0 to CHANGELOG [ci skip] (cherry picked from commit 358a4c7a3fb1d76b6871a54295f363294bbc4a65)
CHANGELOG.md
@@ -1,54 +1,37 @@ # Ember Changelog -### v3.10.0-beta.5 (April 29, 2019) +### v3.10.0 (May 13, 2019) +- [#17836](https://github.com/emberjs/ember.js/pull/17836) [BREAKING] Explicitly drop support for Node 6 +- [#17719](https://github.com/emberjs/ember.js/pull/17719) / [#17745](https://github.com/emberjs/ember.js/pull/17745) [FEATURE] Support for nested components in angle bracket invocation syntax (see [emberjs/rfcs#0457](https://github.com/emberjs/rfcs/blob/master/text/0457-nested-lookups.md)). +- [#17735](https://github.com/emberjs/ember.js/pull/17735) / [#17772](https://github.com/emberjs/ember.js/pull/17772) / [#17811](https://github.com/emberjs/ember.js/pull/17811) / [#17814](https://github.com/emberjs/ember.js/pull/17814) [FEATURE] Implement the Angle Bracket Invocations For Built-in Components RFC (see [emberjs/rfcs#0459](https://github.com/emberjs/rfcs/blob/master/text/0459-angle-bracket-built-in-components.md)). +- [#17548](https://github.com/emberjs/ember.js/pull/17548) / [#17604](https://github.com/emberjs/ember.js/pull/17604) / [#17690](https://github.com/emberjs/ember.js/pull/17690) / [#17827](https://github.com/emberjs/ember.js/pull/17827) / [#17828](https://github.com/emberjs/ember.js/pull/17828) [FEATURE] Implement the Decorators RFC (see [emberjs/rfcs#0408](https://github.com/emberjs/rfcs/blob/master/text/0408-decorators.md)). +- [#17256](https://github.com/emberjs/ember.js/pull/17256) / [#17664](https://github.com/emberjs/ember.js/pull/17664) [FEATURE] Implement RouteInfo Metadata RFC (see [emberjs/rfcs#0398](https://github.com/emberjs/rfcs/blob/master/text/0398-RouteInfo-Metadata.md)). - [#17938](https://github.com/emberjs/ember.js/pull/17938) [BUGFIX] Expose mechanism to detect if a property is a computed - [#17974](https://github.com/emberjs/ember.js/pull/17974) [BUGFIX] Ensure inheritable observers on object proxies are string based - -### v3.10.0-beta.4 (April 22, 2019) - - [#17930](https://github.com/emberjs/ember.js/pull/17930) [BUGFIX] Update assertion for events in tagless component to include method names - -### v3.10.0-beta.3 (April 15, 2019) - - [#17859](https://github.com/emberjs/ember.js/pull/17859) [BUGFIX] Fixes a regression in the legacy build - [#17891](https://github.com/emberjs/ember.js/pull/17891) [BUGFIX] Loosen "engines" restriction for Node versions - [#17900](https://github.com/emberjs/ember.js/pull/17900) [BUGFIX] Fix version for APP_CTRL_ROUTER_PROPS deprecation flag - -### v3.9.1 (April 09, 2019) - -- [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes, depending on its position. -- [#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.10.0-beta.2 (April 08, 2019) - - [#17846](https://github.com/emberjs/ember.js/pull/17846) [BUGFIX] Fix issues with template-only components causing errors in subsequent updates. -- [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes unexpectedly, depending on its position. - [#17872](https://github.com/emberjs/ember.js/pull/17872) [BUGFIX] Fix issue where `{{link-to}}` is causing unexpected local variable shadowing assertions. -- [#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. - [#17841](https://github.com/emberjs/ember.js/pull/17841) [BUGFIX] Ensure `@sort` works on non-`Ember.Object`s. - [#17855](https://github.com/emberjs/ember.js/pull/17855) [BUGFIX] Expose (private) computed `_getter` functions. - [#17860](https://github.com/emberjs/ember.js/pull/17860) [BUGFIX] Add assertions for required parameters in computed macros, when used as a decorator. - [#17868](https://github.com/emberjs/ember.js/pull/17868) [BUGFIX] Fix controller injection via decorators. - -### v3.10.0-beta.1 (April 02, 2019) - -- [#17836](https://github.com/emberjs/ember.js/pull/17836) [BREAKING] Explicitly drop support for Node 6 -- [#17719](https://github.com/emberjs/ember.js/pull/17719) / [#17745](https://github.com/emberjs/ember.js/pull/17745) [FEATURE] Support for nested components in angle bracket invocation syntax (see [emberjs/rfcs#0457](https://github.com/emberjs/rfcs/blob/master/text/0457-nested-lookups.md)). -- [#17735](https://github.com/emberjs/ember.js/pull/17735) / [#17772](https://github.com/emberjs/ember.js/pull/17772) / [#17811](https://github.com/emberjs/ember.js/pull/17811) / [#17814](https://github.com/emberjs/ember.js/pull/17814) [FEATURE] Implement the Angle Bracket Invocations For Built-in Components RFC (see [emberjs/rfcs#0459](https://github.com/emberjs/rfcs/blob/master/text/0459-angle-bracket-built-in-components.md)). -- [#17548](https://github.com/emberjs/ember.js/pull/17548) / [#17604](https://github.com/emberjs/ember.js/pull/17604) / [#17690](https://github.com/emberjs/ember.js/pull/17690) / [#17827](https://github.com/emberjs/ember.js/pull/17827) / [#17828](https://github.com/emberjs/ember.js/pull/17828) [FEATURE] Implement the Decorators RFC (see [emberjs/rfcs#0408](https://github.com/emberjs/rfcs/blob/master/text/0408-decorators.md)). -- [#17256](https://github.com/emberjs/ember.js/pull/17256) / [#17664](https://github.com/emberjs/ember.js/pull/17664) [FEATURE] Implement RouteInfo Metadata RFC (see [emberjs/rfcs#0398](https://github.com/emberjs/rfcs/blob/master/text/0398-RouteInfo-Metadata.md)). - [#17747](https://github.com/emberjs/ember.js/pull/17747) [BUGFIX] Correct component-test blueprint for ember-cli-mocha - [#17788](https://github.com/emberjs/ember.js/pull/17788) [BUGFIX] Fix native DOM events in Glimmer Angle Brackets - [#17833](https://github.com/emberjs/ember.js/pull/17833) [BUGFIX] Reverts the naming of setClassicDecorator externally -- [#17841](https://github.com/emberjs/ember.js/pull/17841) [BUGFIX] Ensure @sort works on non-Ember.Objects. -- [#17818](https://github.com/emberjs/ember.js/pull/17818) [BUGFIX] Fix event dispatcher to not rely on `elementId`. - [#17818](https://github.com/emberjs/ember.js/pull/17818) [BUGFIX] Fix event dispatcher to not rely on `elementId`. +- [#17740](https://github.com/emberjs/ember.js/pull/17740) [BUGFIX] Fix octane component blueprint and octane blueprint tests - [#17411](https://github.com/emberjs/ember.js/pull/17411) / [#17732](https://github.com/emberjs/ember.js/pull/17732) / [#17412](https://github.com/emberjs/ember.js/pull/17412) Update initializer blueprints for ember-mocha 0.14 - [#17702](https://github.com/emberjs/ember.js/pull/17702) Extend from glimmer component for octane blueprint -- [#17740](https://github.com/emberjs/ember.js/pull/17740) Fix octane component blueprint and octane blueprint tests + +### v3.9.1 (April 09, 2019) + +- [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes, depending on its position. +- [#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.1 (April 02, 2019)
false
Other
emberjs
ember.js
847877e737a328ae45e731b03dccf33bc0b58471.json
Add DISABLE_MINIFICATION environment variable. (#18005) Add DISABLE_MINIFICATION environment variable.
ember-cli-build.js
@@ -278,7 +278,7 @@ function buildBundles(packagesES, dependenciesES, templateCompilerDependenciesES return new MergeTrees( [ emberProdBundle, - emberMinBundle, + process.env.DISABLE_MINIFICATION !== '1' && emberMinBundle, emberProdTestsBundle, buildBundle('ember.debug.js', emberDebugFiles, vendor), buildBundle('ember-tests.js', emberTestsFiles, vendor),
false
Other
emberjs
ember.js
57da44f58a519f4eb7493610065ddbc17d944c13.json
Add DISABLE_MINIFICATION environment variable. This makes testing production (but not minified) builds a bit faster.
ember-cli-build.js
@@ -278,7 +278,7 @@ function buildBundles(packagesES, dependenciesES, templateCompilerDependenciesES return new MergeTrees( [ emberProdBundle, - emberMinBundle, + process.env.DISABLE_MINIFICATION !== '1' && emberMinBundle, emberProdTestsBundle, buildBundle('ember.debug.js', emberDebugFiles, vendor), buildBundle('ember-tests.js', emberTestsFiles, vendor),
false
Other
emberjs
ember.js
574dccda8ba30dc3dac8701ccce0f831690aad0a.json
fix position of @module doc for Engine
packages/@ember/engine/index.js
@@ -1,7 +1,3 @@ -/** -@module @ember/engine -*/ - export { getEngineParent, setEngineParent } from './lib/engine-parent'; import { canInvoke } from '@ember/-internals/utils'; @@ -28,6 +24,10 @@ function props(obj) { return properties; } +/** +@module @ember/engine +*/ + /** The `Engine` class contains core functionality for both applications and engines.
false
Other
emberjs
ember.js
642702dd726420f3cb5a8f4622662aac4df15e1c.json
Add v3.10.0-beta.5 to CHANGELOG [ci skip] (cherry picked from commit 53f84b111eea80da33eefb7f9e87da1a563e8d02)
CHANGELOG.md
@@ -1,5 +1,10 @@ # Ember Changelog +### v3.10.0-beta.5 (April 29, 2019) + +- [#17938](https://github.com/emberjs/ember.js/pull/17938) [BUGFIX] Expose mechanism to detect if a property is a computed +- [#17974](https://github.com/emberjs/ember.js/pull/17974) [BUGFIX] Ensure inheritable observers on object proxies are string based + ### v3.10.0-beta.4 (April 22, 2019) - [#17930](https://github.com/emberjs/ember.js/pull/17930) [BUGFIX] Update assertion for events in tagless component to include method names
false
Other
emberjs
ember.js
663d2098f8c50b5cb056735b0e185078243538f9.json
Add documentation for `fn`.
packages/@ember/-internals/glimmer/lib/helpers/fn.ts
@@ -7,6 +7,79 @@ import { InternalHelperReference, INVOKE } from '../utils/references'; import buildUntouchableThis from '../utils/untouchable-this'; const context = buildUntouchableThis('`fn` helper'); + +/** +@module ember +*/ + +/** + The `fn` helper allows you to ensure a function that you are passing off + to another component, helper, or modifier has access to arguments that are + available in the template. + + For example, if you have an `each` helper looping over a number of items, you + may need to pass a function that expects to receive the item as an argument + to a component invoked within the loop. Here's how you could use the `fn` + helper to pass both the function and its arguments together: + + ```app/templates/components/items-listing.hbs + {{#each @items as |item|}} + <DisplayItem @item=item @select={{fn this.handleSelected item}} /> + {{/each}} + ``` + + ```app/components/items-list.js + import Component from '@glimmer/component'; + import { action } from '@ember/object'; + + export default class ItemsList extends Component { + @action + handleSelected(item) { + // ...snip... + } + } + ``` + + In this case the `display-item` component will receive a normal function + that it can invoke. When it invokes the function, the `handleSelected` + function will receive the `item` and any arguments passed, thanks to the + `fn` helper. + + Let's take look at what that means in a couple circumstances: + + - When invoked as `this.args.select()` the `handleSelected` function will + receive the `item` from the loop as its first and only argument. + - When invoked as `this.args.selected('foo')` the `handleSelected` function + will receive the `item` from the loop as its first argument and the + string `'foo'` as its second argument. + + In the example above, we used `@action` to ensure that `handleSelected` is + properly bound to the `items-list`, but let's explore what happens if we + left out `@action`: + + ```app/components/items-list.js + import Component from '@glimmer/component'; + + export default class ItemsList extends Component { + handleSelected(item) { + // ...snip... + } + } + ``` + + In this example, when `handleSelected` is invoked inside the `display-item` + component, it will **not** have access to the component instance. In other + words, it will have no `this` context, so please make sure your functions + are bound (via `@action` or other means) before passing into `fn`! + + See also [partial application](https://en.wikipedia.org/wiki/Partial_application). + + @method fn + @for Ember.Templates.helpers + @public + @since 3.11.0 +*/ + function fnHelper({ positional }: ICapturedArguments) { let callbackRef = positional.at(0);
true
Other
emberjs
ember.js
663d2098f8c50b5cb056735b0e185078243538f9.json
Add documentation for `fn`.
packages/@ember/-internals/glimmer/lib/helpers/get.ts
@@ -40,16 +40,16 @@ import { CachedReference, referenceFromParts, UPDATE } from '../utils/references ```handlebars {{get person factName}} - <button {{action (action (mut factName)) "height"}}>Show height</button> - <button {{action (action (mut factName)) "weight"}}>Show weight</button> + <button {{action (fn (mut factName)) "height"}}>Show height</button> + <button {{action (fn (mut factName)) "weight"}}>Show weight</button> ``` The `{{get}}` helper can also respect mutable values itself. For example: ```handlebars {{input value=(mut (get person factName)) type="text"}} - <button {{action (action (mut factName)) "height"}}>Show height</button> - <button {{action (action (mut factName)) "weight"}}>Show weight</button> + <button {{action (fn (mut factName)) "height"}}>Show height</button> + <button {{action (fn (mut factName)) "weight"}}>Show weight</button> ``` Would allow the user to swap what fact is being displayed, and also edit
true
Other
emberjs
ember.js
663d2098f8c50b5cb056735b0e185078243538f9.json
Add documentation for `fn`.
packages/@ember/-internals/glimmer/lib/helpers/mut.ts
@@ -13,7 +13,7 @@ import { INVOKE, UPDATE } from '../utils/references'; To specify that a parameter is mutable, when invoking the child `Component`: ```handlebars - <MyChild @childClickCount={{action (mut totalClicks)}} /> + <MyChild @childClickCount={{fn (mut totalClicks)}} /> ``` or @@ -37,20 +37,20 @@ import { INVOKE, UPDATE } from '../utils/references'; Note that for curly components (`{{my-component}}`) the bindings are already mutable, making the `mut` unnecessary. - Additionally, the `mut` helper can be combined with the `action` helper to + Additionally, the `mut` helper can be combined with the `fn` helper to mutate a value. For example: ```handlebars - <MyChild @childClickCount={{this.totalClicks}} @click-count-change={{action (mut totalClicks))}} /> + <MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} /> ``` or ```handlebars - {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} + {{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}} ``` - The child `Component` would invoke the action with the new click value: + The child `Component` would invoke the function with the new click value: ```javascript // my-child.js @@ -61,25 +61,23 @@ import { INVOKE, UPDATE } from '../utils/references'; }); ``` - The `mut` helper changes the `totalClicks` value to what was provided as the action argument. + The `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument. - The `mut` helper, when used with `action`, will return a function that - sets the value passed to `mut` to its first argument. This works like any other - closure action and interacts with the other features `action` provides. - As an example, we can create a button that increments a value passing the value - directly to the `action`: + The `mut` helper, when used with `fn`, will return a function that + sets the value passed to `mut` to its first argument. As an example, we can create a + button that increments a value passing the value directly to the `fn`: ```handlebars {{! inc helper is not provided by Ember }} - <button onclick={{action (mut count) (inc count)}}> + <button onclick={{fn (mut count) (inc count)}}> Increment count </button> ``` You can also use the `value` option: ```handlebars - <input value={{name}} oninput={{action (mut name) value="target.value"}}> + <input value={{name}} oninput={{fn (mut name) value="target.value"}}> ``` @method mut
true
Other
emberjs
ember.js
663d2098f8c50b5cb056735b0e185078243538f9.json
Add documentation for `fn`.
tests/docs/expected.js
@@ -217,6 +217,7 @@ module.exports = { 'findModel', 'findWithAssert', 'firstObject', + 'fn', 'focusIn', 'focusOut', 'followRedirects',
true
Other
emberjs
ember.js
33fdfdc02c8adf9eaace5ac223b2ed2d072984bb.json
Fix import ordering lint
packages/@ember/-internals/glimmer/lib/helpers/fn.ts
@@ -3,8 +3,8 @@ import { assert } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; import { Arguments, VM } from '@glimmer/runtime'; import { ICapturedArguments } from '@glimmer/runtime/dist/types/lib/vm/arguments'; -import { InternalHelperReference } from '../utils/references'; import { Opaque } from '@glimmer/util'; +import { InternalHelperReference } from '../utils/references'; let context: any = null; if (DEBUG && HAS_NATIVE_PROXY) {
false
Other
emberjs
ember.js
495c93178a08c5a800ef9b254349810a560b7c1c.json
add promise polyfill
broccoli/test-polyfills.js
@@ -7,8 +7,9 @@ module.exports = function polyfills() { let polyfillEntry = writeFile( 'polyfill-entry.js', ` + require('core-js/modules/es6.promise'); require('core-js/modules/es6.symbol'); - require('regenerator-runtime/runtime') + require('regenerator-runtime/runtime'); ` );
true
Other
emberjs
ember.js
495c93178a08c5a800ef9b254349810a560b7c1c.json
add promise polyfill
packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-curly-test.js
@@ -1,6 +1,7 @@ import Controller from '@ember/controller'; import { RSVP } from '@ember/-internals/runtime'; import { Route } from '@ember/-internals/routing'; +import { DEBUG } from '@glimmer/env'; import { ApplicationTestCase, classes as classMatcher, @@ -59,8 +60,12 @@ moduleFor( `{{#let (query-params foo='456' bar='NAW') as |qp|}}{{link-to 'Index' 'index' qp}}{{/let}}` ); + // TODO If we visit this page at all in production mode, it'll fail for + // entirely different reasons than what this test is trying to test. + let promise = DEBUG ? this.visit('/') : null; + await assert.rejectsAssertion( - this.visit('/'), + promise, /The `\(query-params\)` helper can only be used when invoking the `{{link-to}}` component\./ ); }
true
Other
emberjs
ember.js
495c93178a08c5a800ef9b254349810a560b7c1c.json
add promise polyfill
packages/ember/tests/routing/decoupled_basic_test.js
@@ -844,9 +844,11 @@ moduleFor( }) ); - this.handleURLRejectsWith(this, assert, '/specials/1', 'Setup error'); + let promise = this.handleURLRejectsWith(this, assert, '/specials/1', 'Setup error'); resolve(menuItem); + + return promise; } ['@test Moving from one page to another triggers the correct callbacks'](assert) {
true
Other
emberjs
ember.js
495c93178a08c5a800ef9b254349810a560b7c1c.json
add promise polyfill
packages/ember/tests/routing/query_params_test.js
@@ -312,8 +312,6 @@ moduleFor( } async ['@test error is thrown if dynamic segment and query param have same name'](assert) { - assert.expect(1); - this.router.map(function() { this.route('index', { path: '/:foo' }); });
true
Other
emberjs
ember.js
ed4fb96f14e8acc360c253e8bdad8ce72b443807.json
Add v3.10.0-beta.4 to CHANGELOG [ci skip] (cherry picked from commit 44de6b6db263c55d8a6ea5997d7b0cdb10562002)
CHANGELOG.md
@@ -1,5 +1,9 @@ # Ember Changelog +### v3.10.0-beta.4 (April 22, 2019) + +- [#17930](https://github.com/emberjs/ember.js/pull/17930) [BUGFIX] Update assertion for events in tagless component to include method names + ### v3.10.0-beta.3 (April 15, 2019) - [#17859](https://github.com/emberjs/ember.js/pull/17859) [BUGFIX] Fixes a regression in the legacy build
false
Other
emberjs
ember.js
0f6afed29de363bfe755dd229e6ce43d7aed1051.json
add unstable args test
packages/@ember/-internals/glimmer/tests/integration/components/tracked-test.js
@@ -1,5 +1,9 @@ -import { EMBER_METAL_TRACKED_PROPERTIES } from '@ember/canary-features'; import { Object as EmberObject, A } from '@ember/-internals/runtime'; +import { + EMBER_CUSTOM_COMPONENT_ARG_PROXY, + EMBER_METAL_TRACKED_PROPERTIES, +} from '@ember/canary-features'; +import { Object as EmberObject } from '@ember/-internals/runtime'; import { tracked, nativeDescDecorator as descriptor } from '@ember/-internals/metal'; import { moduleFor, RenderingTestCase, strip, runTask } from 'internal-test-helpers'; import GlimmerishComponent from '../../utils/glimmerish-component'; @@ -373,4 +377,79 @@ if (EMBER_METAL_TRACKED_PROPERTIES) { } } ); + + if (EMBER_CUSTOM_COMPONENT_ARG_PROXY) { + moduleFor( + 'Component Tracked Properties w/ Args Proxy', + class extends RenderingTestCase { + '@test downstream property changes do not invalidate upstream component getters/arguments'( + assert + ) { + let outerRenderCount = 0; + let innerRenderCount = 0; + + class OuterComponent extends GlimmerishComponent { + get count() { + outerRenderCount++; + return this.args.count; + } + } + + class InnerComponent extends GlimmerishComponent { + @tracked count = 0; + + get combinedCounts() { + innerRenderCount++; + return this.args.count + this.count; + } + + updateInnerCount() { + this.count++; + } + } + + this.registerComponent('outer', { + ComponentClass: OuterComponent, + template: '<Inner @count={{this.count}}/>', + }); + + this.registerComponent('inner', { + ComponentClass: InnerComponent, + template: '<button {{action this.updateInnerCount}}>{{this.combinedCounts}}</button>', + }); + + this.render('<Outer @count={{this.count}}/>', { + count: 0, + }); + + this.assertText('0'); + + assert.equal(outerRenderCount, 1); + assert.equal(innerRenderCount, 1); + + runTask(() => this.$('button').click()); + + this.assertText('1'); + + assert.equal( + outerRenderCount, + 1, + 'updating inner component does not cause outer component to rerender' + ); + assert.equal( + innerRenderCount, + 2, + 'updating inner component causes inner component to rerender' + ); + + runTask(() => this.context.set('count', 1)); + + this.assertText('2'); + + assert.equal(outerRenderCount, 2, 'outer component updates based on context'); + assert.equal(innerRenderCount, 3, 'inner component updates based on outer component'); + } + } + ); + } }
false
Other
emberjs
ember.js
e29a526b3c3a785b2830df2b55679667e9f0f24e.json
remove function export from helper blueprint
blueprints/helper/files/__root__/__collection__/__name__.js
@@ -1,7 +1,5 @@ import { helper } from '@ember/component/helper'; -export function <%= camelizedModuleName %>(params/*, hash*/) { +export default helper(function <%= camelizedModuleName %>(params/*, hash*/) { return params; -} - -export default helper(<%= camelizedModuleName %>); +});
true
Other
emberjs
ember.js
e29a526b3c3a785b2830df2b55679667e9f0f24e.json
remove function export from helper blueprint
node-tests/fixtures/helper/helper.js
@@ -1,7 +1,5 @@ import { helper } from '@ember/component/helper'; -export function fooBarBaz(params/*, hash*/) { +export default helper(function fooBarBaz(params/*, hash*/) { return params; -} - -export default helper(fooBarBaz); +});
true
Other
emberjs
ember.js
9c485789e408dffbc6f1d94b0defdaffc4e168e0.json
Add v3.10.0-beta.3 to CHANGELOG [ci skip] (cherry picked from commit 13b1d2573842f78f81fffd87e7b33ed0ce6bf81e)
CHANGELOG.md
@@ -1,5 +1,11 @@ # Ember Changelog +### v3.10.0-beta.3 (April 15, 2019) + +- [#17859](https://github.com/emberjs/ember.js/pull/17859) [BUGFIX] Fixes a regression in the legacy build +- [#17891](https://github.com/emberjs/ember.js/pull/17891) [BUGFIX] Loosen "engines" restriction for Node versions +- [#17900](https://github.com/emberjs/ember.js/pull/17900) [BUGFIX] Fix version for APP_CTRL_ROUTER_PROPS deprecation flag + ### v3.9.1 (April 09, 2019) - [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes, depending on its position.
false
Other
emberjs
ember.js
28ba80081c6101c5274dd6eac39ebcfafc577fce.json
Remove odd concatenation in FactoryManager#create.
packages/@ember/-internals/container/lib/container.ts
@@ -597,7 +597,7 @@ class FactoryManager<T, C> { throw new Error( `Failed to create an instance of '${ this.normalizedName - }'. Most likely an improperly defined class or` + ` an invalid module export.` + }'. Most likely an improperly defined class or an invalid module export.` ); }
false
Other
emberjs
ember.js
c73fa31d138fb8a628db04b877a09206d60afb7c.json
Add v3.10.0-beta.2 to CHANGELOG [ci skip] (cherry picked from commit 000e0da204ef57c864e0152872e60b5efd5267bf)
CHANGELOG.md
@@ -1,6 +1,6 @@ # Ember Changelog -### v3.10.0-beta.2 (UNRELEASED) +### v3.10.0-beta.2 (April 08, 2019) - [#17846](https://github.com/emberjs/ember.js/pull/17846) [BUGFIX] Fix issues with template-only components causing errors in subsequent updates. - [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes unexpectedly, depending on its position.
false
Other
emberjs
ember.js
b04e000d4be12f5ae36f36e9938e611fbe8b3992.json
Update CHANGELOG [ci skip] (cherry picked from commit e3341624dd3cecc0957511f32a0d77df12154195)
CHANGELOG.md
@@ -7,6 +7,10 @@ - [#17872](https://github.com/emberjs/ember.js/pull/17872) [BUGFIX] Fix issue where `{{link-to}}` is causing unexpected local variable shadowing assertions. - [#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. +- [#17841](https://github.com/emberjs/ember.js/pull/17841) [BUGFIX] Ensure `@sort` works on non-`Ember.Object`s. +- [#17855](https://github.com/emberjs/ember.js/pull/17855) [BUGFIX] Expose (private) computed `_getter` functions. +- [#17860](https://github.com/emberjs/ember.js/pull/17860) [BUGFIX] Add assertions for required parameters in computed macros, when used as a decorator. +- [#17868](https://github.com/emberjs/ember.js/pull/17868) [BUGFIX] Fix controller injection via decorators. ### v3.10.0-beta.1 (April 02, 2019)
false
Other
emberjs
ember.js
7905f2131547d3e3ab6eb97e4cb96411483f3c16.json
Update CHANGELOG [ci skip] (cherry picked from commit 0c2a780fe2255adee32105aa0e3b3c56965bcf02)
CHANGELOG.md
@@ -5,6 +5,8 @@ - [#17846](https://github.com/emberjs/ember.js/pull/17846) [BUGFIX] Fix issues with template-only components causing errors in subsequent updates. - [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes unexpectedly, depending on its position. - [#17872](https://github.com/emberjs/ember.js/pull/17872) [BUGFIX] Fix issue where `{{link-to}}` is causing unexpected local variable shadowing assertions. +- [#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.10.0-beta.1 (April 02, 2019)
false
Other
emberjs
ember.js
7da998b3c28c4cd67c65814c0718dac52252cae0.json
update CHANGELOG [ci skip] (cherry picked from commit de969e4b93b9934875e95fefa852dd3d5cedaafd)
CHANGELOG.md
@@ -4,6 +4,7 @@ - [#17846](https://github.com/emberjs/ember.js/pull/17846) [BUGFIX] Fix issues with template-only components causing errors in subsequent updates. - [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes unexpectedly, depending on its position. +- [#17872](https://github.com/emberjs/ember.js/pull/17872) [BUGFIX] Fix issue where `{{link-to}}` is causing unexpected local variable shadowing assertions. ### v3.10.0-beta.1 (April 02, 2019)
false
Other
emberjs
ember.js
5f8d39c7b3a1acb5842117b24806030b981442f3.json
Update CHANGELOG [ci skip] (cherry picked from commit 8d197594e6d19f802293037b59a0c9ee376004c7)
CHANGELOG.md
@@ -3,6 +3,7 @@ ### v3.10.0-beta.2 (UNRELEASED) - [#17846](https://github.com/emberjs/ember.js/pull/17846) [BUGFIX] Fix issues with template-only components causing errors in subsequent updates. +- [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes unexpectedly, depending on its position. ### v3.10.0-beta.1 (April 02, 2019)
false
Other
emberjs
ember.js
d5b9345a01f94f80953088c56d2e64058784afe9.json
Update CHANGELOG [ci skip] (cherry picked from commit 8e169048ff0b435423b4e0357a6cd78acbfceec9)
CHANGELOG.md
@@ -1,17 +1,22 @@ # Ember Changelog +### v3.10.0-beta.2 (UNRELEASED) + +- [#17846](https://github.com/emberjs/ember.js/pull/17846) [BUGFIX] Fix issues with template-only components causing errors in subsequent updates. + ### v3.10.0-beta.1 (April 02, 2019) - [#17836](https://github.com/emberjs/ember.js/pull/17836) [BREAKING] Explicitly drop support for Node 6 -- [#17719](https://github.com/emberjs/ember.js/pull/17719) / [#17745](https://github.com/emberjs/ember.js/pull/17745) [FEATURE] Support for nested components in angle bracket invocation syntax (see [emberjs/rfcs#0457](https://github.com/emberjs/rfcs/blob/master/text/0457-nested-lookups.md)). +- [#17719](https://github.com/emberjs/ember.js/pull/17719) / [#17745](https://github.com/emberjs/ember.js/pull/17745) [FEATURE] Support for nested components in angle bracket invocation syntax (see [emberjs/rfcs#0457](https://github.com/emberjs/rfcs/blob/master/text/0457-nested-lookups.md)). - [#17735](https://github.com/emberjs/ember.js/pull/17735) / [#17772](https://github.com/emberjs/ember.js/pull/17772) / [#17811](https://github.com/emberjs/ember.js/pull/17811) / [#17814](https://github.com/emberjs/ember.js/pull/17814) [FEATURE] Implement the Angle Bracket Invocations For Built-in Components RFC (see [emberjs/rfcs#0459](https://github.com/emberjs/rfcs/blob/master/text/0459-angle-bracket-built-in-components.md)). - [#17548](https://github.com/emberjs/ember.js/pull/17548) / [#17604](https://github.com/emberjs/ember.js/pull/17604) / [#17690](https://github.com/emberjs/ember.js/pull/17690) / [#17827](https://github.com/emberjs/ember.js/pull/17827) / [#17828](https://github.com/emberjs/ember.js/pull/17828) [FEATURE] Implement the Decorators RFC (see [emberjs/rfcs#0408](https://github.com/emberjs/rfcs/blob/master/text/0408-decorators.md)). - [#17256](https://github.com/emberjs/ember.js/pull/17256) / [#17664](https://github.com/emberjs/ember.js/pull/17664) [FEATURE] Implement RouteInfo Metadata RFC (see [emberjs/rfcs#0398](https://github.com/emberjs/rfcs/blob/master/text/0398-RouteInfo-Metadata.md)). - [#17747](https://github.com/emberjs/ember.js/pull/17747) [BUGFIX] Correct component-test blueprint for ember-cli-mocha - [#17788](https://github.com/emberjs/ember.js/pull/17788) [BUGFIX] Fix native DOM events in Glimmer Angle Brackets - [#17833](https://github.com/emberjs/ember.js/pull/17833) [BUGFIX] Reverts the naming of setClassicDecorator externally - [#17841](https://github.com/emberjs/ember.js/pull/17841) [BUGFIX] Ensure @sort works on non-Ember.Objects. -- [#17818](https://github.com/emberjs/ember.js/pull/17818) [BUGFIX] Fix event dispatcher (part 1) +- [#17818](https://github.com/emberjs/ember.js/pull/17818) [BUGFIX] Fix event dispatcher to not rely on `elementId`. +- [#17818](https://github.com/emberjs/ember.js/pull/17818) [BUGFIX] Fix event dispatcher to not rely on `elementId`. - [#17411](https://github.com/emberjs/ember.js/pull/17411) / [#17732](https://github.com/emberjs/ember.js/pull/17732) / [#17412](https://github.com/emberjs/ember.js/pull/17412) Update initializer blueprints for ember-mocha 0.14 - [#17702](https://github.com/emberjs/ember.js/pull/17702) Extend from glimmer component for octane blueprint - [#17740](https://github.com/emberjs/ember.js/pull/17740) Fix octane component blueprint and octane blueprint tests @@ -26,7 +31,7 @@ - [#17470](https://github.com/emberjs/ember.js/pull/17470) [DEPRECATION] Implements the Computed Property Modifier deprecation RFCs * Deprecates `.property()` (see [emberjs/rfcs#0375](https://github.com/emberjs/rfcs/blob/master/text/0375-deprecate-computed-property-modifier.md) * Deprecates `.volatile()` (see [emberjs/rfcs#0370](https://github.com/emberjs/rfcs/blob/master/text/0370-deprecate-computed-volatile.md) - * Deprecates computed overridability (see [emberjs/rfcs#0369](https://github.com/emberjs/rfcs/blob/master/text/0369-deprecate-computed-clobberability.md) + * Deprecates computed overridability (see [emberjs/rfcs#0369](https://github.com/emberjs/rfcs/blob/master/text/0369-deprecate-computed-clobberability.md) - [#17488](https://github.com/emberjs/ember.js/pull/17488) [DEPRECATION] Deprecate this.$() in curly components (see [emberjs/rfcs#0386](https://github.com/emberjs/rfcs/blob/master/text/0386-remove-jquery.md)) - [#17489](https://github.com/emberjs/ember.js/pull/17489) [DEPRECATION] Deprecate Ember.$() (see [emberjs/rfcs#0386](https://github.com/emberjs/rfcs/blob/master/text/0386-remove-jquery.md)) - [#17540](https://github.com/emberjs/ember.js/pull/17540) [DEPRECATION] Deprecate aliasMethod @@ -99,7 +104,7 @@ Fixes a few issues: - [#17025](https://github.com/emberjs/ember.js/pull/17025) / [#17034](https://github.com/emberjs/ember.js/pull/17034) / [#17036](https://github.com/emberjs/ember.js/pull/17036) / [#17038](https://github.com/emberjs/ember.js/pull/17038) / [#17040](https://github.com/emberjs/ember.js/pull/17040) / [#17041](https://github.com/emberjs/ember.js/pull/17041) / [#17061](https://github.com/emberjs/ember.js/pull/17061) [FEATURE] Final stage of the router service RFC (see [emberjs/rfcs#95](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md) - [#16795](https://github.com/emberjs/ember.js/pull/16795) [FEATURE] Native Class Constructor Update (see [emberjs/rfcs#337](https://github.com/emberjs/rfcs/blob/master/text/0337-native-class-constructor-update.md) -- [#17188](https://github.com/emberjs/ember.js/pull/17188) / [#17246](https://github.com/emberjs/ember.js/pull/17246) [BUGFIX] Adds a second dist build which targets IE and early Android versions. Enables avoiding errors when using native classes without transpilation. +- [#17188](https://github.com/emberjs/ember.js/pull/17188) / [#17246](https://github.com/emberjs/ember.js/pull/17246) [BUGFIX] Adds a second dist build which targets IE and early Android versions. Enables avoiding errors when using native classes without transpilation. - [#17238](https://github.com/emberjs/ember.js/pull/17238) [DEPRECATION] Deprecate calling `A` as a constructor - [#16956](https://github.com/emberjs/ember.js/pull/16956) [DEPRECATION] Deprecate Ember.merge - [#17220](https://github.com/emberjs/ember.js/pull/17220) [BUGFIX] Fix cycle detection in Ember.copy
false
Other
emberjs
ember.js
919ede7e5eb5451f0b994ffe360dbe0a0a01f8ba.json
Add missing feature to 3.10.0-beta.1 CHANGELOG [ci skip] (cherry picked from commit 6e89ed823a43b429246940f40a4240afb47458f3)
CHANGELOG.md
@@ -6,6 +6,7 @@ - [#17719](https://github.com/emberjs/ember.js/pull/17719) / [#17745](https://github.com/emberjs/ember.js/pull/17745) [FEATURE] Support for nested components in angle bracket invocation syntax (see [emberjs/rfcs#0457](https://github.com/emberjs/rfcs/blob/master/text/0457-nested-lookups.md)). - [#17735](https://github.com/emberjs/ember.js/pull/17735) / [#17772](https://github.com/emberjs/ember.js/pull/17772) / [#17811](https://github.com/emberjs/ember.js/pull/17811) / [#17814](https://github.com/emberjs/ember.js/pull/17814) [FEATURE] Implement the Angle Bracket Invocations For Built-in Components RFC (see [emberjs/rfcs#0459](https://github.com/emberjs/rfcs/blob/master/text/0459-angle-bracket-built-in-components.md)). - [#17548](https://github.com/emberjs/ember.js/pull/17548) / [#17604](https://github.com/emberjs/ember.js/pull/17604) / [#17690](https://github.com/emberjs/ember.js/pull/17690) / [#17827](https://github.com/emberjs/ember.js/pull/17827) / [#17828](https://github.com/emberjs/ember.js/pull/17828) [FEATURE] Implement the Decorators RFC (see [emberjs/rfcs#0408](https://github.com/emberjs/rfcs/blob/master/text/0408-decorators.md)). +- [#17256](https://github.com/emberjs/ember.js/pull/17256) / [#17664](https://github.com/emberjs/ember.js/pull/17664) [FEATURE] Implement RouteInfo Metadata RFC (see [emberjs/rfcs#0398](https://github.com/emberjs/rfcs/blob/master/text/0398-RouteInfo-Metadata.md)). - [#17747](https://github.com/emberjs/ember.js/pull/17747) [BUGFIX] Correct component-test blueprint for ember-cli-mocha - [#17788](https://github.com/emberjs/ember.js/pull/17788) [BUGFIX] Fix native DOM events in Glimmer Angle Brackets - [#17833](https://github.com/emberjs/ember.js/pull/17833) [BUGFIX] Reverts the naming of setClassicDecorator externally
false
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/glimmer/lib/component-managers/curly.ts
@@ -1,5 +1,4 @@ import { privatize as P } from '@ember/-internals/container'; -import { get } from '@ember/-internals/metal'; import { getOwner } from '@ember/-internals/owner'; import { guidFor } from '@ember/-internals/utils'; import { @@ -121,7 +120,9 @@ export default class CurlyComponentManager } templateFor(component: Component, resolver: RuntimeResolver): OwnedTemplate { - let layout = get(component, 'layout') as TemplateFactory | OwnedTemplate | undefined; + let { layout, layoutName } = component; + let owner = getOwner(component); + if (layout !== undefined) { // This needs to be cached by template.id if (isTemplateFactory(layout)) { @@ -131,14 +132,14 @@ export default class CurlyComponentManager return layout; } } - let owner = getOwner(component); - let layoutName = get(component, 'layoutName'); + if (layoutName) { let template = owner.lookup<OwnedTemplate>('template:' + layoutName); if (template) { return template; } } + return owner.lookup<OwnedTemplate>(DEFAULT_LAYOUT); } @@ -358,7 +359,7 @@ export default class CurlyComponentManager } if (classRef) { - const ref = new SimpleClassNameBindingReference(classRef, classRef['_propertyKey']); + const ref = new SimpleClassNameBindingReference(classRef, classRef['propertyKey']); operations.setAttribute('class', ref, false, null); }
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/glimmer/lib/component-managers/custom.ts
@@ -14,7 +14,6 @@ import { CapturedArguments, ComponentDefinition, Invocation, - PrimitiveReference, WithStaticLayout, } from '@glimmer/runtime'; import { Destroyable } from '@glimmer/util'; @@ -178,13 +177,8 @@ export default class CustomComponentManager<ComponentInstance> delegate.getContext(component); } - getSelf({ - delegate, - component, - }: CustomComponentState<ComponentInstance>): PrimitiveReference<null> | PathReference<Opaque> { - const context = delegate.getContext(component); - - return new RootReference(context); + getSelf({ delegate, component }: CustomComponentState<ComponentInstance>): PathReference<Opaque> { + return RootReference.create(delegate.getContext(component)); } getDestructor(state: CustomComponentState<ComponentInstance>): Option<Destroyable> {
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/glimmer/lib/components/checkbox.ts
@@ -1,4 +1,4 @@ -import { get, set } from '@ember/-internals/metal'; +import { set } from '@ember/-internals/metal'; import { assert } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; import EmberComponent from '../component'; @@ -121,7 +121,7 @@ const Checkbox = EmberComponent.extend({ */ didInsertElement() { this._super(...arguments); - get(this, 'element').indeterminate = Boolean(get(this, 'indeterminate')); + this.element.indeterminate = Boolean(this.indeterminate); }, /**
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/glimmer/lib/helpers/action.ts
@@ -284,12 +284,12 @@ export default function(_vm: VM, args: Arguments): UnboundReference<Function> { let [context, action, ...restArgs] = capturedArgs.references; // TODO: Is there a better way of doing this? - let debugKey: string | undefined = (action as any)._propertyKey; + let debugKey: string | undefined = (action as any).propertyKey; let target = named.has('target') ? named.get('target') : context; let processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); - let fn; + let fn: Function; if (typeof action[INVOKE] === 'function') { fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey);
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/glimmer/lib/modifiers/action.ts
@@ -205,7 +205,7 @@ export default class ActionModifierManager implements ModifierManager<ActionStat if (actionNameRef[INVOKE]) { actionName = actionNameRef; } else { - let actionLabel = actionNameRef._propertyKey; + let actionLabel = actionNameRef.propertyKey; actionName = actionNameRef.value(); assert(
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.ts
@@ -3,10 +3,12 @@ import { Revision, VersionedReference } from '@glimmer/reference'; import { CapturedNamedArguments } from '@glimmer/runtime'; import { Opaque } from '@glimmer/util'; import Environment from '../environment'; +import { Factory as TemplateFactory, OwnedTemplate } from '../template'; export interface Component { _debugContainerKey: string; _transitionTo(name: string): void; + layout?: TemplateFactory | OwnedTemplate; layoutName?: string; attributeBindings: Array<string>; classNames: Array<string>;
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/glimmer/lib/utils/references.ts
@@ -6,12 +6,14 @@ import { setCurrentTracker, tagFor, tagForProperty, + Tracker, watchKey, } from '@ember/-internals/metal'; import { isProxy, symbol } from '@ember/-internals/utils'; import { EMBER_METAL_TRACKED_PROPERTIES } from '@ember/canary-features'; +import { debugFreeze } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; -import { Opaque } from '@glimmer/interfaces'; +import { Dict, Opaque } from '@glimmer/interfaces'; import { combine, CONSTANT_TAG, @@ -30,6 +32,7 @@ import { CapturedArguments, ConditionalReference as GlimmerConditionalReference, PrimitiveReference, + UNDEFINED_REFERENCE, } from '@glimmer/runtime'; import { Option, unreachable } from '@glimmer/util'; import { HelperFunction, HelperInstance, RECOMPUTE_TAG } from '../helper'; @@ -39,26 +42,10 @@ export const UPDATE = symbol('UPDATE'); export const INVOKE = symbol('INVOKE'); export const ACTION = symbol('ACTION'); -let maybeFreeze: (obj: any) => void; -if (DEBUG) { - // gaurding this in a DEBUG gaurd (as well as all invocations) - // so that it is properly stripped during the minification's - // dead code elimination - maybeFreeze = (obj: any) => { - // re-freezing an already frozen object introduces a significant - // performance penalty on Chrome (tested through 59). - // - // See: https://bugs.chromium.org/p/v8/issues/detail?id=6450 - if (!Object.isFrozen(obj)) { - Object.freeze(obj); - } - }; -} - abstract class EmberPathReference implements VersionedPathReference<Opaque> { abstract tag: Tag; - get(key: string): any { + get(key: string): VersionedPathReference<Opaque> { return PropertyReference.create(this, key); } @@ -67,38 +54,43 @@ abstract class EmberPathReference implements VersionedPathReference<Opaque> { export abstract class CachedReference extends EmberPathReference { abstract tag: Tag; - private _lastRevision: Option<Revision>; - private _lastValue: Opaque; + private lastRevision: Option<Revision>; + private lastValue: Opaque; constructor() { super(); - this._lastRevision = null; - this._lastValue = null; + this.lastRevision = null; + this.lastValue = null; } abstract compute(): Opaque; - value() { - let { tag, _lastRevision, _lastValue } = this; + value(): Opaque { + let { tag, lastRevision, lastValue } = this; - if (_lastRevision === null || !tag.validate(_lastRevision)) { - _lastValue = this._lastValue = this.compute(); - this._lastRevision = tag.value(); + if (lastRevision === null || !tag.validate(lastRevision)) { + lastValue = this.lastValue = this.compute(); + this.lastRevision = tag.value(); } - return _lastValue; + return lastValue; } } -export class RootReference<T> extends ConstReference<T> { - public children: any; +export class RootReference<T extends object> extends ConstReference<T> + implements VersionedPathReference<T> { + static create<T>(value: T): VersionedPathReference<T> { + return valueToRef(value); + } + + private children: Dict<VersionedPathReference<Opaque>>; constructor(value: T) { super(value); this.children = Object.create(null); } - get(propertyKey: string) { + get(propertyKey: string): VersionedPathReference<Opaque> { let ref = this.children[propertyKey]; if (ref === undefined) { @@ -109,26 +101,20 @@ export class RootReference<T> extends ConstReference<T> { } } -interface TwoWayFlushDetectionTag extends RevisionTag { +interface ITwoWayFlushDetectionTag extends RevisionTag { didCompute(parent: Opaque): void; } let TwoWayFlushDetectionTag: { - new (tag: Tag, key: string, ref: VersionedPathReference<Opaque>): TwoWayFlushDetectionTag; create( tag: Tag, key: string, ref: VersionedPathReference<Opaque> - ): TagWrapper<TwoWayFlushDetectionTag>; + ): TagWrapper<ITwoWayFlushDetectionTag>; }; if (DEBUG) { - TwoWayFlushDetectionTag = class { - public tag: Tag; - public parent: Opaque; - public key: string; - public ref: any; - + TwoWayFlushDetectionTag = class TwoWayFlushDetectionTag implements ITwoWayFlushDetectionTag { static create( tag: Tag, key: string, @@ -137,30 +123,31 @@ if (DEBUG) { return new TagWrapper((tag as any).type, new TwoWayFlushDetectionTag(tag, key, ref)); } - constructor(tag: Tag, key: string, ref: any) { - this.tag = tag; - this.parent = null; - this.key = key; - this.ref = ref; - } + private parent: Opaque = null; + + constructor( + private tag: Tag, + private key: string, + private ref: VersionedPathReference<Opaque> + ) {} - value() { + value(): Revision { return this.tag.value(); } - validate(ticket: any) { - let { parent, key } = this; + validate(ticket: Revision): boolean { + let { parent, key, ref } = this; let isValid = this.tag.validate(ticket); if (isValid && parent) { - didRender(parent, key, this.ref); + didRender(parent, key, ref); } return isValid; } - didCompute(parent: any) { + didCompute(parent: Opaque): void { this.parent = parent; didRender(parent, this.key, this.ref); } @@ -172,7 +159,7 @@ export abstract class PropertyReference extends CachedReference { static create(parentReference: VersionedPathReference<Opaque>, propertyKey: string) { if (isConst(parentReference)) { - return new RootPropertyReference(parentReference.value(), propertyKey); + return valueKeyToRef(parentReference.value(), propertyKey); } else { return new NestedPropertyReference(parentReference, propertyKey); } @@ -186,81 +173,73 @@ export abstract class PropertyReference extends CachedReference { export class RootPropertyReference extends PropertyReference implements VersionedPathReference<Opaque> { public tag: Tag; - private _parentValue: any; - private _propertyKey: string; - private _propertyTag: TagWrapper<UpdatableTag>; + private propertyTag: TagWrapper<UpdatableTag>; - constructor(parentValue: any, propertyKey: string) { + constructor(private parentValue: object, private propertyKey: string) { super(); - this._parentValue = parentValue; - this._propertyKey = propertyKey; - if (EMBER_METAL_TRACKED_PROPERTIES) { - this._propertyTag = UpdatableTag.create(CONSTANT_TAG); + this.propertyTag = UpdatableTag.create(CONSTANT_TAG); } else { - this._propertyTag = UpdatableTag.create(tagForProperty(parentValue, propertyKey)); + this.propertyTag = UpdatableTag.create(tagForProperty(parentValue, propertyKey)); } if (DEBUG) { - this.tag = TwoWayFlushDetectionTag.create(this._propertyTag, propertyKey, this); + this.tag = TwoWayFlushDetectionTag.create(this.propertyTag, propertyKey, this); } else { - this.tag = this._propertyTag; + this.tag = this.propertyTag; } if (DEBUG) { watchKey(parentValue, propertyKey); } } - compute() { - let { _parentValue, _propertyKey } = this; + compute(): Opaque { + let { parentValue, propertyKey } = this; if (DEBUG) { - (this.tag.inner as TwoWayFlushDetectionTag).didCompute(_parentValue); + (this.tag.inner as ITwoWayFlushDetectionTag).didCompute(parentValue); } - let parent: any; - let tracker: any; + let parent: Option<Tracker> = null; + let tracker: Option<Tracker> = null; if (EMBER_METAL_TRACKED_PROPERTIES) { parent = getCurrentTracker(); tracker = setCurrentTracker(); } - let ret = get(_parentValue, _propertyKey); + let ret = get(parentValue, propertyKey); if (EMBER_METAL_TRACKED_PROPERTIES) { - setCurrentTracker(parent!); + setCurrentTracker(parent); let tag = tracker!.combine(); if (parent) parent.add(tag); - this._propertyTag.inner.update(tag); + this.propertyTag.inner.update(tag); } return ret; } - [UPDATE](value: any) { - set(this._parentValue, this._propertyKey, value); + [UPDATE](value: Opaque): void { + set(this.parentValue, this.propertyKey, value); } } export class NestedPropertyReference extends PropertyReference { public tag: Tag; - private _parentReference: any; - private _propertyTag: TagWrapper<UpdatableTag>; - private _propertyKey: string; + private propertyTag: TagWrapper<UpdatableTag>; - constructor(parentReference: VersionedPathReference<Opaque>, propertyKey: string) { + constructor( + private parentReference: VersionedPathReference<Opaque>, + private propertyKey: string + ) { super(); let parentReferenceTag = parentReference.tag; - let propertyTag = UpdatableTag.create(CONSTANT_TAG); - - this._parentReference = parentReference; - this._propertyTag = propertyTag; - this._propertyKey = propertyKey; + let propertyTag = (this.propertyTag = UpdatableTag.create(CONSTANT_TAG)); if (DEBUG) { let tag = combine([parentReferenceTag, propertyTag]); @@ -270,43 +249,45 @@ export class NestedPropertyReference extends PropertyReference { } } - compute() { - let { _parentReference, _propertyTag, _propertyKey } = this; + compute(): Opaque { + let { parentReference, propertyTag, propertyKey } = this; - let parentValue = _parentReference.value(); - let parentValueType = typeof parentValue; + let _parentValue = parentReference.value(); + let parentValueType = typeof _parentValue; - if (parentValueType === 'string' && _propertyKey === 'length') { - return parentValue.length; + if (parentValueType === 'string' && propertyKey === 'length') { + return (_parentValue as string).length; } - if ((parentValueType === 'object' && parentValue !== null) || parentValueType === 'function') { + if ((parentValueType === 'object' && _parentValue !== null) || parentValueType === 'function') { + let parentValue = _parentValue as object; + if (DEBUG) { - watchKey(parentValue, _propertyKey); + watchKey(parentValue, propertyKey); } if (DEBUG) { - (this.tag.inner as TwoWayFlushDetectionTag).didCompute(parentValue); + (this.tag.inner as ITwoWayFlushDetectionTag).didCompute(parentValue); } - let parent: any; - let tracker: any; + let parent: Option<Tracker> = null; + let tracker: Option<Tracker> = null; if (EMBER_METAL_TRACKED_PROPERTIES) { parent = getCurrentTracker(); tracker = setCurrentTracker(); } - let ret = get(parentValue, _propertyKey); + let ret = get(parentValue, propertyKey); if (EMBER_METAL_TRACKED_PROPERTIES) { setCurrentTracker(parent!); let tag = tracker!.combine(); if (parent) parent.add(tag); - _propertyTag.inner.update(tag); + propertyTag.inner.update(tag); } else { - _propertyTag.inner.update(tagForProperty(parentValue, _propertyKey)); + propertyTag.inner.update(tagForProperty(parentValue, propertyKey)); } return ret; @@ -315,28 +296,31 @@ export class NestedPropertyReference extends PropertyReference { } } - [UPDATE](value: any) { - let parent = this._parentReference.value(); - set(parent, this._propertyKey, value); + [UPDATE](value: Opaque): void { + set( + this.parentReference.value() as object /* let the other side handle the error */, + this.propertyKey, + value + ); } } export class UpdatableReference extends EmberPathReference { public tag: TagWrapper<DirtyableTag>; - private _value: any; + private _value: Opaque; - constructor(value: any) { + constructor(value: Opaque) { super(); this.tag = DirtyableTag.create(); this._value = value; } - value() { + value(): Opaque { return this._value; } - update(value: any) { + update(value: Opaque): void { let { _value } = this; if (value !== _value) { @@ -353,9 +337,7 @@ export class ConditionalReference extends GlimmerConditionalReference if (isConst(reference)) { let value = reference.value(); - if (isProxy(value)) { - return new RootPropertyReference(value, 'isTruthy') as VersionedReference<any>; - } else { + if (!isProxy(value)) { return PrimitiveReference.create(emberToBool(value)); } } @@ -369,10 +351,10 @@ export class ConditionalReference extends GlimmerConditionalReference this.tag = combine([reference.tag, this.objectTag]); } - toBool(predicate: Opaque) { + toBool(predicate: Opaque): boolean { if (isProxy(predicate)) { this.objectTag.inner.update(tagForProperty(predicate, 'isTruthy')); - return get(predicate as object, 'isTruthy'); + return Boolean(get(predicate, 'isTruthy')); } else { this.objectTag.inner.update(tagFor(predicate)); return emberToBool(predicate); @@ -381,10 +363,6 @@ export class ConditionalReference extends GlimmerConditionalReference } export class SimpleHelperReference extends CachedReference { - public tag: Tag; - public helper: HelperFunction; - public args: CapturedArguments; - static create(helper: HelperFunction, args: CapturedArguments) { if (isConst(args)) { let { positional, named } = args; @@ -393,8 +371,8 @@ export class SimpleHelperReference extends CachedReference { let namedValue = named.value(); if (DEBUG) { - maybeFreeze(positionalValue); - maybeFreeze(namedValue); + debugFreeze(positionalValue); + debugFreeze(namedValue); } let result = helper(positionalValue, namedValue); @@ -404,15 +382,14 @@ export class SimpleHelperReference extends CachedReference { } } - constructor(helper: HelperFunction, args: CapturedArguments) { - super(); + public tag: Tag; + constructor(private helper: HelperFunction, private args: CapturedArguments) { + super(); this.tag = args.tag; - this.helper = helper; - this.args = args; } - compute() { + compute(): Opaque { let { helper, args: { positional, named }, @@ -422,32 +399,27 @@ export class SimpleHelperReference extends CachedReference { let namedValue = named.value(); if (DEBUG) { - maybeFreeze(positionalValue); - maybeFreeze(namedValue); + debugFreeze(positionalValue); + debugFreeze(namedValue); } return helper(positionalValue, namedValue); } } export class ClassBasedHelperReference extends CachedReference { - public tag: Tag; - public instance: HelperInstance; - public args: CapturedArguments; - static create(instance: HelperInstance, args: CapturedArguments) { return new ClassBasedHelperReference(instance, args); } - constructor(instance: HelperInstance, args: CapturedArguments) { - super(); + public tag: Tag; + constructor(private instance: HelperInstance, private args: CapturedArguments) { + super(); this.tag = combine([instance[RECOMPUTE_TAG], args.tag]); - this.instance = instance; - this.args = args; } - compute() { + compute(): Opaque { let { instance, args: { positional, named }, @@ -457,8 +429,8 @@ export class ClassBasedHelperReference extends CachedReference { let namedValue = named.value(); if (DEBUG) { - maybeFreeze(positionalValue); - maybeFreeze(namedValue); + debugFreeze(positionalValue); + debugFreeze(namedValue); } return instance.compute(positionalValue, namedValue); @@ -467,51 +439,48 @@ export class ClassBasedHelperReference extends CachedReference { export class InternalHelperReference extends CachedReference { public tag: Tag; - public helper: (args: CapturedArguments) => CapturedArguments; - public args: any; - constructor(helper: (args: CapturedArguments) => any, args: CapturedArguments) { + constructor( + private helper: (args: CapturedArguments) => Opaque, + private args: CapturedArguments + ) { super(); - this.tag = args.tag; - this.helper = helper; - this.args = args; } - compute() { + compute(): Opaque { let { helper, args } = this; return helper(args); } } -export class UnboundReference<T> extends ConstReference<T> { +export class UnboundReference<T extends object> extends ConstReference<T> { static create<T>(value: T): VersionedPathReference<T> { return valueToRef(value, false); } - get(key: string) { - return valueToRef(get(this.inner as any, key), false); + get(key: string): VersionedPathReference<Opaque> { + return valueToRef(this.inner[key], false); } } export class ReadonlyReference extends CachedReference { + public tag: Tag; + constructor(private inner: VersionedPathReference<Opaque>) { super(); + this.tag = inner.tag; } - get tag() { - return this.inner.tag; - } - - get [INVOKE]() { + get [INVOKE](): Function | undefined { return this.inner[INVOKE]; } - compute() { + compute(): Opaque { return this.inner.value(); } - get(key: string) { + get(key: string): VersionedPathReference { return this.inner.get(key); } } @@ -554,7 +523,7 @@ function isPrimitive(value: Opaque): value is Primitive { } } -export function valueToRef<T = Opaque>(value: T, bound = true): VersionedPathReference<T> { +function valueToRef<T = Opaque>(value: T, bound = true): VersionedPathReference<T> { if (isObject(value)) { // root of interop with ember objects return bound ? new RootReference(value) : new UnboundReference(value); @@ -582,3 +551,32 @@ export function valueToRef<T = Opaque>(value: T, bound = true): VersionedPathRef throw unreachable(); } } + +function valueKeyToRef(value: Opaque, key: string): VersionedPathReference<Opaque> { + if (isObject(value)) { + // root of interop with ember objects + return new RootPropertyReference(value, key); + } 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(); + } +}
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/metal/index.ts
@@ -49,7 +49,7 @@ export { Mixin, aliasMethod, mixin, observer, applyMixin } from './lib/mixin'; export { default as inject, DEBUG_INJECTION_FUNCTIONS } from './lib/injected_property'; export { tagForProperty, tagFor, markObjectAsDirty } from './lib/tags'; export { default as runInTransaction, didRender, assertNotRendered } from './lib/transaction'; -export { tracked, getCurrentTracker, setCurrentTracker } from './lib/tracked'; +export { Tracker, tracked, getCurrentTracker, setCurrentTracker } from './lib/tracked'; export { NAMESPACES,
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/metal/lib/tracked.ts
@@ -18,7 +18,7 @@ let symbol = (HAS_NATIVE_SYMBOL ? Symbol : emberSymbol) as (debugKey: string) => @private */ -class Tracker { +export class Tracker { private tags = new Set<Tag>(); private last: Option<Tag> = null; @@ -243,7 +243,9 @@ export function getCurrentTracker(): Option<Tracker> { return CURRENT_TRACKER; } -export function setCurrentTracker(tracker: Tracker = new Tracker()): Tracker { +export function setCurrentTracker(): Tracker; +export function setCurrentTracker(tracker: Option<Tracker>): Option<Tracker>; +export function setCurrentTracker(tracker: Option<Tracker> = new Tracker()): Option<Tracker> { return (CURRENT_TRACKER = tracker); }
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/metal/lib/transaction.ts
@@ -90,9 +90,9 @@ if (DEBUG) { let label; if (lastRef !== undefined) { - while (lastRef && lastRef._propertyKey) { - parts.unshift(lastRef._propertyKey); - lastRef = lastRef._parentReference; + while (lastRef && lastRef.propertyKey) { + parts.unshift(lastRef.propertyKey); + lastRef = lastRef.parentReference; } label = parts.join('.');
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/routing/lib/system/dsl.ts
@@ -168,7 +168,7 @@ export default class DSLImpl implements DSL { }; } - mount(_name: string, options: Partial<MountOptions> = {}) { + mount(_name: string, options: MountOptions = {}) { let engineRouteMap = this.options.resolveRouteMap(_name); let name = _name;
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/-internals/utils/lib/is_proxy.ts
@@ -3,14 +3,14 @@ import { isObject } from './spec'; const PROXIES = new WeakSet(); -export function isProxy(object: any | undefined | null) { - if (isObject(object)) { - return PROXIES.has(object); +export function isProxy(value: any | undefined | null): value is object { + if (isObject(value)) { + return PROXIES.has(value); } return false; } -export function setProxy(object: object) { +export function setProxy(object: object): void { if (isObject(object)) { PROXIES.add(object); }
true
Other
emberjs
ember.js
72ddf93acc398dc23d1298d1e05eaafd115fc44d.json
Fix some types, remove `any`s from `references.ts`
packages/@ember/debug/index.ts
@@ -296,7 +296,13 @@ if (DEBUG) { }); setDebugFunction('debugFreeze', function debugFreeze(obj) { - Object.freeze(obj); + // re-freezing an already frozen object introduces a significant + // performance penalty on Chrome (tested through 59). + // + // See: https://bugs.chromium.org/p/v8/issues/detail?id=6450 + if (!Object.isFrozen(obj)) { + Object.freeze(obj); + } }); setDebugFunction('deprecate', _deprecate);
true
Other
emberjs
ember.js
665c62548359c6f16cfaf08274c1ce677feed8aa.json
fix input tests without jquery
packages/@ember/-internals/glimmer/tests/integration/components/input-angle-test.js
@@ -3,7 +3,7 @@ import { RenderingTestCase, moduleFor, runDestroy, runTask } from 'internal-test import { EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS } from '@ember/canary-features'; import { assign } from '@ember/polyfills'; import { set } from '@ember/-internals/metal'; -import { jQuery } from '@ember/-internals/views'; +import { jQueryDisabled, jQuery } from '@ember/-internals/views'; import { Component } from '../../utils/helpers'; @@ -501,7 +501,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed.'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -521,7 +525,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -541,7 +549,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -561,7 +573,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -612,7 +628,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -632,7 +652,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -652,7 +676,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -670,7 +698,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -690,7 +722,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -708,7 +744,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -728,7 +768,11 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS) { actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, });
true
Other
emberjs
ember.js
665c62548359c6f16cfaf08274c1ce677feed8aa.json
fix input tests without jquery
packages/@ember/-internals/glimmer/tests/integration/components/input-curly-test.js
@@ -3,7 +3,7 @@ import { RenderingTestCase, moduleFor, runDestroy, runTask } from 'internal-test import { EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS } from '@ember/canary-features'; import { assign } from '@ember/polyfills'; import { set } from '@ember/-internals/metal'; -import { jQuery } from '@ember/-internals/views'; +import { jQueryDisabled, jQuery } from '@ember/-internals/views'; import { Component } from '../../utils/helpers'; @@ -349,7 +349,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed.'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -375,7 +379,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -395,7 +403,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -421,7 +433,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -472,7 +488,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -492,7 +512,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -518,7 +542,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -536,7 +564,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -562,7 +594,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -580,7 +616,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, }); @@ -604,7 +644,11 @@ moduleFor( actions: { foo(value, event) { assert.ok(true, 'action was triggered'); - assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + if (jQueryDisabled) { + assert.notOk(event.originalEvent, 'event is not a jQuery.Event'); + } else { + assert.ok(event instanceof jQuery.Event, 'jQuery event was passed'); + } }, }, });
true
Other
emberjs
ember.js
41c4ee6bba4233ed325dd8e139b8de9dbe1ca37b.json
Add v3.10.0-beta.1 to CHANGELOG [ci skip] (cherry picked from commit 6744aa9063495217451f99a34b5dcc5f100c184b)
CHANGELOG.md
@@ -1,5 +1,20 @@ # Ember Changelog +### v3.10.0-beta.1 (April 02, 2019) + +- [#17836](https://github.com/emberjs/ember.js/pull/17836) [BREAKING] Explicitly drop support for Node 6 +- [#17719](https://github.com/emberjs/ember.js/pull/17719) / [#17745](https://github.com/emberjs/ember.js/pull/17745) [FEATURE] Support for nested components in angle bracket invocation syntax (see [emberjs/rfcs#0457](https://github.com/emberjs/rfcs/blob/master/text/0457-nested-lookups.md)). +- [#17735](https://github.com/emberjs/ember.js/pull/17735) / [#17772](https://github.com/emberjs/ember.js/pull/17772) / [#17811](https://github.com/emberjs/ember.js/pull/17811) / [#17814](https://github.com/emberjs/ember.js/pull/17814) [FEATURE] Implement the Angle Bracket Invocations For Built-in Components RFC (see [emberjs/rfcs#0459](https://github.com/emberjs/rfcs/blob/master/text/0459-angle-bracket-built-in-components.md)). +- [#17548](https://github.com/emberjs/ember.js/pull/17548) / [#17604](https://github.com/emberjs/ember.js/pull/17604) / [#17690](https://github.com/emberjs/ember.js/pull/17690) / [#17827](https://github.com/emberjs/ember.js/pull/17827) / [#17828](https://github.com/emberjs/ember.js/pull/17828) [FEATURE] Implement the Decorators RFC (see [emberjs/rfcs#0408](https://github.com/emberjs/rfcs/blob/master/text/0408-decorators.md)). +- [#17747](https://github.com/emberjs/ember.js/pull/17747) [BUGFIX] Correct component-test blueprint for ember-cli-mocha +- [#17788](https://github.com/emberjs/ember.js/pull/17788) [BUGFIX] Fix native DOM events in Glimmer Angle Brackets +- [#17833](https://github.com/emberjs/ember.js/pull/17833) [BUGFIX] Reverts the naming of setClassicDecorator externally +- [#17841](https://github.com/emberjs/ember.js/pull/17841) [BUGFIX] Ensure @sort works on non-Ember.Objects. +- [#17818](https://github.com/emberjs/ember.js/pull/17818) [BUGFIX] Fix event dispatcher (part 1) +- [#17411](https://github.com/emberjs/ember.js/pull/17411) / [#17732](https://github.com/emberjs/ember.js/pull/17732) / [#17412](https://github.com/emberjs/ember.js/pull/17412) Update initializer blueprints for ember-mocha 0.14 +- [#17702](https://github.com/emberjs/ember.js/pull/17702) Extend from glimmer component for octane blueprint +- [#17740](https://github.com/emberjs/ember.js/pull/17740) Fix octane component blueprint and octane blueprint tests + ### v3.8.1 (April 02, 2019) - [#17684](https://github.com/emberjs/ember.js/pull/17684) [BUGFIX] Enable maximum rerendering limit to be customized.
false
Other
emberjs
ember.js
aede427fb866a6364caba37f88b5b8bfafdfa113.json
Add v3.8.1 to CHANGELOG [ci skip] (cherry picked from commit af18a4f23b448656793ba9a7d4ca78dd75cff34a)
CHANGELOG.md
@@ -1,5 +1,10 @@ # Ember Changelog +### v3.8.1 (April 02, 2019) + +- [#17684](https://github.com/emberjs/ember.js/pull/17684) [BUGFIX] Enable maximum rerendering limit to be customized. +- [#17823](https://github.com/emberjs/ember.js/pull/17823) Update router_js to 6.2.4 + ### v3.9.0 (April 01, 2019) - [#17470](https://github.com/emberjs/ember.js/pull/17470) [DEPRECATION] Implements the Computed Property Modifier deprecation RFCs
false
Other
emberjs
ember.js
d059ad6b573cf3d3cd680f55abf18a17cb3933cc.json
Add v3.9.0 to CHANGELOG [ci skip] (cherry picked from commit 2b9ee1792f27d20723c9b2c534de2f050098220c)
CHANGELOG.md
@@ -1,24 +1,6 @@ # Ember Changelog -### v3.9.0-beta.5 (March 25, 2019) - -- [#17733](https://github.com/emberjs/ember.js/pull/17733) [BUGFIX] Assert on use of reserved component names (`input` and `textarea`) - -### v3.9.0-beta.4 (March 11, 2019) - -- [#17710](https://github.com/emberjs/ember.js/pull/17710) [BUGFIX] Allow accessors in mixins - -### v3.9.0-beta.3 (March 4, 2019) - -- [#17684](https://github.com/emberjs/ember.js/pull/17684) [BUGFIX] Enable maximum rerendering limit to be customized. -- [#17691](https://github.com/emberjs/ember.js/pull/17691) [BUGFIX] Ensure tagForProperty works on class constructors - -### v3.9.0-beta.2 (February 26, 2019) - -- [#17618](https://github.com/emberjs/ember.js/pull/17618) [BUGFIX] Migrate autorun microtask queue to Promise.then -- [#17649](https://github.com/emberjs/ember.js/pull/17649) [BUGFIX] Revert decorator refactors - -### v3.9.0-beta.1 (February 18, 2019) +### v3.9.0 (April 01, 2019) - [#17470](https://github.com/emberjs/ember.js/pull/17470) [DEPRECATION] Implements the Computed Property Modifier deprecation RFCs * Deprecates `.property()` (see [emberjs/rfcs#0375](https://github.com/emberjs/rfcs/blob/master/text/0375-deprecate-computed-property-modifier.md) @@ -27,6 +9,13 @@ - [#17488](https://github.com/emberjs/ember.js/pull/17488) [DEPRECATION] Deprecate this.$() in curly components (see [emberjs/rfcs#0386](https://github.com/emberjs/rfcs/blob/master/text/0386-remove-jquery.md)) - [#17489](https://github.com/emberjs/ember.js/pull/17489) [DEPRECATION] Deprecate Ember.$() (see [emberjs/rfcs#0386](https://github.com/emberjs/rfcs/blob/master/text/0386-remove-jquery.md)) - [#17540](https://github.com/emberjs/ember.js/pull/17540) [DEPRECATION] Deprecate aliasMethod +- [#17823](https://github.com/emberjs/ember.js/pull/17823) Update router_js to 6.2.4 +- [#17733](https://github.com/emberjs/ember.js/pull/17733) [BUGFIX] Assert on use of reserved component names (`input` and `textarea`) +- [#17710](https://github.com/emberjs/ember.js/pull/17710) [BUGFIX] Allow accessors in mixins +- [#17684](https://github.com/emberjs/ember.js/pull/17684) [BUGFIX] Enable maximum rerendering limit to be customized. +- [#17691](https://github.com/emberjs/ember.js/pull/17691) [BUGFIX] Ensure tagForProperty works on class constructors +- [#17618](https://github.com/emberjs/ember.js/pull/17618) [BUGFIX] Migrate autorun microtask queue to Promise.then +- [#17649](https://github.com/emberjs/ember.js/pull/17649) [BUGFIX] Revert decorator refactors - [#17487](https://github.com/emberjs/ember.js/pull/17487) [BUGFIX] Fix scenario where aliased properties did not update in production mode ### v3.8.0 (February 18, 2019)
false
Other
emberjs
ember.js
da39c475f1f42b1544f1c95dd888db9226d05fa6.json
Remove intimate apis in the router
packages/@ember/-internals/routing/lib/system/router.ts
@@ -2,12 +2,7 @@ import { computed, get, notifyPropertyChange, set } from '@ember/-internals/meta import { getOwner, Owner } from '@ember/-internals/owner'; import { A as emberA, Evented, Object as EmberObject, typeOf } from '@ember/-internals/runtime'; import { assert, deprecate, info } from '@ember/debug'; -import { - APP_CTRL_ROUTER_PROPS, - HANDLER_INFOS, - ROUTER_EVENTS, - TRANSITION_STATE, -} from '@ember/deprecated-features'; +import { APP_CTRL_ROUTER_PROPS, ROUTER_EVENTS } from '@ember/deprecated-features'; import EmberError from '@ember/error'; import { assign } from '@ember/polyfills'; import { cancel, once, run, scheduleOnce } from '@ember/runloop'; @@ -29,9 +24,7 @@ import RouterState from './router_state'; import { MatchCallback } from 'route-recognizer'; import Router, { InternalRouteInfo, - InternalTransition, logAbort, - PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, STATE_SYMBOL, Transition, @@ -80,141 +73,6 @@ function defaultWillTransition( } } -if (TRANSITION_STATE) { - Object.defineProperty(InternalTransition.prototype, 'state', { - get() { - deprecate( - 'You attempted to read "transition.state" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the public state on it.', - false, - { - id: 'transition-state', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_transition-state', - } - ); - return this[STATE_SYMBOL]; - }, - }); - - Object.defineProperty(InternalTransition.prototype, 'queryParams', { - get() { - deprecate( - 'You attempted to read "transition.queryParams" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the queryParams on it.', - false, - { - id: 'transition-state', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_transition-state', - } - ); - return this[QUERY_PARAMS_SYMBOL]; - }, - }); - - Object.defineProperty(InternalTransition.prototype, 'params', { - get() { - deprecate( - 'You attempted to read "transition.params" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the params on it.', - false, - { - id: 'transition-state', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_transition-state', - } - ); - return this[PARAMS_SYMBOL]; - }, - }); -} - -if (HANDLER_INFOS) { - Object.defineProperty(InternalRouteInfo.prototype, 'handler', { - get() { - deprecate( - 'You attempted to read "handlerInfo.handler" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.route; - }, - - set(value: string) { - deprecate( - 'You attempted to set "handlerInfo.handler" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - this.route = value; - }, - }); - - Object.defineProperty(InternalTransition.prototype, 'handlerInfos', { - get() { - deprecate( - 'You attempted to use "transition.handlerInfos" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.routeInfos; - }, - }); - - Object.defineProperty(TransitionState.prototype, 'handlerInfos', { - get() { - deprecate( - 'You attempted to use "transition.state.handlerInfos" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.routeInfos; - }, - }); - - Object.defineProperty(Router.prototype, 'currentHandlerInfos', { - get() { - deprecate( - 'You attempted to use "_routerMicrolib.currentHandlerInfos" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.currentRouteInfos; - }, - }); - - Router.prototype['getHandler'] = function(name: string) { - deprecate( - 'You attempted to use "_routerMicrolib.getHandler" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.getRoute(name); - }; -} - interface RenderOutletState { name: string; outlet: string;
true
Other
emberjs
ember.js
da39c475f1f42b1544f1c95dd888db9226d05fa6.json
Remove intimate apis in the router
packages/@ember/deprecated-features/index.ts
@@ -8,9 +8,7 @@ export const EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5'; export const RUN_SYNC = !!'3.0.0-beta.4'; export const LOGGER = !!'3.2.0-beta.1'; export const MERGE = !!'3.6.0-beta.1'; -export const HANDLER_INFOS = !!'3.9.0'; -export const ROUTER_EVENTS = !!'3.9.0'; -export const TRANSITION_STATE = !!'3.9.0'; +export const ROUTER_EVENTS = !!'4.0.0'; export const COMPONENT_MANAGER_STRING_LOOKUP = !!'3.8.0'; export const JQUERY_INTEGRATION = !!'3.9.0'; export const ALIAS_METHOD = !!'3.9.0';
true
Other
emberjs
ember.js
da39c475f1f42b1544f1c95dd888db9226d05fa6.json
Remove intimate apis in the router
packages/ember/tests/routing/deprecated_handler_infos_test.js
@@ -1,68 +0,0 @@ -import { moduleFor, ApplicationTestCase } from 'internal-test-helpers'; - -moduleFor( - 'Deprecated HandlerInfos', - class extends ApplicationTestCase { - constructor() { - super(...arguments); - this.router.map(function() { - this.route('parent', function() { - this.route('child'); - this.route('sibling'); - }); - }); - } - - get routerOptions() { - return { - willTransition(oldHandlers, newHandlers, transition) { - expectDeprecation(() => { - this._routerMicrolib.currentHandlerInfos; - }, 'You attempted to use "_routerMicrolib.currentHandlerInfos" which is a private API that will be removed.'); - - expectDeprecation(() => { - this._routerMicrolib.getHandler('parent'); - }, 'You attempted to use "_routerMicrolib.getHandler" which is a private API that will be removed.'); - - oldHandlers.forEach(handler => { - expectDeprecation(() => { - handler.handler; - }, 'You attempted to read "handlerInfo.handler" which is a private API that will be removed.'); - }); - newHandlers.forEach(handler => { - expectDeprecation(() => { - handler.handler; - }, 'You attempted to read "handlerInfo.handler" which is a private API that will be removed.'); - }); - - expectDeprecation(() => { - transition.handlerInfos; - }, 'You attempted to use "transition.handlerInfos" which is a private API that will be removed.'); - - expectDeprecation(() => { - transition.state.handlerInfos; - }, 'You attempted to use "transition.state.handlerInfos" which is a private API that will be removed.'); - QUnit.assert.ok(true, 'willTransition'); - }, - - didTransition(newHandlers) { - newHandlers.forEach(handler => { - expectDeprecation(() => { - handler.handler; - }, 'You attempted to read "handlerInfo.handler" which is a private API that will be removed.'); - }); - QUnit.assert.ok(true, 'didTransition'); - }, - }; - } - - '@test handlerInfos are deprecated and associated private apis'(assert) { - let done = assert.async(); - expectDeprecation(() => { - return this.visit('/parent').then(() => { - done(); - }); - }, /You attempted to override the \"(willTransition|didTransition)\" method which is deprecated. Please inject the router service and listen to the \"(routeWillChange|routeDidChange)\" event\./); - } - } -);
true
Other
emberjs
ember.js
da39c475f1f42b1544f1c95dd888db9226d05fa6.json
Remove intimate apis in the router
packages/ember/tests/routing/deprecated_transition_state_test.js
@@ -1,42 +0,0 @@ -import { RouterTestCase, moduleFor } from 'internal-test-helpers'; - -moduleFor( - 'Deprecated Transition State', - class extends RouterTestCase { - '@test touching transition.state is deprecated'(assert) { - assert.expect(1); - return this.visit('/').then(() => { - this.routerService.on('routeWillChange', transition => { - expectDeprecation(() => { - transition.state; - }, 'You attempted to read "transition.state" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the public state on it.'); - }); - return this.routerService.transitionTo('/child'); - }); - } - - '@test touching transition.queryParams is deprecated'(assert) { - assert.expect(1); - return this.visit('/').then(() => { - this.routerService.on('routeWillChange', transition => { - expectDeprecation(() => { - transition.queryParams; - }, 'You attempted to read "transition.queryParams" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the queryParams on it.'); - }); - return this.routerService.transitionTo('/child'); - }); - } - - '@test touching transition.params is deprecated'(assert) { - assert.expect(1); - return this.visit('/').then(() => { - this.routerService.on('routeWillChange', transition => { - expectDeprecation(() => { - transition.params; - }, 'You attempted to read "transition.params" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the params on it.'); - }); - return this.routerService.transitionTo('/child'); - }); - } - } -);
true
Other
emberjs
ember.js
674d30c90a537b21d2b1ef1e3de90494727d62de.json
enable feature flag
packages/@ember/canary-features/index.ts
@@ -20,7 +20,7 @@ export const DEFAULT_FEATURES = { EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS: true, EMBER_GLIMMER_ANGLE_BRACKET_NESTED_LOOKUP: true, EMBER_ROUTING_BUILD_ROUTEINFO_METADATA: true, - EMBER_NATIVE_DECORATOR_SUPPORT: null, + EMBER_NATIVE_DECORATOR_SUPPORT: true, }; /**
false
Other
emberjs
ember.js
fd360ca8181f0812a20fd718fefcfb0ddd4befe7.json
Add missing babel helper This is needed due to https://github.com/glimmerjs/glimmer-vm/blob/e672233ea70ab2614648bb194efc107f3698baad/packages/%40glimmer/runtime/lib/compiled/opcodes/component.ts This is probably unintended and a waste of bytes. We should fix it upstream and remove this helper.
packages/external-helpers/lib/external-helpers.js
@@ -111,3 +111,9 @@ export function possibleConstructorReturn(self, call) { } return assertThisInitialized(self); } + +export function objectDestructuringEmpty(obj) { + if (DEBUG && (obj === null || obj === undefined)) { + throw new TypeError('Cannot destructure undefined'); + } +}
false
Other
emberjs
ember.js
bfa97c8eb29982f42c0ae1f5021b28609289176c.json
Upgrade Glimmer and TypeScript @glimmer/* 0.37.1 -> 0.38.1 typescript 3.0.1 -> 3.2.4
package.json
@@ -91,14 +91,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.1", + "@glimmer/compiler": "^0.38.1", "@glimmer/env": "^0.1.7", - "@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", + "@glimmer/interfaces": "^0.38.1", + "@glimmer/node": "^0.38.1", + "@glimmer/opcode-compiler": "^0.38.1", + "@glimmer/program": "^0.38.1", + "@glimmer/reference": "^0.38.1", + "@glimmer/runtime": "^0.38.1", "@types/qunit": "^2.5.4", "@types/rsvp": "^4.0.2", "auto-dist-tag": "^1.0.0", @@ -118,7 +118,7 @@ "broccoli-rollup": "^2.1.1", "broccoli-source": "^1.1.0", "broccoli-string-replace": "^0.1.2", - "broccoli-typescript-compiler": "^4.0.1", + "broccoli-typescript-compiler": "^4.1.0", "broccoli-uglify-sourcemap": "^3.1.0", "common-tags": "^1.8.0", "core-js": "^2.6.5",
true
Other
emberjs
ember.js
bfa97c8eb29982f42c0ae1f5021b28609289176c.json
Upgrade Glimmer and TypeScript @glimmer/* 0.37.1 -> 0.38.1 typescript 3.0.1 -> 3.2.4
packages/@ember/-internals/glimmer/lib/helpers/loc.ts
@@ -38,5 +38,5 @@ import { helper } from '../helper'; @public */ export default helper(function(params) { - return loc.apply(null, params); + return loc.apply(null, params as any /* let the other side handle errors */); });
true
Other
emberjs
ember.js
bfa97c8eb29982f42c0ae1f5021b28609289176c.json
Upgrade Glimmer and TypeScript @glimmer/* 0.37.1 -> 0.38.1 typescript 3.0.1 -> 3.2.4
packages/@ember/-internals/glimmer/lib/utils/references.ts
@@ -31,7 +31,7 @@ import { ConditionalReference as GlimmerConditionalReference, PrimitiveReference, } from '@glimmer/runtime'; -import { Option } from '@glimmer/util'; +import { Option, unreachable } from '@glimmer/util'; import { HelperFunction, HelperInstance, RECOMPUTE_TAG } from '../helper'; import emberToBool from './to-bool'; @@ -529,14 +529,56 @@ export function referenceFromParts( return reference; } +type Primitive = undefined | null | boolean | number | string; + +function isObject(value: Opaque): value is object { + return value !== null && typeof value === 'object'; +} + +function isFunction(value: Opaque): value is Function { + return typeof value === 'function'; +} + +function isPrimitive(value: Opaque): value is Primitive { + if (DEBUG) { + let type = typeof value; + return ( + value === undefined || + value === null || + type === 'boolean' || + type === 'number' || + type === 'string' + ); + } else { + return true; + } +} + export function valueToRef<T = Opaque>(value: T, bound = true): VersionedPathReference<T> { - if (value !== null && typeof value === 'object') { + if (isObject(value)) { // root of interop with ember objects return bound ? new RootReference(value) : new UnboundReference(value); - } - // ember doesn't do observing with functions - if (typeof value === 'function') { + } 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(); } - return PrimitiveReference.create(value); }
true
Other
emberjs
ember.js
bfa97c8eb29982f42c0ae1f5021b28609289176c.json
Upgrade Glimmer and TypeScript @glimmer/* 0.37.1 -> 0.38.1 typescript 3.0.1 -> 3.2.4
packages/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.ts
@@ -1 +1 @@ -export { isSerializationFirstNode } from '@glimmer/util'; +export { isSerializationFirstNode } from '@glimmer/runtime';
true
Other
emberjs
ember.js
bfa97c8eb29982f42c0ae1f5021b28609289176c.json
Upgrade Glimmer and TypeScript @glimmer/* 0.37.1 -> 0.38.1 typescript 3.0.1 -> 3.2.4
packages/@ember/-internals/metal/lib/transaction.ts
@@ -170,9 +170,9 @@ if (DEBUG) { let runner = new TransactionRunner(); - runInTransaction = runner.runInTransaction.bind(runner); - didRender = runner.didRender.bind(runner); - assertNotRendered = runner.assertNotRendered.bind(runner); + runInTransaction = (...args) => runner.runInTransaction(...args); + didRender = (...args) => runner.didRender(...args); + assertNotRendered = (...args) => runner.assertNotRendered(...args); } else { // in production do nothing to detect reflushes runInTransaction = <T extends object, K extends MethodKey<T>>(context: T, methodName: K) => {
true
Other
emberjs
ember.js
bfa97c8eb29982f42c0ae1f5021b28609289176c.json
Upgrade Glimmer and TypeScript @glimmer/* 0.37.1 -> 0.38.1 typescript 3.0.1 -> 3.2.4
packages/@ember/-internals/routing/lib/location/auto_location.ts
@@ -243,7 +243,7 @@ function detectImplementation(options: DetectionOptions) { if (currentPath === historyPath) { implementation = 'history'; } else if (currentPath.substr(0, 2) === '/#') { - history!.replaceState({ path: historyPath }, undefined, historyPath); + history!.replaceState({ path: historyPath }, '', historyPath); implementation = 'history'; } else { cancelRouterSetup = true;
true
Other
emberjs
ember.js
bfa97c8eb29982f42c0ae1f5021b28609289176c.json
Upgrade Glimmer and TypeScript @glimmer/* 0.37.1 -> 0.38.1 typescript 3.0.1 -> 3.2.4
packages/@ember/-internals/routing/lib/system/dsl.ts
@@ -1,58 +1,96 @@ import { Factory } from '@ember/-internals/owner'; import { assert } from '@ember/debug'; import { assign } from '@ember/polyfills'; +import { Option } from '@glimmer/interfaces'; import { MatchCallback } from 'route-recognizer'; import { EngineInfo, EngineRouteInfo } from './engines'; let uuid = 0; -interface DSLOptions { - enableLoadingSubstates: boolean; - overrideNameAssertion?: boolean; - engineInfo?: EngineInfo; - addRouteForEngine(name: string, routeOptions: EngineRouteInfo): void; - resolveRouteMap(name: string): Factory<any, any>; - path?: string; -} - -interface RouteOptions { +export interface RouteOptions { path?: string; resetNamespace?: boolean; serialize?: any; overrideNameAssertion?: boolean; } -interface MountOptions { +export interface MountOptions { path?: string; as?: string; resetNamespace?: boolean; } -class DSL { +export interface DSLCallback { + (this: DSL): void; +} + +export interface DSL { + route(name: string): void; + route(name: string, callback: DSLCallback): void; + route(name: string, options: RouteOptions): void; + route(name: string, options: RouteOptions, callback: DSLCallback): void; + + mount(name: string): void; + mount(name: string, options: MountOptions): void; +} + +function isCallback(value?: RouteOptions | DSLCallback): value is DSLCallback { + return typeof value === 'function'; +} + +function isOptions(value?: RouteOptions | DSLCallback): value is RouteOptions { + return value !== null && typeof value === 'object'; +} +export interface DSLImplOptions { + enableLoadingSubstates: boolean; + overrideNameAssertion?: boolean; + engineInfo?: EngineInfo; + addRouteForEngine(name: string, routeOptions: EngineRouteInfo): void; + resolveRouteMap(name: string): Factory<any, any>; + path?: string; +} + +export default class DSLImpl implements DSL { parent: string | null; matches: any[]; enableLoadingSubstates: boolean; explicitIndex = false; - options: DSLOptions; + options: DSLImplOptions; - constructor(name: string | null = null, options: DSLOptions) { + constructor(name: string | null = null, options: DSLImplOptions) { this.parent = name; this.enableLoadingSubstates = Boolean(options && options.enableLoadingSubstates); this.matches = []; this.options = options; } - route(name: string, options: any = {}, callback?: MatchCallback) { + /* eslint-disable no-dupe-class-members */ + route(name: string): void; + route(name: string, callback: DSLCallback): void; + route(name: string, options: RouteOptions): void; + route(name: string, options: RouteOptions, callback: DSLCallback): void; + route(name: string, _options?: RouteOptions | DSLCallback, _callback?: DSLCallback) { + let options: RouteOptions; + let callback: Option<DSLCallback> = null; + let dummyErrorRoute = `/_unused_dummy_error_path_route_${name}/:error`; - if (arguments.length === 2 && typeof options === 'function') { - callback = options; + if (isCallback(_options)) { + assert('Unexpected arguments', arguments.length === 2); options = {}; + callback = _options; + } else if (isCallback(_callback)) { + assert('Unexpected arguments', arguments.length === 3); + assert('Unexpected arguments', isOptions(_options)); + options = _options as RouteOptions; + callback = _callback; + } else { + options = _options || {}; } assert( `'${name}' cannot be used as a route name.`, (() => { - if (options!.overrideNameAssertion === true) { + if (options.overrideNameAssertion === true) { return true; } @@ -77,7 +115,7 @@ class DSL { if (callback) { let fullName = getFullName(this, name, options.resetNamespace); - let dsl = new DSL(fullName, this.options); + let dsl = new DSLImpl(fullName, this.options); createRoute(dsl, 'loading'); createRoute(dsl, 'error', { path: dummyErrorRoute }); @@ -89,6 +127,7 @@ class DSL { createRoute(this, name, options); } } + /* eslint-enable no-dupe-class-members */ push(url: string, name: string, callback?: MatchCallback, serialize?: any) { let parts = name.split('.'); @@ -129,7 +168,7 @@ class DSL { }; } - mount(_name: string, options: MountOptions = {}) { + mount(_name: string, options: Partial<MountOptions> = {}) { let engineRouteMap = this.options.resolveRouteMap(_name); let name = _name; @@ -163,7 +202,7 @@ class DSL { } let optionsForChild = assign({ engineInfo }, this.options); - let childDSL = new DSL(fullName, optionsForChild); + let childDSL = new DSLImpl(fullName, optionsForChild); createRoute(childDSL, 'loading'); createRoute(childDSL, 'error', { path: dummyErrorRoute }); @@ -207,21 +246,24 @@ class DSL { } } -export default DSL; - -function canNest(dsl: DSL) { +function canNest(dsl: DSLImpl) { return dsl.parent !== 'application'; } -function getFullName(dsl: DSL, name: string, resetNamespace?: boolean) { +function getFullName(dsl: DSLImpl, name: string, resetNamespace?: boolean) { if (canNest(dsl) && resetNamespace !== true) { return `${dsl.parent}.${name}`; } else { return name; } } -function createRoute(dsl: DSL, name: string, options: RouteOptions = {}, callback?: MatchCallback) { +function createRoute( + dsl: DSLImpl, + name: string, + options: RouteOptions = {}, + callback?: MatchCallback +) { let fullName = getFullName(dsl, name, options.resetNamespace); if (typeof options.path !== 'string') {
true