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
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/router.ts
@@ -14,7 +14,7 @@ import { cancel, once, run, scheduleOnce } from '@ember/runloop'; import { DEBUG } from '@glimmer/env'; import EmberLocation, { EmberLocation as IEmberLocation } from '../location/api'; import { calculateCacheKey, extractRouteArgs, getActiveTargetName, resemblesURL } from '../utils'; -import EmberRouterDSL from './dsl'; +import DSL from './dsl'; import Route, { defaultSerialize, hasDefaultSerialize, @@ -466,7 +466,7 @@ class EmberRouter extends EmberObject { dsl.route( 'application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, - function(this: EmberRouterDSL) { + function() { for (let i = 0; i < dslCallbacks.length; i++) { dslCallbacks[i].call(this); } @@ -482,7 +482,7 @@ class EmberRouter extends EmberObject { routerMicrolib.map(dsl.generate()); } - _buildDSL() { + _buildDSL(): DSL { let enableLoadingSubstates = this._hasModuleBasedResolver(); let router = this; let owner = getOwner(this); @@ -498,7 +498,7 @@ class EmberRouter extends EmberObject { }, }; - return new EmberRouterDSL(null, options); + return new DSL(null, options); } /*
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/debug/index.ts
@@ -242,10 +242,10 @@ if (DEBUG) { */ setDebugFunction('deprecateFunc', function deprecateFunc(...args: any[]) { if (args.length === 3) { - let [message, options, func] = args as [string, DeprecationOptions, () => any]; - return function(this: any) { + let [message, options, func] = args as [string, DeprecationOptions, (...args: any[]) => any]; + return function(this: any, ...args: any[]) { deprecate(message, false, options); - return func.apply(this, arguments); + return func.apply(this, args); }; } else { let [message, func] = args;
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/instrumentation/index.ts
@@ -111,6 +111,14 @@ const time = ((): (() => number) => { return fn ? fn.bind(perf) : Date.now; })(); +type InstrumentCallback<Binding, Result> = (this: Binding) => Result; + +function isCallback<Binding, Result>( + value: InstrumentCallback<Binding, Result> | object +): value is InstrumentCallback<Binding, Result> { + return typeof value === 'function'; +} + /** Notifies event's subscribers, calls `before` and `after` hooks. @@ -123,83 +131,107 @@ const time = ((): (() => number) => { @param {Object} binding Context that instrument function is called with. @private */ -export function instrument<T extends object>(name: string, callback: () => T, binding: object): T; -export function instrument<TPayload extends object>( +export function instrument<Result>( + name: string, + callback: InstrumentCallback<undefined, Result> +): Result; +export function instrument<Binding, Result>( + name: string, + callback: InstrumentCallback<Binding, Result>, + binding: Binding +): Result; +export function instrument<Result>( name: string, payload: object, - callback: () => TPayload, - binding: object -): TPayload; -export function instrument<TPayload extends object>( + callback: InstrumentCallback<undefined, Result> +): Result; +export function instrument<Binding, Result>( name: string, - p1: (() => TPayload) | TPayload, - p2: TPayload | (() => TPayload), - p3?: object -): TPayload { - let payload: TPayload; - let callback: () => TPayload; - let binding: object; - if (arguments.length <= 3 && typeof p1 === 'function') { - payload = {} as TPayload; + payload: object, + callback: InstrumentCallback<Binding, Result>, + binding: Binding +): Result; +export function instrument<Binding, Result>( + name: string, + p1: InstrumentCallback<Binding, Result> | object, + p2?: Binding | InstrumentCallback<Binding, Result>, + p3?: Binding +): Result { + let _payload: object | undefined; + let callback: InstrumentCallback<Binding, Result>; + let binding: Binding; + + if (arguments.length <= 3 && isCallback(p1)) { callback = p1; - binding = p2; + binding = p2 as Binding; } else { - payload = (p1 || {}) as TPayload; - callback = p2 as () => TPayload; - binding = p3 as TPayload; + _payload = p1 as object; + callback = p2 as InstrumentCallback<Binding, Result>; + binding = p3 as Binding; } + + // fast path if (subscribers.length === 0) { return callback.call(binding); } + + // avoid allocating the payload in fast path + let payload = _payload || {}; + let finalizer = _instrumentStart(name, () => payload); - if (finalizer) { - return withFinalizer(callback, finalizer, payload, binding); - } else { + if (finalizer === NOOP) { return callback.call(binding); + } else { + return withFinalizer(callback, finalizer, payload, binding); } } -let flaggedInstrument: <T, TPayload>(name: string, payload: TPayload, callback: () => T) => T; +let flaggedInstrument: <Result>(name: string, payload: object, callback: () => Result) => Result; + if (EMBER_IMPROVED_INSTRUMENTATION) { - flaggedInstrument = instrument as typeof flaggedInstrument; + flaggedInstrument = instrument; } else { - flaggedInstrument = <T, TPayload>(_name: string, _payload: TPayload, callback: () => T) => - callback(); + flaggedInstrument = function instrument<Result>( + _name: string, + _payload: object, + callback: () => Result + ): Result { + return callback(); + }; } + export { flaggedInstrument }; -function withFinalizer<T extends object>( - callback: () => T, +function withFinalizer<Binding, Result>( + callback: InstrumentCallback<Binding, Result>, finalizer: () => void, - payload: T, - binding: object -): T & PayloadWithException { - let result: T; + payload: object, + binding: Binding +): Result { try { - result = callback.call(binding); + return callback.call(binding); } catch (e) { - (payload as PayloadWithException).exception = e; - result = payload; + (payload as { exception: any }).exception = e; + throw e; } finally { finalizer(); } - return result; } function NOOP() {} // private for now -export function _instrumentStart<TPayloadParam>( +export function _instrumentStart(name: string, payloadFunc: () => object): () => void; +export function _instrumentStart<Arg>( name: string, - _payload: (_payloadParam: TPayloadParam) => object, - _payloadParam: TPayloadParam + payloadFunc: (arg: Arg) => object, + payloadArg: Arg ): () => void; -export function _instrumentStart<TPayloadParam>(name: string, _payload: () => object): () => void; -export function _instrumentStart<TPayloadParam>( +export function _instrumentStart<Arg>( name: string, - _payload: (_payloadParam: TPayloadParam) => object, - _payloadParam?: TPayloadParam + payloadFunc: ((arg: Arg) => object) | (() => object), + payloadArg?: Arg ): () => void { if (subscribers.length === 0) { return NOOP; @@ -215,7 +247,7 @@ export function _instrumentStart<TPayloadParam>( return NOOP; } - let payload = _payload(_payloadParam!); + let payload = payloadFunc(payloadArg!); let STRUCTURED_PROFILE = ENV.STRUCTURED_PROFILE; let timeName: string; @@ -224,21 +256,17 @@ export function _instrumentStart<TPayloadParam>( console.time(timeName); } - let beforeValues = new Array(listeners.length); - let i: number; - let listener: Listener<any>; + let beforeValues: any[] = []; let timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - beforeValues[i] = listener.before(name, timestamp, payload); + for (let i = 0; i < listeners.length; i++) { + let listener = listeners[i]; + beforeValues.push(listener.before(name, timestamp, payload)); } return function _instrumentEnd(): void { - let i: number; - let listener: Listener<any>; let timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; + for (let i = 0; i < listeners.length; i++) { + let listener = listeners[i]; if (typeof listener.after === 'function') { listener.after(name, timestamp, payload, beforeValues[i]); }
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/instrumentation/tests/index-test.js
@@ -149,7 +149,7 @@ moduleFor( } ['@test raising an exception in the instrumentation attaches it to the payload'](assert) { - assert.expect(2); + assert.expect(3); let error = new Error('Instrumentation'); @@ -167,9 +167,13 @@ moduleFor( }, }); - instrument('render.handlebars', null, function() { - throw error; - }); + assert.throws( + () => + instrument('render.handlebars', null, () => { + throw error; + }), + /Instrumentation/ + ); } ['@test it is possible to add a new subscriber after the first instrument'](assert) {
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
yarn.lock
@@ -747,120 +747,122 @@ lodash "^4.17.11" to-fast-properties "^2.0.0" -"@glimmer/compiler@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.37.1.tgz#a3d59e0b1e51341314d3f8202aa0d4b70dc55173" - integrity sha512-bGdRb52eWZuHEGaIa1Rl0e0f4vPpQtp+gnpsaRwBMmRLqDrCZKdEJ8jCN5bI8TMFbtvP78s/5O0qi/XK+UzO4A== +"@glimmer/compiler@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.38.1.tgz#03b43a2a8a04b1ed39517862158e8897d0f6798b" + integrity sha512-V4wRYRPH6FSVZw9dNfZn3IRxBofUBL0oGeBLm7wNdUOg4oXE26BMmxRVtYzTsBmmSj7SqB+B6VKuH1jEuvOOhQ== dependencies: - "@glimmer/interfaces" "^0.37.1" - "@glimmer/syntax" "^0.37.1" - "@glimmer/util" "^0.37.1" - "@glimmer/wire-format" "^0.37.1" + "@glimmer/interfaces" "^0.38.1" + "@glimmer/syntax" "^0.38.1" + "@glimmer/util" "^0.38.1" + "@glimmer/wire-format" "^0.38.1" -"@glimmer/encoder@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.37.1.tgz#5cd95e04043c74ee4253811a768871b02fcd12c5" - integrity sha512-XvtlyFYibYxwYBfak5NK62u/iNtOgP1hbccxJNuDgK2pwYakrnZX6KSOg/6QnFNknjJkSQ/cwpW696ROliPTfw== +"@glimmer/encoder@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.38.1.tgz#1b7fd08a83e4412148126d50cbc9c6a08739caa7" + integrity sha512-E5d15cy0F/qiFCJ67KVOxJLkbV5pebiiczjzf/zHTmL250Fj4reISoKsBt0SBWc2IJAj2En3RLEyq6WS8U1sZQ== + dependencies: + "@glimmer/interfaces" "^0.38.1" + "@glimmer/vm" "^0.38.1" "@glimmer/env@^0.1.7": version "0.1.7" resolved "https://registry.yarnpkg.com/@glimmer/env/-/env-0.1.7.tgz#fd2d2b55a9029c6b37a6c935e8c8871ae70dfa07" integrity sha1-/S0rVakCnGs3psk16MiHGucN+gc= -"@glimmer/interfaces@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.37.1.tgz#44328c49d835445fda26efa7c8d5463ee2e626ed" - integrity sha512-ys5I6iEeaPvSPY9dn6uc9NAh9HkL8fnUZjTHJhlKV5nFv5qqXhBK8hFE86fVXqGRtXLHfOa90pg75vLXgw7u/g== +"@glimmer/interfaces@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.38.1.tgz#5b1c174363396b99d6a6bddb35538151e4c4c989" + integrity sha512-YXnzRR7IviHdN+k2Llp8rQ+ADrdzme++A5EFZRxcUoD14Eu1u2S3al7FlLLfwHhp5R2leO+x3zSYoWsuzfvsqw== dependencies: - "@glimmer/wire-format" "^0.37.1" + "@glimmer/wire-format" "^0.38.1" "@simple-dom/interface" "1.4.0" -"@glimmer/low-level@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.37.1.tgz#307f818b20b8df43c04750c01eb92ead2af4b455" - integrity sha512-CIscEE0BKNMlx6PCNUJVyPWYGCwtfoYTbwUIyQdY5IeVXLvBweT8fteMmHv4HapsPCKubPPkvwwm3bgBLSq3dA== - -"@glimmer/node@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.37.1.tgz#f401e366b6b6d71a16f9aa7e3fddaeb7f9cf7b3b" - integrity sha512-eQiIhfx3MJqXhjDTqQMtzAfI+IJ+5aw0bLXjBikXHCau/lpSS6EqO12WZR1QN+K1wchdVlYkseme4wEs89fyag== - dependencies: - "@glimmer/interfaces" "^0.37.1" - "@glimmer/runtime" "^0.37.1" - -"@glimmer/opcode-compiler@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.37.1.tgz#e69eaa227ea85f2b6316f447617fedef58a38ca3" - integrity sha512-Nf6BOgcSfOUDDlExNWqjGqNUx6m6biebnMX6aEwfJwD/JrnwQuMo20/K4d8+6ZvJwqwn1Bwth9Jk3rsp7caLAw== - dependencies: - "@glimmer/encoder" "^0.37.1" - "@glimmer/interfaces" "^0.37.1" - "@glimmer/program" "^0.37.1" - "@glimmer/reference" "^0.37.1" - "@glimmer/util" "^0.37.1" - "@glimmer/vm" "^0.37.1" - "@glimmer/wire-format" "^0.37.1" - -"@glimmer/program@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.37.1.tgz#440efc86fdc2e870dfca9c678c1986c84e8ab5dc" - integrity sha512-HVaF3U1bCTH7cryMccgkxHn7/IzLfy9LGbyQK0wgeiHsY+xCSBb7Kq1WP4LPUH8+84/BzEpuLJN7u2n5GGdZlw== - dependencies: - "@glimmer/encoder" "^0.37.1" - "@glimmer/interfaces" "^0.37.1" - "@glimmer/util" "^0.37.1" - -"@glimmer/reference@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.37.1.tgz#a444a56eb3e79d9d6d991c423f32c6491778d57b" - integrity sha512-nGelUwaQ1jBnI1OH80JV3cMiWfjgsi399y61ajARiHjl1DK8gXchZ0qLpNu83Sa5UbL09AMbVaUTb8xsy6MFwA== - dependencies: - "@glimmer/util" "^0.37.1" - -"@glimmer/runtime@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.37.1.tgz#3f690f003d00af710823449afadeaf01e379533e" - integrity sha512-ujkaODl2DDrwOttXZTcobH8ML4eSpgepnPpsYYEafCBXxKxkTWHV7JzSuuh3/hnHZVdrRO/vP6zIJ0P86FXBLQ== - dependencies: - "@glimmer/interfaces" "^0.37.1" - "@glimmer/low-level" "^0.37.1" - "@glimmer/program" "^0.37.1" - "@glimmer/reference" "^0.37.1" - "@glimmer/util" "^0.37.1" - "@glimmer/vm" "^0.37.1" - "@glimmer/wire-format" "^0.37.1" +"@glimmer/low-level@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.38.1.tgz#101147d71a4f1ca1874e45e16a7a777fa8f65d46" + integrity sha512-XydeZ5XzLFKLxtnwsy4Zu3WHJfL4/XYzs24KLaW4HeDxKfhVnJxr2hVWfpF17I3Q35yCOLdbSWp+igVHFA4/7w== + +"@glimmer/node@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.38.1.tgz#46d18041207953218bf841110b5c4d1db11eb3ac" + integrity sha512-okAyjPhrUy4d4txuz2qXxo5z2gGZg3e4gjFPpTDKOZRGhWZMAa1mu0KEtnCHtJ4unvhJBBNI7TdSHQX+492Tlw== + dependencies: + "@glimmer/interfaces" "^0.38.1" + "@glimmer/runtime" "^0.38.1" + +"@glimmer/opcode-compiler@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.38.1.tgz#da4e871e13ca87c8d80ebb905d0ff2c51c7d9a84" + integrity sha512-p5VdtZDWrW8F3gKS6/DoFGIwpWoquiswAP2XyyQPlXI7IsbnxUhwLd0uQa/rjTPkOIH3okDW/h6ZVAEqEdwTKg== + dependencies: + "@glimmer/encoder" "^0.38.1" + "@glimmer/interfaces" "^0.38.1" + "@glimmer/program" "^0.38.1" + "@glimmer/reference" "^0.38.1" + "@glimmer/util" "^0.38.1" + "@glimmer/vm" "^0.38.1" + "@glimmer/wire-format" "^0.38.1" + +"@glimmer/program@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.38.1.tgz#cb50934749fc88843f925d5c9c43ba673de9f473" + integrity sha512-nipMJiYx9ufZkt2iKlNdoi22U2asZ16NUhEllsd/fVw07+CwjI2Ylf93CFtWGDxjQ0qr9ZGPWFk1D7O7Gm6kmA== + dependencies: + "@glimmer/encoder" "^0.38.1" + "@glimmer/interfaces" "^0.38.1" + "@glimmer/util" "^0.38.1" + +"@glimmer/reference@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.38.1.tgz#555bcf90b7e5ea8d39d1089e2bd6a2da14b56184" + integrity sha512-iGuTZhHc0NTw9i7eVdCnbENPGHzJecfPCNNQ1GUm5rsY1/NnLB4tNAEioDz81HAJygOHhnMZgb9YqLEwcwnONw== + dependencies: + "@glimmer/util" "^0.38.1" + +"@glimmer/runtime@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.38.1.tgz#abe0b4affbe29dfe5b15307713a1c03a83fdc41b" + integrity sha512-zArtVsLNXV7VY+1Y8iaouOKvvAdNx1Ios5od7EH3RqAvkx4wxXNBKEAEG4ecj2avxELw+SwhajB/eGBbgBB8ng== + dependencies: + "@glimmer/interfaces" "^0.38.1" + "@glimmer/low-level" "^0.38.1" + "@glimmer/program" "^0.38.1" + "@glimmer/reference" "^0.38.1" + "@glimmer/util" "^0.38.1" + "@glimmer/vm" "^0.38.1" + "@glimmer/wire-format" "^0.38.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.37.1.tgz#f3c507122f7c4b859ce712e0c5bbc43608ca12db" - integrity sha512-DtSRWrbZlgAvLOR62slBvMgUmcnYxfq4Jv5uqCqD4/DUrjV2ezmOMhDFW4zxAVz55luqx9/900XHYiUzsicPyA== +"@glimmer/syntax@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.38.1.tgz#625875da5f1e827ad5806fdaa23e2cd00369fda8" + integrity sha512-tzc1NeUd7hbBWqIlgSY5Oq8bEiMpp7ClawVt8hWUarbr9G+qR0toDEQYqZmeRtCXjHAIh9M9oYbpbzLP6+iiag== dependencies: - "@glimmer/interfaces" "^0.37.1" - "@glimmer/util" "^0.37.1" + "@glimmer/interfaces" "^0.38.1" + "@glimmer/util" "^0.38.1" handlebars "^4.0.6" simple-html-tokenizer "^0.5.6" -"@glimmer/util@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.37.1.tgz#b6dafd36134556053121fc8a8ffceb68e490a4b5" - integrity sha512-Of58Of07fsT8JOkok/tXJvewEdI6LzDxdlIIcdhv6iOJgYUsJUQKUYf6XY+5o/rtsrByPQ5da2WwHbLAcpq0aQ== +"@glimmer/util@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.38.1.tgz#41ca0544f95ec980bc492f4f0e5a85564964c028" + integrity sha512-WAe+bqJSFBR8EmA/NsxcqWmyi2AfOyW9x1jpWczZHJiBkvssiRF6nre39CJVwwMPlFDtdKzvnRQkWVl8ZBhcNw== -"@glimmer/vm@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.37.1.tgz#26ad736b1228dac88fd8c1b9ce2b8ffefa91bdc0" - integrity sha512-EIhJoDrXX+WW3vyovTiEQSYwdbAQgaJKGR25mkMKGLSwvIu4RcX2d9uUPSkm+pBvijHNk2f67q86k1s6j8cBIQ== +"@glimmer/vm@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.38.1.tgz#30f5bb659c42fbe69a6b5cf42a06c6bd815721ac" + integrity sha512-pxmdJp0GskbwBz7WFvBNWaeoP1+977A0cFnEc3U+GbLBCmyrCq7mRQwFYSRBI8B5/6CkzWhsGXj42Qrkk34m3Q== dependencies: - "@glimmer/interfaces" "^0.37.1" - "@glimmer/program" "^0.37.1" - "@glimmer/util" "^0.37.1" + "@glimmer/interfaces" "^0.38.1" + "@glimmer/util" "^0.38.1" -"@glimmer/wire-format@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.37.1.tgz#34906e320d38bc65b1730b5f78890b184211a0d5" - integrity sha512-iDj8D1eCVDmcsNUcz5epdOCN6Gt53W3cMsS2qAkf2H6REiXQ9kG7ySIGIdahNsLT/f21MT+JzqawylZR0hrw0w== +"@glimmer/wire-format@^0.38.1": + version "0.38.1" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.38.1.tgz#a77963cf7193ab23cbce242116aac613f17cd3dc" + integrity sha512-AT1dToybQxbY29XpkNra9/j7svq65ZNnSXmRs1zUKAarvgh6qxOBsnYeVBNrxBFduNuNJOxP8G0Y+nXEGrUoRQ== dependencies: - "@glimmer/util" "^0.37.1" + "@glimmer/util" "^0.38.1" "@simple-dom/document@^1.4.0": version "1.4.0" @@ -1894,18 +1896,18 @@ broccoli-string-replace@^0.1.2: broccoli-persistent-filter "^1.1.5" minimatch "^3.0.3" -broccoli-typescript-compiler@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/broccoli-typescript-compiler/-/broccoli-typescript-compiler-4.0.1.tgz#7a03e003b3032acf9a2feaae973ae2e257393d04" - integrity sha512-3psnblHnaMTfh3sE9lkLTKs8XjK563vbKMh/1mslmabqt9wuAOfTMUNEMbmGCofVoMUd9C/ydrmN5eZ6mJUNpQ== +broccoli-typescript-compiler@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/broccoli-typescript-compiler/-/broccoli-typescript-compiler-4.1.0.tgz#8511b73a7b019f6b6267679df64e211ca65ba036" + integrity sha512-pz+hQMlfwvklezPB1K4COYdf5SIQX6Dl4bdLX/R0uTNEJAwVa3Is/4YSXXm2L+LQdfMCZSXzqjbC5AGgvdbB6A== dependencies: broccoli-funnel "^2.0.1" broccoli-merge-trees "^3.0.0" broccoli-plugin "^1.3.0" fs-tree-diff "^0.5.7" heimdalljs "0.3.3" md5-hex "^2.0.0" - typescript "~3.0.1" + typescript "~3.2.1" walk-sync "^0.3.2" broccoli-uglify-sourcemap@^3.1.0: @@ -8132,10 +8134,10 @@ [email protected]: lodash.unescape "4.0.1" semver "5.5.0" -typescript@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb" - integrity sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg== +typescript@~3.2.1: + version "3.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" + integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== uc.micro@^1.0.0, uc.micro@^1.0.1: version "1.0.6"
true
Other
emberjs
ember.js
7255233fa5e92a8d3389a8accefd20817c132a85.json
Add v3.9.0-beta.5 to CHANGELOG [ci skip] (cherry picked from commit 1e2672cddfd7bc277c8073472635b1b6ab111200)
CHANGELOG.md
@@ -1,5 +1,9 @@ # 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
false
Other
emberjs
ember.js
c3e93c7a1481c2490de3f06c44c04ac845bd3539.json
Add examples to the urlFor RouterService method
packages/@ember/-internals/routing/lib/services/router.ts
@@ -137,7 +137,60 @@ export default class RouterService extends Service { } /** - Generate a URL based on the supplied route name. + Generate a URL based on the supplied route name and optionally a model. The + URL is returned as a string that can be used for any purpose. + + In this example, the URL for the `author.books` route for a given author + is copied to the clipboard. + + ```app/components/copy-link.js + import Component from '@ember/component'; + import {inject as service} from '@ember/service'; + + export default Component.extend({ + router: service('router'), + clipboard: service('clipboard') + + // Provided in the template + // { id: 'tomster', name: 'Tomster' } + author: null, + + copyBooksURL() { + if (this.author) { + const url = this.router.urlFor('author.books', this.author); + this.clipboard.set(url); + // Clipboard now has /author/tomster/books + } + } + }); + ``` + + Just like with `transitionTo` and `replaceWith`, `urlFor` can also handle + query parameters. + + ```app/components/copy-link.js + import Component from '@ember/component'; + import {inject as service} from '@ember/service'; + + export default Component.extend({ + router: service('router'), + clipboard: service('clipboard') + + // Provided in the template + // { id: 'tomster', name: 'Tomster' } + author: null, + + copyOnlyEmberBooksURL() { + if (this.author) { + const url = this.router.urlFor('author.books', this.author, { + queryParams: { filter: 'emberjs' } + }); + this.clipboard.set(url); + // Clipboard now has /author/tomster/books?filter=emberjs + } + } + }); + ``` @method urlFor @param {String} routeName the name of the route
false
Other
emberjs
ember.js
3a2ef238f179a65f39bbd4adfac0cb2aa4b03cb2.json
Fix mixin blueprint tests under Windows Uncovered in https://github.com/typed-ember/ember-cli-typescript-blueprints/pull/74, tests fail under Windows due to hardcoded line ending character.
node-tests/blueprints/mixin-test.js
@@ -6,6 +6,7 @@ const emberNew = blueprintHelpers.emberNew; const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy; const setupPodConfig = blueprintHelpers.setupPodConfig; const expectError = require('../helpers/expect-error'); +const EOL = require('os').EOL; const chai = require('ember-cli-blueprint-test-helpers/chai'); const expect = chai.expect; @@ -25,7 +26,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo'], _file => { expect(_file('app/mixins/foo.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo-test.js')).to.contain( "import FooMixin from 'my-app/mixins/foo';" @@ -37,7 +38,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar'], _file => { expect(_file('app/mixins/foo/bar.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain( "import FooBarMixin from 'my-app/mixins/foo/bar';" @@ -57,7 +58,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo', '--pod'], _file => { expect(_file('app/mixins/foo.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo-test.js')).to.contain( "import FooMixin from 'my-app/mixins/foo';" @@ -69,7 +70,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], _file => { expect(_file('app/mixins/foo/bar.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain( "import FooBarMixin from 'my-app/mixins/foo/bar';" @@ -94,7 +95,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo', '--pod'], _file => { expect(_file('app/mixins/foo.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo-test.js')).to.contain( "import FooMixin from 'my-app/mixins/foo';" @@ -106,7 +107,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], _file => { expect(_file('app/mixins/foo/bar.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain( "import FooBarMixin from 'my-app/mixins/foo/bar';" @@ -127,7 +128,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo'], _file => { expect(_file('src/mixins/foo.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('src/mixins/foo-test.js')).to.contain( "import FooMixin from 'my-app/mixins/foo';" @@ -139,7 +140,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar'], _file => { expect(_file('src/mixins/foo/bar.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('src/mixins/foo/bar-test.js')).to.contain( "import FooBarMixin from 'my-app/mixins/foo/bar';" @@ -151,7 +152,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => { expect(_file('src/mixins/foo/bar/baz.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('src/mixins/foo/bar/baz-test.js')).to.contain( "import FooBarBazMixin from 'my-app/mixins/foo/bar/baz';" @@ -176,7 +177,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo'], _file => { expect(_file('addon/mixins/foo.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo-test.js')).to.contain( "import FooMixin from 'my-addon/mixins/foo';" @@ -190,7 +191,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar'], _file => { expect(_file('addon/mixins/foo/bar.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain( "import FooBarMixin from 'my-addon/mixins/foo/bar';" @@ -204,7 +205,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => { expect(_file('addon/mixins/foo/bar/baz.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain( "import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';" @@ -218,7 +219,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--dummy'], _file => { expect(_file('tests/dummy/app/mixins/foo/bar/baz.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('addon/mixins/foo/bar/baz.js')).to.not.exist; }); @@ -236,7 +237,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo'], _file => { expect(_file('src/mixins/foo.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('src/mixins/foo-test.js')).to.contain( "import FooMixin from 'my-addon/mixins/foo';" @@ -248,7 +249,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar'], _file => { expect(_file('src/mixins/foo/bar.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('src/mixins/foo/bar-test.js')).to.contain( "import FooBarMixin from 'my-addon/mixins/foo/bar';" @@ -260,7 +261,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => { expect(_file('src/mixins/foo/bar/baz.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('src/mixins/foo/bar/baz-test.js')).to.contain( "import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';" @@ -272,7 +273,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--dummy'], _file => { expect(_file('tests/dummy/src/mixins/foo/bar/baz.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('src/mixins/foo/bar/baz.js')).to.not.exist; }); @@ -288,7 +289,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo', '--in-repo-addon=my-addon'], _file => { expect(_file('lib/my-addon/addon/mixins/foo.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo-test.js')).to.contain( "import FooMixin from 'my-addon/mixins/foo';" @@ -300,7 +301,7 @@ describe('Blueprint: mixin', function() { return emberGenerateDestroy(['mixin', 'foo/bar', '--in-repo-addon=my-addon'], _file => { expect(_file('lib/my-addon/addon/mixins/foo/bar.js')) .to.contain("import Mixin from '@ember/object/mixin';") - .to.contain('export default Mixin.create({\n});'); + .to.contain(`export default Mixin.create({${EOL}});`); expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain( "import FooBarMixin from 'my-addon/mixins/foo/bar';"
false
Other
emberjs
ember.js
6c60eee651e27a4bda70112b1d3e9badac7fbf93.json
Remove EMBER_ENGINES_MOUNT_PARAMS feature.
packages/@ember/-internals/glimmer/lib/component-managers/mount.ts
@@ -7,7 +7,6 @@ import { Destroyable, Opaque, Option } from '@glimmer/util'; import { Owner } from '@ember/-internals/owner'; import { generateControllerFactory } from '@ember/-internals/routing'; import { OwnedTemplateMeta } from '@ember/-internals/views'; -import { EMBER_ENGINES_MOUNT_PARAMS } from '@ember/canary-features'; import Environment from '../environment'; import RuntimeResolver from '../resolver'; import { OwnedTemplate } from '../template'; @@ -87,27 +86,21 @@ class MountManager let self: RootReference<any>; let bucket: EngineState | EngineWithModelState; let tag: Tag; - if (EMBER_ENGINES_MOUNT_PARAMS) { - let modelRef = state.modelRef; - if (modelRef === undefined) { - controller = controllerFactory.create(); - self = new RootReference(controller); - tag = CONSTANT_TAG; - bucket = { engine, controller, self, tag }; - } else { - let model = modelRef.value(); - let modelRev = modelRef.tag.value(); - controller = controllerFactory.create({ model }); - self = new RootReference(controller); - tag = modelRef.tag; - bucket = { engine, controller, self, tag, modelRef, modelRev }; - } - } else { + let modelRef = state.modelRef; + if (modelRef === undefined) { controller = controllerFactory.create(); self = new RootReference(controller); tag = CONSTANT_TAG; bucket = { engine, controller, self, tag }; + } else { + let model = modelRef.value(); + let modelRev = modelRef.tag.value(); + controller = controllerFactory.create({ model }); + self = new RootReference(controller); + tag = modelRef.tag; + bucket = { engine, controller, self, tag, modelRef, modelRev }; } + return bucket; } @@ -130,13 +123,11 @@ class MountManager } update(bucket: EngineWithModelState): void { - if (EMBER_ENGINES_MOUNT_PARAMS) { - let { controller, modelRef, modelRev } = bucket; - if (!modelRef.tag.validate(modelRev!)) { - let model = modelRef.value(); - bucket.modelRev = modelRef.tag.value(); - controller.set('model', model); - } + let { controller, modelRef, modelRev } = bucket; + if (!modelRef.tag.validate(modelRev!)) { + let model = modelRef.value(); + bucket.modelRev = modelRef.tag.value(); + controller.set('model', model); } } }
true
Other
emberjs
ember.js
6c60eee651e27a4bda70112b1d3e9badac7fbf93.json
Remove EMBER_ENGINES_MOUNT_PARAMS feature.
packages/@ember/-internals/glimmer/lib/syntax/mount.ts
@@ -2,7 +2,6 @@ @module ember */ import { OwnedTemplateMeta } from '@ember/-internals/views'; -import { EMBER_ENGINES_MOUNT_PARAMS } from '@ember/canary-features'; import { assert } from '@ember/debug'; import { Opaque, Option } from '@glimmer/interfaces'; import { OpcodeBuilder } from '@glimmer/opcode-compiler'; @@ -74,17 +73,10 @@ export function mountMacro( hash: Option<WireFormat.Core.Hash>, builder: OpcodeBuilder<OwnedTemplateMeta> ) { - if (EMBER_ENGINES_MOUNT_PARAMS) { - assert( - 'You can only pass a single positional argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', - params!.length === 1 - ); - } else { - assert( - 'You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', - params!.length === 1 && hash === null - ); - } + assert( + 'You can only pass a single positional argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', + params!.length === 1 + ); let expr: WireFormat.Expressions.Helper = [WireFormat.Ops.Helper, '-mount', params || [], hash]; builder.dynamicComponent(expr, null, [], null, false, null, null);
true
Other
emberjs
ember.js
6c60eee651e27a4bda70112b1d3e9badac7fbf93.json
Remove EMBER_ENGINES_MOUNT_PARAMS feature.
packages/@ember/-internals/glimmer/tests/integration/mount-test.js
@@ -5,31 +5,17 @@ import { compile, Component } from '../utils/helpers'; import Controller from '@ember/controller'; import { set } from '@ember/-internals/metal'; import Engine, { getEngineParent } from '@ember/engine'; -import { EMBER_ENGINES_MOUNT_PARAMS } from '@ember/canary-features'; -if (EMBER_ENGINES_MOUNT_PARAMS) { - moduleFor( - '{{mount}} single param assertion', - class extends RenderingTestCase { - ['@test it asserts that only a single param is passed']() { - expectAssertion(() => { - this.render('{{mount "chat" "foo"}}'); - }, /You can only pass a single positional argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}./i); - } - } - ); -} else { - moduleFor( - '{{mount}} single param assertion', - class extends RenderingTestCase { - ['@test it asserts that only a single param is passed']() { - expectAssertion(() => { - this.render('{{mount "chat" "foo"}}'); - }, /You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}./i); - } +moduleFor( + '{{mount}} single param assertion', + class extends RenderingTestCase { + ['@test it asserts that only a single param is passed']() { + expectAssertion(() => { + this.render('{{mount "chat" "foo"}}'); + }, /You can only pass a single positional argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}./i); } - ); -} + } +); moduleFor( '{{mount}} assertions', @@ -298,128 +284,126 @@ moduleFor( } ); -if (EMBER_ENGINES_MOUNT_PARAMS) { - moduleFor( - '{{mount}} params tests', - class extends ApplicationTestCase { - constructor() { - super(...arguments); - - this.add( - 'engine:paramEngine', - Engine.extend({ - router: null, - init() { - this._super(...arguments); - this.register( - 'template:application', - compile('<h2>Param Engine: {{model.foo}}</h2>', { - moduleName: 'my-app/templates/application.hbs', - }) - ); - }, - }) - ); - } +moduleFor( + '{{mount}} params tests', + class extends ApplicationTestCase { + constructor() { + super(...arguments); - ['@test it renders with static parameters']() { - this.router.map(function() { - this.route('engine-params-static'); - }); - this.addTemplate('engine-params-static', '{{mount "paramEngine" model=(hash foo="bar")}}'); + this.add( + 'engine:paramEngine', + Engine.extend({ + router: null, + init() { + this._super(...arguments); + this.register( + 'template:application', + compile('<h2>Param Engine: {{model.foo}}</h2>', { + moduleName: 'my-app/templates/application.hbs', + }) + ); + }, + }) + ); + } - return this.visit('/engine-params-static').then(() => { - this.assertInnerHTML('<h2>Param Engine: bar</h2>'); - }); - } + ['@test it renders with static parameters']() { + this.router.map(function() { + this.route('engine-params-static'); + }); + this.addTemplate('engine-params-static', '{{mount "paramEngine" model=(hash foo="bar")}}'); - ['@test it renders with bound parameters']() { - this.router.map(function() { - this.route('engine-params-bound'); - }); - let controller; - this.add( - 'controller:engine-params-bound', - Controller.extend({ - boundParamValue: null, - init() { - this._super(); - controller = this; - }, - }) - ); - this.addTemplate( - 'engine-params-bound', - '{{mount "paramEngine" model=(hash foo=boundParamValue)}}' - ); + return this.visit('/engine-params-static').then(() => { + this.assertInnerHTML('<h2>Param Engine: bar</h2>'); + }); + } + + ['@test it renders with bound parameters']() { + this.router.map(function() { + this.route('engine-params-bound'); + }); + let controller; + this.add( + 'controller:engine-params-bound', + Controller.extend({ + boundParamValue: null, + init() { + this._super(); + controller = this; + }, + }) + ); + this.addTemplate( + 'engine-params-bound', + '{{mount "paramEngine" model=(hash foo=boundParamValue)}}' + ); - return this.visit('/engine-params-bound').then(() => { - this.assertInnerHTML('<h2>Param Engine: </h2>'); + return this.visit('/engine-params-bound').then(() => { + this.assertInnerHTML('<h2>Param Engine: </h2>'); - runTask(() => set(controller, 'boundParamValue', 'bar')); + runTask(() => set(controller, 'boundParamValue', 'bar')); - this.assertInnerHTML('<h2>Param Engine: bar</h2>'); + this.assertInnerHTML('<h2>Param Engine: bar</h2>'); - runTask(() => set(controller, 'boundParamValue', undefined)); + runTask(() => set(controller, 'boundParamValue', undefined)); - this.assertInnerHTML('<h2>Param Engine: </h2>'); + this.assertInnerHTML('<h2>Param Engine: </h2>'); - runTask(() => set(controller, 'boundParamValue', 'bar')); + runTask(() => set(controller, 'boundParamValue', 'bar')); - this.assertInnerHTML('<h2>Param Engine: bar</h2>'); + this.assertInnerHTML('<h2>Param Engine: bar</h2>'); - runTask(() => set(controller, 'boundParamValue', 'baz')); + runTask(() => set(controller, 'boundParamValue', 'baz')); - this.assertInnerHTML('<h2>Param Engine: baz</h2>'); + this.assertInnerHTML('<h2>Param Engine: baz</h2>'); - runTask(() => set(controller, 'boundParamValue', 'bar')); + runTask(() => set(controller, 'boundParamValue', 'bar')); - this.assertInnerHTML('<h2>Param Engine: bar</h2>'); + this.assertInnerHTML('<h2>Param Engine: bar</h2>'); - runTask(() => set(controller, 'boundParamValue', null)); + runTask(() => set(controller, 'boundParamValue', null)); - this.assertInnerHTML('<h2>Param Engine: </h2>'); - }); - } + this.assertInnerHTML('<h2>Param Engine: </h2>'); + }); + } - ['@test it renders contextual components passed as parameter values']() { - this.router.map(function() { - this.route('engine-params-contextual-component'); - }); + ['@test it renders contextual components passed as parameter values']() { + this.router.map(function() { + this.route('engine-params-contextual-component'); + }); - this.addComponent('foo-component', { - template: `foo-component rendered! - {{app-bar-component}}`, - }); - this.addComponent('app-bar-component', { - ComponentClass: Component.extend({ tagName: '' }), - template: 'rendered app-bar-component from the app', - }); - this.add( - 'engine:componentParamEngine', - Engine.extend({ - router: null, - init() { - this._super(...arguments); - this.register( - 'template:application', - compile('{{model.foo}}', { - moduleName: 'my-app/templates/application.hbs', - }) - ); - }, - }) - ); - this.addTemplate( - 'engine-params-contextual-component', - '{{mount "componentParamEngine" model=(hash foo=(component "foo-component"))}}' - ); + this.addComponent('foo-component', { + template: `foo-component rendered! - {{app-bar-component}}`, + }); + this.addComponent('app-bar-component', { + ComponentClass: Component.extend({ tagName: '' }), + template: 'rendered app-bar-component from the app', + }); + this.add( + 'engine:componentParamEngine', + Engine.extend({ + router: null, + init() { + this._super(...arguments); + this.register( + 'template:application', + compile('{{model.foo}}', { + moduleName: 'my-app/templates/application.hbs', + }) + ); + }, + }) + ); + this.addTemplate( + 'engine-params-contextual-component', + '{{mount "componentParamEngine" model=(hash foo=(component "foo-component"))}}' + ); - return this.visit('/engine-params-contextual-component').then(() => { - this.assertComponentElement(this.firstChild, { - content: 'foo-component rendered! - rendered app-bar-component from the app', - }); + return this.visit('/engine-params-contextual-component').then(() => { + this.assertComponentElement(this.firstChild, { + content: 'foo-component rendered! - rendered app-bar-component from the app', }); - } + }); } - ); -} + } +);
true
Other
emberjs
ember.js
6c60eee651e27a4bda70112b1d3e9badac7fbf93.json
Remove EMBER_ENGINES_MOUNT_PARAMS feature.
packages/@ember/canary-features/index.ts
@@ -15,7 +15,6 @@ import { assign } from '@ember/polyfills'; export const DEFAULT_FEATURES = { EMBER_LIBRARIES_ISREGISTERED: null, EMBER_IMPROVED_INSTRUMENTATION: null, - EMBER_ENGINES_MOUNT_PARAMS: true, EMBER_MODULE_UNIFICATION: null, EMBER_METAL_TRACKED_PROPERTIES: null, EMBER_GLIMMER_ANGLE_BRACKET_NESTED_LOOKUP: null, @@ -71,7 +70,6 @@ function featureValue(value: null | boolean) { export const EMBER_LIBRARIES_ISREGISTERED = featureValue(FEATURES.EMBER_LIBRARIES_ISREGISTERED); export const EMBER_IMPROVED_INSTRUMENTATION = featureValue(FEATURES.EMBER_IMPROVED_INSTRUMENTATION); -export const EMBER_ENGINES_MOUNT_PARAMS = featureValue(FEATURES.EMBER_ENGINES_MOUNT_PARAMS); export const EMBER_MODULE_UNIFICATION = featureValue(FEATURES.EMBER_MODULE_UNIFICATION); export const EMBER_METAL_TRACKED_PROPERTIES = featureValue(FEATURES.EMBER_METAL_TRACKED_PROPERTIES); export const EMBER_GLIMMER_ANGLE_BRACKET_NESTED_LOOKUP = featureValue(
true
Other
emberjs
ember.js
1aa923929ab8d742ed1fac3f528704787059f662.json
Fix initializer blueprint for ember-mocha 0.14 The previous PR #17411 and its last-minute change to remove `setupTest()` introduced a very stupid error! 🤦‍♂️
blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
@@ -1,12 +1,12 @@ import { expect } from 'chai'; -import { describe, it } from 'mocha'; +import { describe, it, beforeEach, afterEach } from 'mocha'; import { setupTest } from 'ember-mocha'; import Application from '@ember/application'; import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>'; <% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %> describe('<%= friendlyTestName %>', function() { - hooks.beforeEach(function() { + beforeEach(function() { this.TestApplication = Application.extend(); this.TestApplication.initializer({ name: 'initializer under test', @@ -16,7 +16,7 @@ describe('<%= friendlyTestName %>', function() { this.application = this.TestApplication.create({ autoboot: false }); }); - hooks.afterEach(function() { + afterEach(function() { <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %> });
true
Other
emberjs
ember.js
1aa923929ab8d742ed1fac3f528704787059f662.json
Fix initializer blueprint for ember-mocha 0.14 The previous PR #17411 and its last-minute change to remove `setupTest()` introduced a very stupid error! 🤦‍♂️
node-tests/fixtures/initializer-test/mocha-rfc232.js
@@ -1,12 +1,12 @@ import { expect } from 'chai'; -import { describe, it } from 'mocha'; +import { describe, it, beforeEach, afterEach } from 'mocha'; import { setupTest } from 'ember-mocha'; import Application from '@ember/application'; import { initialize } from 'my-app/initializers/foo'; import { run } from '@ember/runloop'; describe('Unit | Initializer | foo', function() { - hooks.beforeEach(function() { + beforeEach(function() { this.TestApplication = Application.extend(); this.TestApplication.initializer({ name: 'initializer under test', @@ -16,7 +16,7 @@ describe('Unit | Initializer | foo', function() { this.application = this.TestApplication.create({ autoboot: false }); }); - hooks.afterEach(function() { + afterEach(function() { run(this.application, 'destroy'); });
true
Other
emberjs
ember.js
1aa923929ab8d742ed1fac3f528704787059f662.json
Fix initializer blueprint for ember-mocha 0.14 The previous PR #17411 and its last-minute change to remove `setupTest()` introduced a very stupid error! 🤦‍♂️
node-tests/fixtures/initializer-test/module-unification/mocha-rfc232.js
@@ -1,12 +1,12 @@ import { expect } from 'chai'; -import { describe, it } from 'mocha'; +import { describe, it, beforeEach, afterEach } from 'mocha'; import { setupTest } from 'ember-mocha'; import Application from '@ember/application'; import { initialize } from 'my-app/init/initializers/foo'; import { run } from '@ember/runloop'; describe('Unit | Initializer | foo', function() { - hooks.beforeEach(function() { + beforeEach(function() { this.TestApplication = Application.extend(); this.TestApplication.initializer({ name: 'initializer under test', @@ -16,7 +16,7 @@ describe('Unit | Initializer | foo', function() { this.application = this.TestApplication.create({ autoboot: false }); }); - hooks.afterEach(function() { + afterEach(function() { run(this.application, 'destroy'); });
true
Other
emberjs
ember.js
9b907dbf0a22be04943656dc43836f8bc495fdec.json
Add v3.9.0-beta.4 to CHANGELOG [ci skip] (cherry picked from commit fc75c3bd63ad10851bd7731e1d7deb7ecff8a76a)
CHANGELOG.md
@@ -1,5 +1,9 @@ # Ember Changelog +### 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.
false
Other
emberjs
ember.js
82a7e36a11a9a55b8bdc0cc1603d4ce783508aed.json
remove init and add types to router
packages/@ember/-internals/routing/lib/system/router.ts
@@ -248,6 +248,11 @@ interface OutletState { outlets: NestedOutletState; } +interface EngineInstance extends Owner { + boot(): void; + destroy(): void; +} + export interface QueryParam { prop: string; urlKey: string; @@ -280,6 +285,27 @@ class EmberRouter extends EmberObject { rootURL!: string; _routerMicrolib!: Router<Route>; + currentURL: string | null = null; + currentRouteName: string | null = null; + currentPath: string | null = null; + + _qpCache = Object.create(null); + _qpUpdates = new Set(); + + _handledErrors = new Set(); + _engineInstances: { [name: string]: { [id: string]: EngineInstance } } = Object.create(null); + _engineInfoByRoute = Object.create(null); + + constructor() { + super(...arguments); + + if (EMBER_ROUTING_ROUTER_SERVICE) { + this.currentRoute = null; + } + + this._resetQueuedQueryParameterChanges(); + } + _initRouterJs() { let location = get(this, 'location'); let router = this; @@ -501,25 +527,6 @@ class EmberRouter extends EmberObject { return new EmberRouterDSL(null, options); } - init() { - this._super(...arguments); - - this.currentURL = null; - this.currentRouteName = null; - this.currentPath = null; - - if (EMBER_ROUTING_ROUTER_SERVICE) { - this.currentRoute = null; - } - - this._qpCache = Object.create(null); - this._qpUpdates = new Set(); - this._resetQueuedQueryParameterChanges(); - this._handledErrors = new Set(); - this._engineInstances = Object.create(null); - this._engineInfoByRoute = Object.create(null); - } - /* Resets all pending query parameter changes. Called after transitioning to a new route @@ -592,7 +599,7 @@ class EmberRouter extends EmberObject { } let routeInfos = this._routerMicrolib.currentRouteInfos; - let route; + let route: Route | undefined; let defaultParentState: OutletState; let liveRoutes = null; @@ -825,8 +832,8 @@ class EmberRouter extends EmberObject { } _setupLocation() { - let location = get(this, 'location'); - let rootURL = get(this, 'rootURL'); + let location = this.location; + let rootURL = this.rootURL; let owner = getOwner(this); if ('string' === typeof location && owner) { @@ -1735,7 +1742,7 @@ EmberRouter.reopenClass({ }, _routePath(routeInfos: PrivateRouteInfo[]) { - let path = []; + let path: string[] = []; // We have to handle coalescing resource names that // are prefixed with their parent's names, e.g.
false
Other
emberjs
ember.js
bff547d15646b3fba3a5700b5ca16f0adfc39f2c.json
Instance-initializer blueprint: destroy instance before application See https://github.com/emberjs/ember.js/pull/17412#discussion_r26304
blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
@@ -15,8 +15,8 @@ module('<%= friendlyTestName %>', function(hooks) { this.instance = this.application.buildInstance(); }); hooks.afterEach(function() { - <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %> <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %> + <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %> }); // Replace this with your real tests.
true
Other
emberjs
ember.js
bff547d15646b3fba3a5700b5ca16f0adfc39f2c.json
Instance-initializer blueprint: destroy instance before application See https://github.com/emberjs/ember.js/pull/17412#discussion_r26304
node-tests/fixtures/instance-initializer-test/module-unification/rfc232.js
@@ -15,8 +15,8 @@ module('Unit | Instance Initializer | foo', function(hooks) { this.instance = this.application.buildInstance(); }); hooks.afterEach(function() { - run(this.application, 'destroy'); run(this.instance, 'destroy'); + run(this.application, 'destroy'); }); // Replace this with your real tests.
true
Other
emberjs
ember.js
bff547d15646b3fba3a5700b5ca16f0adfc39f2c.json
Instance-initializer blueprint: destroy instance before application See https://github.com/emberjs/ember.js/pull/17412#discussion_r26304
node-tests/fixtures/instance-initializer-test/rfc232.js
@@ -15,8 +15,8 @@ module('Unit | Instance Initializer | foo', function(hooks) { this.instance = this.application.buildInstance(); }); hooks.afterEach(function() { - run(this.application, 'destroy'); run(this.instance, 'destroy'); + run(this.application, 'destroy'); }); // Replace this with your real tests.
true
Other
emberjs
ember.js
d4facc6f0e77114d45712241f76b84b7af5ace11.json
Fix blueprint helper test It fixes the test when generating a helper in a MU `dummy` app. It continues the work of #17658 that requires this change when #17689 was merged.
node-tests/blueprints/helper-test.js
@@ -189,7 +189,7 @@ describe('Blueprint: helper', function() { it('helper foo/bar-baz --dummy', function() { return emberGenerateDestroy(['helper', 'foo/bar-baz', '--dummy'], _file => { expect(_file('tests/dummy/src/ui/components/foo/bar-baz.js')).to.equal( - fixture('helper/helper.js') + fixture('helper/mu-helper.js') ); expect(_file('src/ui/components/foo/bar-baz.js')).to.not.exist; });
false
Other
emberjs
ember.js
514787c9b01461162ce780ff766d3c531b77d16e.json
Add v3.9.0-beta.3 to CHANGELOG [ci skip] (cherry picked from commit b93488b1857afb555b57aecf1a5b6f00a5a8c30f)
CHANGELOG.md
@@ -1,5 +1,10 @@ # Ember Changelog +### 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
false
Other
emberjs
ember.js
fbce6687d9db75f1b3445853097fe8e8a46755bf.json
Fix helper blueprint for module unification Prior to this change, the classic blueprint used a different construction for helper files. Since module unification this has changed. This commit updates the blueprints to generate the new construction code for helpers when module unification is in use and still offers the classic construction code when not. Fixes issue #17556
blueprints/helper/index.js
@@ -8,6 +8,11 @@ const path = require('path'); module.exports = { description: 'Generates a helper function.', + filesPath() { + let rootPath = isModuleUnificationProject(this.project) ? 'mu-files' : 'files'; + return path.join(this.path, rootPath); + }, + fileMapTokens() { if (isModuleUnificationProject(this.project)) { return {
true
Other
emberjs
ember.js
fbce6687d9db75f1b3445853097fe8e8a46755bf.json
Fix helper blueprint for module unification Prior to this change, the classic blueprint used a different construction for helper files. Since module unification this has changed. This commit updates the blueprints to generate the new construction code for helpers when module unification is in use and still offers the classic construction code when not. Fixes issue #17556
blueprints/helper/mu-files/__root__/__collection__/__name__.js
@@ -0,0 +1,7 @@ +import { helper as buildHelper } from '@ember/component/helper'; + +export function <%= camelizedModuleName %>(params/*, hash*/) { + return params; +} + +export const helper = buildHelper(<%= camelizedModuleName %>);
true
Other
emberjs
ember.js
fbce6687d9db75f1b3445853097fe8e8a46755bf.json
Fix helper blueprint for module unification Prior to this change, the classic blueprint used a different construction for helper files. Since module unification this has changed. This commit updates the blueprints to generate the new construction code for helpers when module unification is in use and still offers the classic construction code when not. Fixes issue #17556
node-tests/blueprints/helper-test.js
@@ -106,7 +106,7 @@ describe('Blueprint: helper', function() { it('helper foo/bar-baz', function() { return emberGenerateDestroy(['helper', 'foo/bar-baz'], _file => { - expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/helper.js')); + expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js')); expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal( fixture('helper-test/integration.js') ); @@ -115,7 +115,7 @@ describe('Blueprint: helper', function() { it('helper foo/bar-baz unit', function() { return emberGenerateDestroy(['helper', '--test-type=unit', 'foo/bar-baz'], _file => { - expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/helper.js')); + expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js')); expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal( fixture('helper-test/unit.js') ); @@ -170,7 +170,7 @@ describe('Blueprint: helper', function() { it('helper foo/bar-baz', function() { return emberGenerateDestroy(['helper', 'foo/bar-baz'], _file => { - expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/helper.js')); + expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js')); expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal( fixture('helper-test/integration.js') ); @@ -179,7 +179,7 @@ describe('Blueprint: helper', function() { it('helper foo/bar-baz unit', function() { return emberGenerateDestroy(['helper', '--test-type=unit', 'foo/bar-baz'], _file => { - expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/helper.js')); + expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js')); expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal( fixture('helper-test/module-unification/addon-unit.js') ); @@ -229,7 +229,7 @@ describe('Blueprint: helper', function() { it('helper foo/bar-baz --in-repo-addon=my-addon', function() { return emberGenerateDestroy(['helper', 'foo/bar-baz', '--in-repo-addon=my-addon'], _file => { expect(_file('packages/my-addon/src/ui/components/foo/bar-baz.js')).to.equal( - fixture('helper/helper.js') + fixture('helper/mu-helper.js') ); expect(_file('packages/my-addon/src/ui/components/foo/bar-baz-test.js')).to.equal( fixture('helper-test/integration.js') @@ -242,7 +242,7 @@ describe('Blueprint: helper', function() { ['helper', '--test-type=unit', 'foo/bar-baz', '--in-repo-addon=my-addon'], _file => { expect(_file('packages/my-addon/src/ui/components/foo/bar-baz.js')).to.equal( - fixture('helper/helper.js') + fixture('helper/mu-helper.js') ); expect(_file('packages/my-addon/src/ui/components/foo/bar-baz-test.js')).to.equal( fixture('helper-test/module-unification/addon-unit.js')
true
Other
emberjs
ember.js
fbce6687d9db75f1b3445853097fe8e8a46755bf.json
Fix helper blueprint for module unification Prior to this change, the classic blueprint used a different construction for helper files. Since module unification this has changed. This commit updates the blueprints to generate the new construction code for helpers when module unification is in use and still offers the classic construction code when not. Fixes issue #17556
node-tests/fixtures/helper/mu-helper.js
@@ -0,0 +1,7 @@ +import { helper as buildHelper } from '@ember/component/helper'; + +export function fooBarBaz(params/*, hash*/) { + return params; +} + +export const helper = buildHelper(fooBarBaz);
true
Other
emberjs
ember.js
7d103a937b21b5b728f73cd29b5a6272f628dce4.json
Remove `hasViews` guard. This was originally added to ensure that we did not accidentally trigger the auto-run assertion if we didn't have any components/views rendered. However, as of Ember 3.4+ the autorun assertion is removed, making this system completely useless and over complicates the remaining code. Co-authored-by: Kris Selden <[email protected]>
packages/@ember/-internals/glimmer/lib/renderer.ts
@@ -1,4 +1,4 @@ -import { runInTransaction, setHasViews } from '@ember/-internals/metal'; +import { runInTransaction } from '@ember/-internals/metal'; import { fallbackViewRegistry, getViewElement, @@ -169,8 +169,6 @@ export function _resetRenderers() { renderers.length = 0; } -setHasViews(() => renderers.length > 0); - function register(renderer: Renderer): void { assert('Cannot register the same renderer twice', renderers.indexOf(renderer) === -1); renderers.push(renderer); @@ -401,7 +399,7 @@ export abstract class Renderer { _renderRoots() { let { _roots: roots, _env: env, _removedRoots: removedRoots } = this; - let globalShouldReflush: boolean; + let globalShouldReflush = false; let initialRootsLength: number; do {
true
Other
emberjs
ember.js
7d103a937b21b5b728f73cd29b5a6272f628dce4.json
Remove `hasViews` guard. This was originally added to ensure that we did not accidentally trigger the auto-run assertion if we didn't have any components/views rendered. However, as of Ember 3.4+ the autorun assertion is removed, making this system completely useless and over complicates the remaining code. Co-authored-by: Kris Selden <[email protected]>
packages/@ember/-internals/metal/index.ts
@@ -47,7 +47,7 @@ export { default as expandProperties } from './lib/expand_properties'; export { addObserver, removeObserver } from './lib/observer'; export { Mixin, aliasMethod, mixin, observer, applyMixin } from './lib/mixin'; export { default as inject, DEBUG_INJECTION_FUNCTIONS } from './lib/injected_property'; -export { setHasViews, tagForProperty, tagFor, markObjectAsDirty } from './lib/tags'; +export { tagForProperty, tagFor, markObjectAsDirty } from './lib/tags'; export { default as runInTransaction, didRender, assertNotRendered } from './lib/transaction'; export { tracked, getCurrentTracker, setCurrentTracker } from './lib/tracked';
true
Other
emberjs
ember.js
7d103a937b21b5b728f73cd29b5a6272f628dce4.json
Remove `hasViews` guard. This was originally added to ensure that we did not accidentally trigger the auto-run assertion if we didn't have any components/views rendered. However, as of Ember 3.4+ the autorun assertion is removed, making this system completely useless and over complicates the remaining code. Co-authored-by: Kris Selden <[email protected]>
packages/@ember/-internals/metal/lib/tags.ts
@@ -11,12 +11,6 @@ import { UpdatableTag, } from '@glimmer/reference'; -let hasViews: () => boolean = () => false; - -export function setHasViews(fn: () => boolean): void { - hasViews = fn; -} - function makeTag(): TagWrapper<DirtyableTag> { return DirtyableTag.create(); } @@ -95,7 +89,5 @@ export function markObjectAsDirty(obj: object, propertyKey: string, meta: Meta): } export function ensureRunloop(): void { - if (hasViews()) { - backburner.ensureInstance(); - } + backburner.ensureInstance(); }
true
Other
emberjs
ember.js
7d103a937b21b5b728f73cd29b5a6272f628dce4.json
Remove `hasViews` guard. This was originally added to ensure that we did not accidentally trigger the auto-run assertion if we didn't have any components/views rendered. However, as of Ember 3.4+ the autorun assertion is removed, making this system completely useless and over complicates the remaining code. Co-authored-by: Kris Selden <[email protected]>
packages/@ember/-internals/metal/tests/accessors/set_test.js
@@ -1,13 +1,9 @@ -import { get, set, trySet, setHasViews } from '../..'; +import { get, set, trySet } from '../..'; import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; moduleFor( 'set', class extends AbstractTestCase { - teardown() { - setHasViews(() => false); - } - ['@test should set arbitrary properties on an object'](assert) { let obj = { string: 'string', @@ -110,7 +106,6 @@ moduleFor( } ['@test does not trigger auto-run assertion for objects that have not been tagged'](assert) { - setHasViews(() => true); let obj = {}; set(obj, 'foo', 'bar');
true
Other
emberjs
ember.js
75b5d0877f451ff790978eaa77d24989ebe1b6ad.json
Remove nonexistent link /defining-your-routes
packages/@ember/-internals/routing/lib/system/router.ts
@@ -1716,9 +1716,6 @@ EmberRouter.reopenClass({ }); ``` - For more detailed documentation and examples please see - [the guides](https://guides.emberjs.com/release/routing/defining-your-routes/). - @method map @param callback @public
false
Other
emberjs
ember.js
8628f37fc96ca656b4d8de18f21bcb398ad86c8b.json
Add v3.9.0-beta.2 to CHANGELOG [ci skip] (cherry picked from commit 35d15c2a8c3c4fc71de8fdbc8ba1dd9aa0280aef)
CHANGELOG.md
@@ -1,5 +1,10 @@ # Ember Changelog +### 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) - [#17470](https://github.com/emberjs/ember.js/pull/17470) [DEPRECATION] Implements the Computed Property Modifier deprecation RFCs
false
Other
emberjs
ember.js
4e9e931eec7b61e9c445e52d7468efcb1cd51171.json
Fix typo in docs
packages/@ember/-internals/glimmer/lib/helpers/concat.ts
@@ -30,7 +30,7 @@ const normalizeTextValue = (value: any): string => { or for angle bracket invocation, you actually don't need concat at all. ```handlebars - <SomeComponent @name="{{firstName lastName}}" /> + <SomeComponent @name="{{firstName}} {{lastName}}" /> ``` @public
false
Other
emberjs
ember.js
aa0579b5dbc3e9568ebeaa034cf665e2f3c3a2ee.json
Add v3.9.0-beta.1 to CHANGELOG [ci skip] (cherry picked from commit 370e0d6120cbd63339eb14fa5481a7a4614f948d)
CHANGELOG.md
@@ -1,5 +1,16 @@ # Ember Changelog +### v3.9.0-beta.1 (February 18, 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) + * 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) +- [#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 +- [#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) - [#17143](https://github.com/emberjs/ember.js/pull/17143) / [#17375](https://github.com/emberjs/ember.js/pull/17375) [FEATURE] Implement Element Modifier Manager RFC (see [emberjs/rfcs#0373](https://github.com/emberjs/rfcs/blob/master/text/0373-Element-Modifier-Managers.md)).
false
Other
emberjs
ember.js
b71a2a5aea97bed538310faacdfc60540cb6965f.json
Add v3.8.0 to CHANGELOG [ci skip] (cherry picked from commit 43e8cb6b62c31bfdbe6c3f937a05021251096067)
CHANGELOG.md
@@ -1,36 +1,25 @@ # Ember Changelog -### v3.8.0-beta.5 (February 11, 2019) - -- [#17563](https://github.com/emberjs/ember.js/pull/17563) [BUGFIX] Transition.send/trigger call signature - -### v3.8.0-beta.4 (February 4, 2019) - -- [#17552](https://github.com/emberjs/ember.js/pull/17552) [BUGFIX] Support numbers in component names for Angle Brackets - -### v3.8.0-beta.3 (January 28, 2019) - -- [#17498](https://github.com/emberjs/ember.js/pull/17498) [BUGFIX] Don't remove dep keys in `didUnwatch` -- [#17499](https://github.com/emberjs/ember.js/pull/17499) [BUGFIX] Update to glimmer-vm 0.37.1. - -### v3.8.0-beta.2 (January 14, 2019) - -- [#17467](https://github.com/emberjs/ember.js/pull/17467) [BUGFIX] Fix substate interactions with aborts - -### v3.8.0-beta.1 (January 7, 2019) +### v3.8.0 (February 18, 2019) - [#17143](https://github.com/emberjs/ember.js/pull/17143) / [#17375](https://github.com/emberjs/ember.js/pull/17375) [FEATURE] Implement Element Modifier Manager RFC (see [emberjs/rfcs#0373](https://github.com/emberjs/rfcs/blob/master/text/0373-Element-Modifier-Managers.md)). - [#17054](https://github.com/emberjs/ember.js/pull/17054) / [#17376](https://github.com/emberjs/ember.js/pull/17376) [FEATURE] Implement `array` helper RFC (see [emberjs/rfcs#0318](https://github.com/emberjs/rfcs/blob/master/text/0318-array-helper.md)) - [#16735](https://github.com/emberjs/ember.js/pull/16735) [BUGFIX] Observed properties not being marked as enum +- [#17498](https://github.com/emberjs/ember.js/pull/17498) [BUGFIX] Don't remove dep keys in `didUnwatch` +- [#17467](https://github.com/emberjs/ember.js/pull/17467) [BUGFIX] Fix substate interactions with aborts +- [#17413](https://github.com/emberjs/ember.js/pull/17413) [BUGFIX] Fix missing import in instance-initializer blueprint for ember-mocha - [#17319](https://github.com/emberjs/ember.js/pull/17319) [CLEANUP] Remove deprecated 'POSITIONAL_PARAM_CONFLICT' - [#17394](https://github.com/emberjs/ember.js/pull/17394) [CLEANUP] Remove deprecated code in mixins/array +- [#17244](https://github.com/emberjs/ember.js/pull/17244) / [#17499](https://github.com/emberjs/ember.js/pull/17499) Upgrade to Glimmer VM 0.37.1 +Fixes a few issues: + * Usage of positional arguments with custom components. + * Forwarding attributes via `...attributes` to a dynamic component. + * Prevent errors when rendering many template blocks (`Error: Operand over 16-bits. Got 65536`). - [#17166](https://github.com/emberjs/ember.js/pull/17166) Improve performance of get() / set() -- [#16710](https://github.com/emberjs/ember.js/pull/16710) Deprecation of (private) `NAME_KEY` -- [#17244](https://github.com/emberjs/ember.js/pull/17244) Upgrade to Glimmer VM 0.37.0 +- [#16710](https://github.com/emberjs/ember.js/pull/16710) Deprecation of private `NAME_KEY` - [#17216](https://github.com/emberjs/ember.js/pull/17216) Use native Error instead of custom Error subclass. - [#17340](https://github.com/emberjs/ember.js/pull/17340) Remove unused `hooks` variable from qunit-rfc-232 util-test blueprint - [#17357](https://github.com/emberjs/ember.js/pull/17357) Allow notifyPropertyChange to be imported from @ember/object -- [#17413](https://github.com/emberjs/ember.js/pull/17413) Fix missing import in instance-initializer blueprint for ember-mocha ### v3.7.3 (February 6, 2019) @@ -39,7 +28,7 @@ ### v3.7.2 (January 22, 2019) -* Upgrade @glimmer/* packages to 0.35.10. Fixes a few issues: +* Upgrade @glimmer/* packages to 0.36.6. Fixes a few issues: * Usage of positional arguments with custom components. * Forwarding attributes via `...attributes` to a dynamic component. * Prevent errors when rendering many template blocks (`Error: Operand over 16-bits. Got 65536`).
false
Other
emberjs
ember.js
86b9f705c72de7ea2ad139c66f2977e82e95a898.json
Add v3.8.0-beta.5 to CHANGELOG [ci skip] (cherry picked from commit 39bb0d47bb8ee081a378daab0064e8033734c33d)
CHANGELOG.md
@@ -1,5 +1,9 @@ # Ember Changelog +### v3.8.0-beta.5 (February 11, 2019) + +- [#17563](https://github.com/emberjs/ember.js/pull/17563) [BUGFIX] Transition.send/trigger call signature + ### v3.8.0-beta.4 (February 4, 2019) - [#17552](https://github.com/emberjs/ember.js/pull/17552) [BUGFIX] Support numbers in component names for Angle Brackets
false
Other
emberjs
ember.js
287afaee33d069981bc49f0f9b8bf0c05dbb419f.json
add initializer back
packages/@ember/-internals/metal/lib/tracked.ts
@@ -203,7 +203,13 @@ function descriptorForField(elementDesc: ElementDescriptor): ElementDescriptor { get(): any { if (CURRENT_TRACKER) CURRENT_TRACKER.add(tagForProperty(this, key)); - return getTrackedFieldValues(this)[key]; + let values = getTrackedFieldValues(this); + + if (!(key in values)) { + values[key] = initializer !== undefined ? initializer.call(this) : undefined; + } + + return values[key]; }, set(newValue: any): void {
false
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/index.ts
@@ -29,12 +29,12 @@ export { PROPERTY_DID_CHANGE, } from './lib/property_events'; export { defineProperty } from './lib/properties'; +export { nativeDescDecorator } from './lib/decorator'; export { descriptorForProperty, isComputedDecorator, setComputedDecorator, - nativeDescDecorator, -} from './lib/decorator'; +} from './lib/descriptor_map'; export { watchKey, unwatchKey } from './lib/watch_key'; export { ChainNode, finishChains, removeChainWatcher } from './lib/chains'; export { watchPath, unwatchPath } from './lib/watch_path'; @@ -64,16 +64,3 @@ export { isSearchDisabled as isNamespaceSearchDisabled, setSearchDisabled as setNamespaceSearchDisabled, } from './lib/namespace_search'; - -import { DEBUG } from '@glimmer/env'; -import { setComputedDecorator } from './lib/decorator'; -import { tracked } from './lib/tracked'; - -// We have to set this here because there is a cycle of dependencies in tracked -// which causes `setComputedDecorator` to not be resolved before the `tracked` -// module. -if (DEBUG) { - // Normally this isn't a classic decorator, but we want to throw a helpful - // error in development so we need it to treat it like one - setComputedDecorator(tracked); -}
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/alias.ts
@@ -7,10 +7,10 @@ import { addDependentKeys, ComputedDescriptor, Decorator, - descriptorForDecorator, makeComputedDecorator, removeDependentKeys, } from './decorator'; +import { descriptorForDecorator } from './descriptor_map'; import { defineProperty } from './properties'; import { get } from './property_get'; import { set } from './property_set';
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/chains.ts
@@ -1,6 +1,6 @@ import { Meta, meta as metaFor, peekMeta } from '@ember/-internals/meta'; import { getCachedValueFor } from './computed_cache'; -import { descriptorForProperty } from './decorator'; +import { descriptorForProperty } from './descriptor_map'; import { eachProxyFor } from './each_proxy'; import { get } from './property_get'; import { unwatchKey, watchKey } from './watch_key';
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/computed.ts
@@ -14,10 +14,10 @@ import { addDependentKeys, ComputedDescriptor, Decorator, - descriptorForDecorator, makeComputedDecorator, removeDependentKeys, } from './decorator'; +import { descriptorForDecorator } from './descriptor_map'; import expandProperties from './expand_properties'; import { defineProperty } from './properties'; import { notifyPropertyChange } from './property_events';
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/decorator.ts
@@ -1,11 +1,10 @@ -import { Meta, meta as metaFor, peekMeta } from '@ember/-internals/meta'; +import { Meta, meta as metaFor } from '@ember/-internals/meta'; import { EMBER_NATIVE_DECORATOR_SUPPORT } from '@ember/canary-features'; import { assert } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; +import { setComputedDecorator } from './descriptor_map'; import { unwatch, watch } from './watching'; -const DECORATOR_DESCRIPTOR_MAP: WeakMap<Decorator, ComputedDescriptor | boolean> = new WeakMap(); - // https://tc39.github.io/proposal-decorators/#sec-elementdescriptor-specification-type export interface ElementDescriptor { descriptor: PropertyDescriptor & { initializer?: any }; @@ -21,61 +20,6 @@ export type Decorator = ( isClassicDecorator?: boolean ) => ElementDescriptor; -// .......................................................... -// DESCRIPTOR -// - -/** - Returns the CP descriptor assocaited with `obj` and `keyName`, if any. - - @method descriptorFor - @param {Object} obj the object to check - @param {String} keyName the key to check - @return {Descriptor} - @private -*/ -export function descriptorForProperty(obj: object, keyName: string, _meta?: Meta | null) { - assert('Cannot call `descriptorFor` on null', obj !== null); - assert('Cannot call `descriptorFor` on undefined', obj !== undefined); - assert( - `Cannot call \`descriptorFor\` on ${typeof obj}`, - typeof obj === 'object' || typeof obj === 'function' - ); - - let meta = _meta === undefined ? peekMeta(obj) : _meta; - - if (meta !== null) { - return meta.peekDescriptors(keyName); - } -} - -export function descriptorForDecorator(dec: Decorator) { - return DECORATOR_DESCRIPTOR_MAP.get(dec); -} - -/** - Check whether a value is a decorator - - @method isComputedDecorator - @param {any} possibleDesc the value to check - @return {boolean} - @private -*/ -export function isComputedDecorator(dec: Decorator | null | undefined) { - return dec !== null && dec !== undefined && DECORATOR_DESCRIPTOR_MAP.has(dec); -} - -/** - Set a value as a decorator - - @method setComputedDecorator - @param {function} decorator the value to mark as a decorator - @private -*/ -export function setComputedDecorator(dec: Decorator, value: any = true) { - DECORATOR_DESCRIPTOR_MAP.set(dec, value); -} - // .......................................................... // DEPENDENT KEYS //
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/descriptor_map.ts
@@ -0,0 +1,58 @@ +import { Meta, peekMeta } from '@ember/-internals/meta'; +import { assert } from '@ember/debug'; + +const DECORATOR_DESCRIPTOR_MAP: WeakMap< + import('./decorator').Decorator, + import('./decorator').ComputedDescriptor | boolean +> = new WeakMap(); + +/** + Returns the CP descriptor assocaited with `obj` and `keyName`, if any. + + @method descriptorFor + @param {Object} obj the object to check + @param {String} keyName the key to check + @return {Descriptor} + @private +*/ +export function descriptorForProperty(obj: object, keyName: string, _meta?: Meta | null) { + assert('Cannot call `descriptorFor` on null', obj !== null); + assert('Cannot call `descriptorFor` on undefined', obj !== undefined); + assert( + `Cannot call \`descriptorFor\` on ${typeof obj}`, + typeof obj === 'object' || typeof obj === 'function' + ); + + let meta = _meta === undefined ? peekMeta(obj) : _meta; + + if (meta !== null) { + return meta.peekDescriptors(keyName); + } +} + +export function descriptorForDecorator(dec: import('./decorator').Decorator) { + return DECORATOR_DESCRIPTOR_MAP.get(dec); +} + +/** + Check whether a value is a decorator + + @method isComputedDecorator + @param {any} possibleDesc the value to check + @return {boolean} + @private +*/ +export function isComputedDecorator(dec: import('./decorator').Decorator | null | undefined) { + return dec !== null && dec !== undefined && DECORATOR_DESCRIPTOR_MAP.has(dec); +} + +/** + Set a value as a decorator + + @method setComputedDecorator + @param {function} decorator the value to mark as a decorator + @private +*/ +export function setComputedDecorator(dec: import('./decorator').Decorator, value: any = true) { + DECORATOR_DESCRIPTOR_MAP.set(dec, value); +}
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/mixin.ts
@@ -22,12 +22,12 @@ import { ComputedPropertyGetter, ComputedPropertySetter, } from './computed'; +import { makeComputedDecorator } from './decorator'; import { descriptorForDecorator, descriptorForProperty, isComputedDecorator, - makeComputedDecorator, -} from './decorator'; +} from './descriptor_map'; import { addListener, removeListener } from './events'; import expandProperties from './expand_properties'; import { classToString, setUnprocessedMixins } from './namespace_search';
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/properties.ts
@@ -5,12 +5,8 @@ import { Meta, meta as metaFor, peekMeta, UNDEFINED } from '@ember/-internals/meta'; import { assert } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; -import { - Decorator, - descriptorForProperty, - ElementDescriptor, - isComputedDecorator, -} from './decorator'; +import { Decorator, ElementDescriptor } from './decorator'; +import { descriptorForProperty, isComputedDecorator } from './descriptor_map'; import { overrideChains } from './property_events'; export type MandatorySetterFunction = ((this: object, value: any) => void) & {
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/property_events.ts
@@ -2,7 +2,7 @@ import { Meta, peekMeta } from '@ember/-internals/meta'; import { symbol } from '@ember/-internals/utils'; import { DEBUG } from '@glimmer/env'; import changeEvent from './change_event'; -import { descriptorForProperty } from './decorator'; +import { descriptorForProperty } from './descriptor_map'; import { sendEvent } from './events'; import ObserverSet from './observer_set'; import { markObjectAsDirty } from './tags';
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/property_get.ts
@@ -5,7 +5,7 @@ import { HAS_NATIVE_PROXY, symbol } from '@ember/-internals/utils'; import { EMBER_METAL_TRACKED_PROPERTIES } from '@ember/canary-features'; import { assert } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; -import { descriptorForProperty } from './decorator'; +import { descriptorForProperty } from './descriptor_map'; import { isPath } from './path_cache'; import { tagForProperty } from './tags'; import { getCurrentTracker } from './tracked';
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/property_set.ts
@@ -3,7 +3,7 @@ import { HAS_NATIVE_PROXY, lookupDescriptor, toString } from '@ember/-internals/ import { assert } from '@ember/debug'; import EmberError from '@ember/error'; import { DEBUG } from '@glimmer/env'; -import { descriptorForProperty } from './decorator'; +import { descriptorForProperty } from './descriptor_map'; import { isPath } from './path_cache'; import { MandatorySetterFunction } from './properties'; import { notifyPropertyChange } from './property_events';
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/tracked.ts
@@ -2,7 +2,8 @@ import { EMBER_NATIVE_DECORATOR_SUPPORT } from '@ember/canary-features'; import { assert } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; import { combine, CONSTANT_TAG, Tag } from '@glimmer/reference'; -import { Decorator, ElementDescriptor, setComputedDecorator } from './decorator'; +import { Decorator, ElementDescriptor } from './decorator'; +import { setComputedDecorator } from './descriptor_map'; import { dirty, tagFor, tagForProperty } from './tags'; type Option<T> = T | null; @@ -164,6 +165,29 @@ export function tracked( return descriptorForField(elementDesc); } +if (DEBUG) { + // Normally this isn't a classic decorator, but we want to throw a helpful + // error in development so we need it to treat it like one + setComputedDecorator(tracked); +} + +const TRACKED_FIELDS_SHAPE: WeakMap<object, [string, (() => any) | undefined][]> = new WeakMap(); +const TRACKED_FIELDS_VALUES: WeakMap<object, object> = new WeakMap(); + +function getTrackedFieldValues(obj: any) { + let values = TRACKED_FIELDS_VALUES.get(obj); + + if (values === undefined) { + values = {}; + TRACKED_FIELDS_SHAPE.get(obj.constructor)!.forEach( + ([key, initializer]) => (values![key] = initializer === undefined ? undefined : initializer()) + ); + TRACKED_FIELDS_VALUES.set(obj, values); + } + + return values; +} + function descriptorForField(elementDesc: ElementDescriptor): ElementDescriptor { let { key, kind, initializer } = elementDesc as ElementDescriptor; @@ -172,8 +196,6 @@ function descriptorForField(elementDesc: ElementDescriptor): ElementDescriptor { kind === 'field' ); - let shadowKey = Symbol(key); - return { key, kind: 'method', @@ -185,20 +207,28 @@ function descriptorForField(elementDesc: ElementDescriptor): ElementDescriptor { get(): any { if (CURRENT_TRACKER) CURRENT_TRACKER.add(tagForProperty(this, key)); - if (!(shadowKey in this)) { - this[shadowKey] = initializer !== undefined ? initializer.call(this) : undefined; - } - - return this[shadowKey]; + return getTrackedFieldValues(this)[key]; }, set(newValue: any): void { tagFor(this).inner!['dirty'](); dirty(tagForProperty(this, key)); - this[shadowKey] = newValue; + + getTrackedFieldValues(this)[key] = newValue; + propertyDidChange(); }, }, + finisher(target) { + let shape = TRACKED_FIELDS_SHAPE.get(target); + + if (shape === undefined) { + shape = []; + TRACKED_FIELDS_SHAPE.set(target, shape); + } + + shape.push([key, initializer]); + }, }; }
true
Other
emberjs
ember.js
b7c7eaf792545c2dcbc87b8ba7453d48f32f840f.json
remove cycle, switch from symbol to weakmap
packages/@ember/-internals/metal/lib/watch_key.ts
@@ -1,7 +1,7 @@ import { Meta, meta as metaFor, peekMeta, UNDEFINED } from '@ember/-internals/meta'; import { lookupDescriptor } from '@ember/-internals/utils'; import { DEBUG } from '@glimmer/env'; -import { descriptorForProperty, isComputedDecorator } from './decorator'; +import { descriptorForProperty, isComputedDecorator } from './descriptor_map'; import { DEFAULT_GETTER_FUNCTION, INHERITING_GETTER_FUNCTION,
true
Other
emberjs
ember.js
53b84e24220861bb45987b0dfd2461b70c909fe8.json
add action decorator
packages/@ember/object/index.js
@@ -0,0 +1,95 @@ +import { EMBER_NATIVE_DECORATOR_SUPPORT } from '@ember/canary-features'; +import { assert } from '@ember/debug'; +import { assign } from '@ember/polyfills'; + +/** + Decorator that turns the target function into an Action + Adds an `actions` object to the target object and creates a passthrough + function that calls the original. This means the function still exists + on the original object, and can be used directly. + + ```js + export default class ActionDemoComponent extends Component { + @action + foo() { + // do something + } + } + ``` + ```hbs + <!-- template.hbs --> + <button onclick={{action "foo"}}>Execute foo action</button> + ``` + + It also binds the function directly to the instance, so it can be used in any + context: + + ```hbs + <!-- template.hbs --> + <button onclick={{this.foo}}>Execute foo action</button> + ``` + @method computed + @for @ember/object + @static + @param {ElementDescriptor} elementDesc the descriptor of the element to decorate + @return {ElementDescriptor} the decorated descriptor + @private +*/ +export let action; + +if (EMBER_NATIVE_DECORATOR_SUPPORT) { + let BINDINGS_MAP = new WeakMap(); + + action = function action(elementDesc) { + assert( + 'The @action decorator must be applied to methods', + elementDesc && + elementDesc.kind === 'method' && + elementDesc.descriptor && + typeof elementDesc.descriptor.value === 'function' + ); + + let actionFn = elementDesc.descriptor.value; + + elementDesc.descriptor = { + get() { + let bindings = BINDINGS_MAP.get(this); + + if (bindings === undefined) { + bindings = new Map(); + BINDINGS_MAP.set(this, bindings); + } + + let fn = bindings.get(actionFn); + + if (fn === undefined) { + fn = actionFn.bind(this); + bindings.set(actionFn, fn); + } + + return fn; + }, + }; + + elementDesc.finisher = target => { + let { key } = elementDesc; + let { prototype } = target; + + if (typeof target.proto === 'function') { + target.proto(); + } + + if (!prototype.hasOwnProperty('actions')) { + let parentActions = prototype.actions; + // we need to assign because of the way mixins copy actions down when inheriting + prototype.actions = parentActions ? assign({}, parentActions) : {}; + } + + prototype.actions[key] = actionFn; + + return target; + }; + + return elementDesc; + }; +}
true
Other
emberjs
ember.js
53b84e24220861bb45987b0dfd2461b70c909fe8.json
add action decorator
packages/@ember/object/tests/action_test.js
@@ -0,0 +1,234 @@ +import { EMBER_NATIVE_DECORATOR_SUPPORT } from '@ember/canary-features'; +import { Component } from '@ember/-internals/glimmer'; +import { Object as EmberObject } from '@ember/-internals/runtime'; +import { moduleFor, RenderingTestCase, strip } from 'internal-test-helpers'; + +import { action } from '../index'; + +if (EMBER_NATIVE_DECORATOR_SUPPORT) { + moduleFor( + '@action decorator', + class extends RenderingTestCase { + '@test action decorator works with ES6 class'(assert) { + class FooComponent extends Component { + @action + foo() { + assert.ok(true, 'called!'); + } + } + + this.registerComponent('foo-bar', { + ComponentClass: FooComponent, + template: "<button {{action 'foo'}}>Click Me!</button>", + }); + + this.render('{{foo-bar}}'); + + this.$('button').click(); + } + + '@test action decorator does not add actions to superclass'(assert) { + class Foo extends EmberObject { + @action + foo() { + // Do nothing + } + } + + class Bar extends Foo { + @action + bar() { + assert.ok(false, 'called'); + } + } + + let foo = Foo.create(); + let bar = Bar.create(); + + assert.equal(typeof foo.actions.foo, 'function', 'foo has foo action'); + assert.equal(typeof foo.actions.bar, 'undefined', 'foo does not have bar action'); + + assert.equal(typeof bar.actions.foo, 'function', 'bar has foo action'); + assert.equal(typeof bar.actions.bar, 'function', 'bar has bar action'); + } + + '@test actions are properly merged through traditional and ES6 prototype hierarchy'(assert) { + assert.expect(4); + + let FooComponent = Component.extend({ + actions: { + foo() { + assert.ok(true, 'foo called!'); + }, + }, + }); + + class BarComponent extends FooComponent { + @action + bar() { + assert.ok(true, 'bar called!'); + } + } + + let BazComponent = BarComponent.extend({ + actions: { + baz() { + assert.ok(true, 'baz called!'); + }, + }, + }); + + class QuxComponent extends BazComponent { + @action + qux() { + assert.ok(true, 'qux called!'); + } + } + + this.registerComponent('qux-component', { + ComponentClass: QuxComponent, + template: strip` + <button {{action 'foo'}}>Click Foo!</button> + <button {{action 'bar'}}>Click Bar!</button> + <button {{action 'baz'}}>Click Baz!</button> + <button {{action 'qux'}}>Click Qux!</button> + `, + }); + + this.render('{{qux-component}}'); + + this.$('button').click(); + } + + '@test action decorator super works with native class methods'(assert) { + class FooComponent extends Component { + foo() { + assert.ok(true, 'called!'); + } + } + + class BarComponent extends FooComponent { + @action + foo() { + super.foo(); + } + } + + this.registerComponent('bar-bar', { + ComponentClass: BarComponent, + template: "<button {{action 'foo'}}>Click Me!</button>", + }); + + this.render('{{bar-bar}}'); + + this.$('button').click(); + } + + '@test action decorator super works with traditional class methods'(assert) { + let FooComponent = Component.extend({ + foo() { + assert.ok(true, 'called!'); + }, + }); + + class BarComponent extends FooComponent { + @action + foo() { + super.foo(); + } + } + + this.registerComponent('bar-bar', { + ComponentClass: BarComponent, + template: "<button {{action 'foo'}}>Click Me!</button>", + }); + + this.render('{{bar-bar}}'); + + this.$('button').click(); + } + + '@test action decorator works with parent native class actions'(assert) { + class FooComponent extends Component { + @action + foo() { + assert.ok(true, 'called!'); + } + } + + class BarComponent extends FooComponent { + @action + foo() { + super.foo(); + } + } + + this.registerComponent('bar-bar', { + ComponentClass: BarComponent, + template: "<button {{action 'foo'}}>Click Me!</button>", + }); + + this.render('{{bar-bar}}'); + + this.$('button').click(); + } + + '@test action decorator binds functions'(assert) { + class FooComponent extends Component { + bar = 'some value'; + + @action + foo() { + assert.equal(this.bar, 'some value', 'context bound correctly'); + } + } + + this.registerComponent('foo-bar', { + ComponentClass: FooComponent, + template: '<button onclick={{this.foo}}>Click Me!</button>', + }); + + this.render('{{foo-bar}}'); + + this.$('button').click(); + } + + '@test action decorator super works correctly when bound'(assert) { + class FooComponent extends Component { + bar = 'some value'; + + @action + foo() { + assert.equal(this.bar, 'some value', 'context bound correctly'); + } + } + + class BarComponent extends FooComponent { + @action + foo() { + super.foo(); + } + } + + this.registerComponent('bar-bar', { + ComponentClass: BarComponent, + template: '<button onclick={{this.foo}}>Click Me!</button>', + }); + + this.render('{{bar-bar}}'); + + this.$('button').click(); + } + + '@test action decorator throws an error if applied to non-methods'() { + expectAssertion(() => { + class TestObject extends EmberObject { + @action foo = 'bar'; + } + + new TestObject(); + }, /The @action decorator must be applied to methods/); + } + } + ); +}
true
Other
emberjs
ember.js
53b84e24220861bb45987b0dfd2461b70c909fe8.json
add action decorator
packages/ember/index.js
@@ -28,6 +28,8 @@ import { } from '@ember/string'; import Service, { inject as injectService } from '@ember/service'; +import { action } from '@ember/object'; + import { and, bool, @@ -433,6 +435,8 @@ Ember._ProxyMixin = _ProxyMixin; Ember.RSVP = RSVP; Ember.Namespace = Namespace; +Ember._action = action; + computed.empty = empty; computed.notEmpty = notEmpty; computed.none = none;
true
Other
emberjs
ember.js
53b84e24220861bb45987b0dfd2461b70c909fe8.json
add action decorator
packages/ember/tests/reexports_test.js
@@ -1,5 +1,5 @@ import Ember from '../index'; -import { FEATURES } from '@ember/canary-features'; +import { FEATURES, EMBER_NATIVE_DECORATOR_SUPPORT } from '@ember/canary-features'; import { confirmExport } from 'internal-test-helpers'; import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; import { jQueryDisabled, jQuery } from '@ember/-internals/views'; @@ -269,6 +269,7 @@ let allExports = [ '@ember/-internals/metal', { get: 'isNamespaceSearchDisabled', set: 'setNamespaceSearchDisabled' }, ], + EMBER_NATIVE_DECORATOR_SUPPORT ? ['_action', '@ember/object', 'action'] : null, ['computed.empty', '@ember/object/computed', 'empty'], ['computed.notEmpty', '@ember/object/computed', 'notEmpty'], ['computed.none', '@ember/object/computed', 'none'],
true
Other
emberjs
ember.js
f2dfd1393acf7abe4d00fa82acb13c918f13598c.json
use HAS_NATIVE_SYMBOL consistently
packages/@ember/-internals/glimmer/tests/integration/content-test.js
@@ -6,6 +6,7 @@ import { set, computed } from '@ember/-internals/metal'; import { getDebugFunction, setDebugFunction } from '@ember/debug'; import { readOnly } from '@ember/object/computed'; import { Object as EmberObject, ObjectProxy } from '@ember/-internals/runtime'; +import { HAS_NATIVE_SYMBOL } from '@ember/-internals/utils'; import { constructStyleDeprecationMessage } from '@ember/-internals/views'; import { Component, SafeString, htmlSafe } from '../utils/helpers'; @@ -682,7 +683,7 @@ let GlimmerContentTestCases = new ContentTestGenerator([ [Object.create(null), EMPTY, 'an object with no toString'], ]); -if (typeof Symbol !== 'undefined') { +if (HAS_NATIVE_SYMBOL) { GlimmerContentTestCases.cases.push([Symbol('debug'), 'Symbol(debug)', 'a symbol']); }
true
Other
emberjs
ember.js
f2dfd1393acf7abe4d00fa82acb13c918f13598c.json
use HAS_NATIVE_SYMBOL consistently
packages/@ember/-internals/utils/tests/guid_for_test.js
@@ -1,4 +1,4 @@ -import { guidFor } from '..'; +import { guidFor, HAS_NATIVE_SYMBOL } from '..'; import { moduleFor, AbstractTestCase as TestCase } from 'internal-test-helpers'; function sameGuid(assert, a, b, message) { @@ -49,7 +49,7 @@ moduleFor( } ['@test symbols'](assert) { - if (typeof Symbol === 'undefined') { + if (HAS_NATIVE_SYMBOL) { assert.ok(true, 'symbols are not supported on this browser'); return; }
true
Other
emberjs
ember.js
b3021dcab3917a4d85e5be7ff398dffd5f814c90.json
add symbol polyfill to tests
broccoli/test-polyfills.js
@@ -0,0 +1,20 @@ +const Rollup = require('broccoli-rollup'); +const writeFile = require('broccoli-file-creator'); +const resolve = require('rollup-plugin-node-resolve'); +const commonjs = require('rollup-plugin-commonjs'); + +module.exports = function polyfills() { + let polyfillEntry = writeFile('polyfill-entry.js', 'require("core-js/modules/es6.symbol");'); + + return new Rollup(polyfillEntry, { + rollup: { + input: 'polyfill-entry.js', + output: { + file: 'polyfill.js', + name: 'polyfill', + format: 'iife', + }, + plugins: [resolve(), commonjs()], + }, + }); +};
true
Other
emberjs
ember.js
b3021dcab3917a4d85e5be7ff398dffd5f814c90.json
add symbol polyfill to tests
ember-cli-build.js
@@ -9,6 +9,7 @@ const bootstrapModule = require('./broccoli/bootstrap-modules'); const concatBundle = require('./broccoli/concat-bundle'); const concat = require('broccoli-concat'); const testIndexHTML = require('./broccoli/test-index-html'); +const testPolyfills = require('./broccoli/test-polyfills'); const toES5 = require('./broccoli/to-es5'); const toNamedAMD = require('./broccoli/to-named-amd'); const stripForProd = require('./broccoli/strip-for-prod'); @@ -141,6 +142,7 @@ module.exports = function() { nodeTests(), // test harness + testPolyfills(), testIndexHTML(), jquery(), qunit(),
true
Other
emberjs
ember.js
b3021dcab3917a4d85e5be7ff398dffd5f814c90.json
add symbol polyfill to tests
package.json
@@ -121,6 +121,7 @@ "broccoli-typescript-compiler": "^4.0.1", "broccoli-uglify-sourcemap": "^2.2.0", "common-tags": "^1.8.0", + "core-js": "^2.6.3", "dag-map": "^2.0.2", "ember-cli": "^3.7.1", "ember-cli-blueprint-test-helpers": "^0.19.2", @@ -150,6 +151,8 @@ "prettier": "1.16.4", "puppeteer": "^1.12.2", "qunit": "^2.9.1", + "rollup-plugin-commonjs": "^9.2.0", + "rollup-plugin-node-resolve": "^4.0.0", "route-recognizer": "^0.3.4", "router_js": "^6.2.3", "rsvp": "^4.8.4",
true
Other
emberjs
ember.js
b3021dcab3917a4d85e5be7ff398dffd5f814c90.json
add symbol polyfill to tests
tests/index.html
@@ -9,6 +9,7 @@ display: none; } </style> + <script src="../polyfill.js" nomodule></script> <script src="../qunit/qunit.js"></script> <script src="/testem.js"></script>
true
Other
emberjs
ember.js
b3021dcab3917a4d85e5be7ff398dffd5f814c90.json
add symbol polyfill to tests
yarn.lock
@@ -1995,6 +1995,11 @@ builtin-modules@^1.0.0, builtin-modules@^1.1.1: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= +builtin-modules@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.0.0.tgz#1e587d44b006620d90286cc7a9238bbc6129cab1" + integrity sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg== + builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -2532,6 +2537,11 @@ core-js@^2.4.0, core-js@^2.5.7: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.0.tgz#1e30793e9ee5782b307e37ffa22da0eacddd84d4" integrity sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw== +core-js@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" + integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== + core-object@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/core-object/-/core-object-3.1.5.tgz#fa627b87502adc98045e44678e9a8ec3b9c0d2a9" @@ -3451,6 +3461,11 @@ estree-walker@^0.3.0: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa" integrity sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao= +estree-walker@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" + integrity sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig== + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -4868,6 +4883,11 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -5764,6 +5784,13 @@ magic-string@^0.24.0: dependencies: sourcemap-codec "^1.4.1" +magic-string@^0.25.1: + version "0.25.2" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.2.tgz#139c3a729515ec55e96e69e82a11fe890a293ad9" + integrity sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg== + dependencies: + sourcemap-codec "^1.4.4" + make-dir@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" @@ -7297,6 +7324,25 @@ rimraf@~2.5.2: dependencies: glob "^7.0.5" +rollup-plugin-commonjs@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz#4604e25069e0c78a09e08faa95dc32dec27f7c89" + integrity sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA== + dependencies: + estree-walker "^0.5.2" + magic-string "^0.25.1" + resolve "^1.8.1" + rollup-pluginutils "^2.3.3" + +rollup-plugin-node-resolve@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.0.tgz#9bc6b8205e9936cc0e26bba2415f1ecf1e64d9b2" + integrity sha512-7Ni+/M5RPSUBfUaP9alwYQiIKnKeXCOHiqBpKUl9kwp3jX5ZJtgXAait1cne6pGEVUUztPD6skIKH9Kq9sNtfw== + dependencies: + builtin-modules "^3.0.0" + is-module "^1.0.0" + resolve "^1.8.1" + rollup-pluginutils@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0" @@ -7305,6 +7351,14 @@ rollup-pluginutils@^2.0.1: estree-walker "^0.3.0" micromatch "^2.3.11" +rollup-pluginutils@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794" + integrity sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA== + dependencies: + estree-walker "^0.5.2" + micromatch "^2.3.11" + rollup@^0.57.1: version "0.57.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.57.1.tgz#0bb28be6151d253f67cf4a00fea48fb823c74027" @@ -7741,6 +7795,11 @@ sourcemap-codec@^1.4.1: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2" integrity sha512-hX1eNBNuilj8yfFnECh0DzLgwKpBLMIvmhgEhixXNui8lMLBInTI8Kyxt++RwJnMNu7cAUo635L2+N1TxMJCzA== +sourcemap-codec@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f" + integrity sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg== + sourcemap-validator@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/sourcemap-validator/-/sourcemap-validator-1.1.0.tgz#00454547d1682186e1498a7208e022e8dfa8738f"
true
Other
emberjs
ember.js
587d91c9c9bf07ed4a7b7325bf7652848074baa8.json
Add v3.7.3 to CHANGELOG [ci skip] (cherry picked from commit 76dc1997b6af36905204c3244499514718ea21a6)
CHANGELOG.md
@@ -28,6 +28,11 @@ - [#17357](https://github.com/emberjs/ember.js/pull/17357) Allow notifyPropertyChange to be imported from @ember/object - [#17413](https://github.com/emberjs/ember.js/pull/17413) Fix missing import in instance-initializer blueprint for ember-mocha +### v3.7.3 (February 6, 2019) + +- [#17563](https://github.com/emberjs/ember.js/pull/17563) [BUGFIX] Transition.send/trigger call signature +- [#17552](https://github.com/emberjs/ember.js/pull/17552) [BUGFIX] Support numbers in component names for Angle Brackets + ### v3.7.2 (January 22, 2019) * Upgrade @glimmer/* packages to 0.35.10. Fixes a few issues:
false
Other
emberjs
ember.js
0dc1a511f4309fdfdcf109b931b1a9f29f4884b3.json
Add v3.8.0-beta.4 to CHANGELOG [ci skip] (cherry picked from commit 2a8319845cedd2657c7a01db619e4438879dc2eb)
CHANGELOG.md
@@ -1,5 +1,9 @@ # Ember Changelog +### v3.8.0-beta.4 (February 4, 2019) + +- [#17552](https://github.com/emberjs/ember.js/pull/17552) [BUGFIX] Support numbers in component names for Angle Brackets + ### v3.8.0-beta.3 (January 28, 2019) - [#17498](https://github.com/emberjs/ember.js/pull/17498) [BUGFIX] Don't remove dep keys in `didUnwatch`
false
Other
emberjs
ember.js
1f5438bd37af9f38d077e260a9c3cb7e5a56b09c.json
update svelte version
packages/@ember/deprecated-features/index.ts
@@ -1,5 +1,8 @@ /* eslint-disable no-implicit-coercion */ +// These versions should be the version that the deprecation was _introduced_, +// not the version that the feature will be removed. + export const SEND_ACTION = !!'3.4.0'; export const EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5'; export const RUN_SYNC = !!'3.0.0-beta.4'; @@ -10,4 +13,4 @@ export const ROUTER_EVENTS = !!'3.9.0'; export const TRANSITION_STATE = !!'3.9.0'; export const COMPONENT_MANAGER_STRING_LOOKUP = !!'4.0.0'; export const JQUERY_INTEGRATION = !!'3.9.0'; -export const ALIAS_METHOD = !!'4.0.0'; +export const ALIAS_METHOD = !!'3.9.0';
false
Other
emberjs
ember.js
0a2f4b4d8669d1522bc683f835b37744b7ced796.json
Add v3.8.0-beta.3 to CHANGELOG [ci skip] (cherry picked from commit 4d7a49679506889b8bf1813173de961d8273ce6e)
CHANGELOG.md
@@ -1,5 +1,10 @@ # Ember Changelog +### v3.8.0-beta.3 (January 28, 2019) + +- [#17498](https://github.com/emberjs/ember.js/pull/17498) [BUGFIX] Don't remove dep keys in `didUnwatch` +- [#17499](https://github.com/emberjs/ember.js/pull/17499) [BUGFIX] Update to glimmer-vm 0.37.1. + ### v3.8.0-beta.2 (January 14, 2019) - [#17467](https://github.com/emberjs/ember.js/pull/17467) [BUGFIX] Fix substate interactions with aborts
false
Other
emberjs
ember.js
2aa22eed70030e837dbe2b500b7653653279f25f.json
Add svelte support for jQuery deprecations
packages/@ember/-internals/views/lib/mixins/view_support.js
@@ -6,68 +6,64 @@ import { hasDOM } from '@ember/-internals/browser-environment'; import { matches } from '../system/utils'; import { default as jQuery, jQueryDisabled } from '../system/jquery'; import { deprecate } from '@ember/debug'; +import { JQUERY_INTEGRATION } from '@ember/deprecated-features'; function K() { return this; } -/** - @class ViewMixin - @namespace Ember - @private -*/ -export default Mixin.create({ +let mixin = { /** - A list of properties of the view to apply as attributes. If the property - is a string value, the value of that string will be applied as the value - for an attribute of the property's name. + A list of properties of the view to apply as attributes. If the property + is a string value, the value of that string will be applied as the value + for an attribute of the property's name. - The following example creates a tag like `<div priority="high" />`. + The following example creates a tag like `<div priority="high" />`. - ```app/components/my-component.js - import Component from '@ember/component'; + ```app/components/my-component.js + import Component from '@ember/component'; - export default Component.extend({ + export default Component.extend({ attributeBindings: ['priority'], priority: 'high' }); - ``` + ``` - If the value of the property is a Boolean, the attribute is treated as - an HTML Boolean attribute. It will be present if the property is `true` - and omitted if the property is `false`. + If the value of the property is a Boolean, the attribute is treated as + an HTML Boolean attribute. It will be present if the property is `true` + and omitted if the property is `false`. - The following example creates markup like `<div visible />`. + The following example creates markup like `<div visible />`. - ```app/components/my-component.js - import Component from '@ember/component'; + ```app/components/my-component.js + import Component from '@ember/component'; - export default Component.extend({ + export default Component.extend({ attributeBindings: ['visible'], visible: true }); - ``` + ``` - If you would prefer to use a custom value instead of the property name, - you can create the same markup as the last example with a binding like - this: + If you would prefer to use a custom value instead of the property name, + you can create the same markup as the last example with a binding like + this: - ```app/components/my-component.js - import Component from '@ember/component'; + ```app/components/my-component.js + import Component from '@ember/component'; - export default Component.extend({ + export default Component.extend({ attributeBindings: ['isVisible:visible'], isVisible: true }); - ``` + ``` - This list of attributes is inherited from the component's superclasses, - as well. + This list of attributes is inherited from the component's superclasses, + as well. - @property attributeBindings - @type Array - @default [] - @public + @property attributeBindings + @type Array + @default [] + @public */ concatenatedProperties: ['attributeBindings'], @@ -76,16 +72,16 @@ export default Mixin.create({ // /** - Return the nearest ancestor that is an instance of the provided - class or mixin. - - @method nearestOfType - @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), - or an instance of Mixin. - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private - */ + Return the nearest ancestor that is an instance of the provided + class or mixin. + + @method nearestOfType + @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), + or an instance of Mixin. + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private + */ nearestOfType(klass) { let view = this.parentView; let isOfType = @@ -100,14 +96,14 @@ export default Mixin.create({ }, /** - Return the nearest ancestor that has a given property. - - @method nearestWithProperty - @param {String} property A property name - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private - */ + Return the nearest ancestor that has a given property. + + @method nearestWithProperty + @param {String} property A property name + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private + */ nearestWithProperty(property) { let view = this.parentView; @@ -120,22 +116,22 @@ export default Mixin.create({ }, /** - Renders the view again. This will work regardless of whether the - view is already in the DOM or not. If the view is in the DOM, the - rendering process will be deferred to give bindings a chance - to synchronize. - - If children were added during the rendering process using `appendChild`, - `rerender` will remove them, because they will be added again - if needed by the next `render`. - - In general, if the display of your view changes, you should modify - the DOM element directly instead of manually calling `rerender`, which can - be slow. - - @method rerender - @public - */ + Renders the view again. This will work regardless of whether the + view is already in the DOM or not. If the view is in the DOM, the + rendering process will be deferred to give bindings a chance + to synchronize. + + If children were added during the rendering process using `appendChild`, + `rerender` will remove them, because they will be added again + if needed by the next `render`. + + In general, if the display of your view changes, you should modify + the DOM element directly instead of manually calling `rerender`, which can + be slow. + + @method rerender + @public + */ rerender() { return this._currentState.rerender(this); }, @@ -145,12 +141,12 @@ export default Mixin.create({ // /** - Returns the current DOM element for the view. + Returns the current DOM element for the view. - @property element - @type DOMElement - @public - */ + @property element + @type DOMElement + @public + */ element: descriptor({ configurable: false, enumerable: false, @@ -160,55 +156,22 @@ export default Mixin.create({ }), /** - Returns a jQuery object for this view's element. If you pass in a selector - string, this method will return a jQuery object, using the current element - as its buffer. - - For example, calling `view.$('li')` will return a jQuery object containing - all of the `li` elements inside the DOM element of this view. - - @method $ - @param {String} [selector] a jQuery-compatible selector string - @return {jQuery} the jQuery object for the DOM node - @public - */ - $(sel) { - assert( - "You cannot access this.$() on a component with `tagName: ''` specified.", - this.tagName !== '' - ); - assert('You cannot access this.$() with `jQuery` disabled.', !jQueryDisabled); - deprecate( - 'Using this.$() in a component has been deprecated, consider using this.element', - false, - { - id: 'ember-views.curly-components.jquery-element', - until: '4.0.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis', - } - ); - if (this.element) { - return sel ? jQuery(sel, this.element) : jQuery(this.element); - } - }, + Appends the view's element to the specified parent element. - /** - Appends the view's element to the specified parent element. - - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the given element until all bindings have - finished synchronizing. - - This is not typically a function that you will need to call directly when - building your application. If you do need to use `appendTo`, be sure that - the target element you are providing is associated with an `Application` - and does not have an ancestor element that is associated with an Ember view. - - @method appendTo - @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object - @return {Ember.View} receiver - @private - */ + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the given element until all bindings have + finished synchronizing. + + This is not typically a function that you will need to call directly when + building your application. If you do need to use `appendTo`, be sure that + the target element you are providing is associated with an `Application` + and does not have an ancestor element that is associated with an Ember view. + + @method appendTo + @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object + @return {Ember.View} receiver + @private + */ appendTo(selector) { let target; @@ -251,166 +214,166 @@ export default Mixin.create({ }, /** - Appends the view's element to the document body. If the view does - not have an HTML representation yet - the element will be generated automatically. - - If your application uses the `rootElement` property, you must append - the view within that element. Rendering views outside of the `rootElement` - is not supported. - - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the document body until all bindings have - finished synchronizing. - - @method append - @return {Ember.View} receiver - @private - */ + Appends the view's element to the document body. If the view does + not have an HTML representation yet + the element will be generated automatically. + + If your application uses the `rootElement` property, you must append + the view within that element. Rendering views outside of the `rootElement` + is not supported. + + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the document body until all bindings have + finished synchronizing. + + @method append + @return {Ember.View} receiver + @private + */ append() { return this.appendTo(document.body); }, /** - The HTML `id` of the view's element in the DOM. You can provide this - value yourself but it must be unique (just as in HTML): + The HTML `id` of the view's element in the DOM. You can provide this + value yourself but it must be unique (just as in HTML): - ```handlebars - {{my-component elementId="a-really-cool-id"}} - ``` + ```handlebars + {{my-component elementId="a-really-cool-id"}} + ``` - If not manually set a default value will be provided by the framework. + If not manually set a default value will be provided by the framework. - Once rendered an element's `elementId` is considered immutable and you - should never change it. If you need to compute a dynamic value for the - `elementId`, you should do this when the component or element is being - instantiated: + Once rendered an element's `elementId` is considered immutable and you + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: - ```app/components/my-component.js - import Component from '@ember/component'; + ```app/components/my-component.js + import Component from '@ember/component'; - export default Component.extend({ + export default Component.extend({ init() { this._super(...arguments); let index = this.get('index'); this.set('elementId', 'component-id' + index); } }); - ``` + ``` - @property elementId - @type String - @public - */ + @property elementId + @type String + @public + */ elementId: null, /** - Attempts to discover the element in the parent element. The default - implementation looks for an element with an ID of `elementId` (or the - view's guid if `elementId` is null). You can override this method to - provide your own form of lookup. For example, if you want to discover your - element using a CSS class name instead of an ID. - - @method findElementInParentElement - @param {DOMElement} parentElement The parent's DOM element - @return {DOMElement} The discovered element - @private - */ + Attempts to discover the element in the parent element. The default + implementation looks for an element with an ID of `elementId` (or the + view's guid if `elementId` is null). You can override this method to + provide your own form of lookup. For example, if you want to discover your + element using a CSS class name instead of an ID. + + @method findElementInParentElement + @param {DOMElement} parentElement The parent's DOM element + @return {DOMElement} The discovered element + @private + */ findElementInParentElement(parentElem) { let id = `#${this.elementId}`; return jQuery(id)[0] || jQuery(id, parentElem)[0]; }, /** - Called when a view is going to insert an element into the DOM. + Called when a view is going to insert an element into the DOM. - @event willInsertElement - @public - */ + @event willInsertElement + @public + */ willInsertElement: K, /** - Called when the element of the view has been inserted into the DOM. - Override this function to do any set up that requires an element - in the document body. + Called when the element of the view has been inserted into the DOM. + Override this function to do any set up that requires an element + in the document body. - When a view has children, didInsertElement will be called on the - child view(s) first and on itself afterwards. + When a view has children, didInsertElement will be called on the + child view(s) first and on itself afterwards. - @event didInsertElement - @public - */ + @event didInsertElement + @public + */ didInsertElement: K, /** - Called when the view is about to rerender, but before anything has - been torn down. This is a good opportunity to tear down any manual - observers you have installed based on the DOM state + Called when the view is about to rerender, but before anything has + been torn down. This is a good opportunity to tear down any manual + observers you have installed based on the DOM state - @event willClearRender - @public - */ + @event willClearRender + @public + */ willClearRender: K, /** - You must call `destroy` on a view to destroy the view (and all of its - child views). This will remove the view from any parent node, then make - sure that the DOM element managed by the view can be released by the - memory manager. - - @method destroy - @private - */ + You must call `destroy` on a view to destroy the view (and all of its + child views). This will remove the view from any parent node, then make + sure that the DOM element managed by the view can be released by the + memory manager. + + @method destroy + @private + */ destroy() { this._super(...arguments); this._currentState.destroy(this); }, /** - Called when the element of the view is going to be destroyed. Override - this function to do any teardown that requires an element, like removing - event listeners. + Called when the element of the view is going to be destroyed. Override + this function to do any teardown that requires an element, like removing + event listeners. - Please note: any property changes made during this event will have no - effect on object observers. + Please note: any property changes made during this event will have no + effect on object observers. - @event willDestroyElement - @public - */ + @event willDestroyElement + @public + */ willDestroyElement: K, /** - Called after the element of the view is destroyed. + Called after the element of the view is destroyed. - @event willDestroyElement - @public - */ + @event willDestroyElement + @public + */ didDestroyElement: K, /** - Called when the parentView property has changed. + Called when the parentView property has changed. - @event parentViewDidChange - @private - */ + @event parentViewDidChange + @private + */ parentViewDidChange: K, // .......................................................... // STANDARD RENDER PROPERTIES // /** - Tag name for the view's outer element. The tag name is only used when an - element is first created. If you change the `tagName` for an element, you - must destroy and recreate the view element. + Tag name for the view's outer element. The tag name is only used when an + element is first created. If you change the `tagName` for an element, you + must destroy and recreate the view element. - By default, the render buffer will use a `<div>` tag for views. + By default, the render buffer will use a `<div>` tag for views. - @property tagName - @type String - @default null - @public - */ + @property tagName + @type String + @default null + @public + */ // We leave this null by default so we can tell the difference between // the default case and a user-specified tag. @@ -421,15 +384,15 @@ export default Mixin.create({ // /** - Setup a view, but do not finish waking it up. + Setup a view, but do not finish waking it up. - * configure `childViews` - * register the view with the global views hash, which is used for event - dispatch + * configure `childViews` + * register the view with the global views hash, which is used for event + dispatch - @method init - @private - */ + @method init + @private + */ init() { this._super(...arguments); @@ -457,14 +420,57 @@ export default Mixin.create({ // /** - Handle events from `EventDispatcher` + Handle events from `EventDispatcher` - @method handleEvent - @param eventName {String} - @param evt {Event} - @private - */ + @method handleEvent + @param eventName {String} + @param evt {Event} + @private + */ handleEvent(eventName, evt) { return this._currentState.handleEvent(this, eventName, evt); }, -}); +}; + +if (JQUERY_INTEGRATION) { + /** + Returns a jQuery object for this view's element. If you pass in a selector + string, this method will return a jQuery object, using the current element + as its buffer. + + For example, calling `view.$('li')` will return a jQuery object containing + all of the `li` elements inside the DOM element of this view. + + @method $ + @param {String} [selector] a jQuery-compatible selector string + @return {jQuery} the jQuery object for the DOM node + @public + @deprecated + */ + mixin.$ = function $(sel) { + assert( + "You cannot access this.$() on a component with `tagName: ''` specified.", + this.tagName !== '' + ); + assert('You cannot access this.$() with `jQuery` disabled.', !jQueryDisabled); + deprecate( + 'Using this.$() in a component has been deprecated, consider using this.element', + false, + { + id: 'ember-views.curly-components.jquery-element', + until: '4.0.0', + url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis', + } + ); + if (this.element) { + return sel ? jQuery(sel, this.element) : jQuery(this.element); + } + }; +} + +/** + @class ViewMixin + @namespace Ember + @private +*/ +export default Mixin.create(mixin);
true
Other
emberjs
ember.js
2aa22eed70030e837dbe2b500b7653653279f25f.json
Add svelte support for jQuery deprecations
packages/@ember/-internals/views/lib/system/event_dispatcher.js
@@ -8,6 +8,7 @@ import ActionManager from './action_manager'; import fallbackViewRegistry from '../compat/fallback-view-registry'; import addJQueryEventDeprecation from './jquery_event_deprecation'; import { contains } from './utils'; +import { JQUERY_INTEGRATION } from '@ember/deprecated-features'; /** @module ember @@ -149,7 +150,7 @@ export default EmberObject.extend({ let rootElementSelector = get(this, 'rootElement'); let rootElement; - if (jQueryDisabled) { + if (!JQUERY_INTEGRATION || jQueryDisabled) { if (typeof rootElementSelector !== 'string') { rootElement = rootElementSelector; } else { @@ -244,7 +245,7 @@ export default EmberObject.extend({ return; } - if (jQueryDisabled) { + if (!JQUERY_INTEGRATION || jQueryDisabled) { let viewHandler = (target, event) => { let view = viewRegistry[target.id]; let result = true; @@ -436,7 +437,7 @@ export default EmberObject.extend({ return; } - if (jQueryDisabled) { + if (!JQUERY_INTEGRATION || jQueryDisabled) { for (let event in this._eventHandlers) { rootElement.removeEventListener(event, this._eventHandlers[event]); }
true
Other
emberjs
ember.js
2aa22eed70030e837dbe2b500b7653653279f25f.json
Add svelte support for jQuery deprecations
packages/@ember/-internals/views/lib/system/jquery.js
@@ -1,11 +1,12 @@ import { context } from '@ember/-internals/environment'; import { hasDOM } from '@ember/-internals/browser-environment'; import { ENV } from '@ember/-internals/environment'; +import { JQUERY_INTEGRATION } from '@ember/deprecated-features'; let jQuery; -export let jQueryDisabled = ENV._JQUERY_INTEGRATION === false; +export let jQueryDisabled = !JQUERY_INTEGRATION || ENV._JQUERY_INTEGRATION === false; -if (hasDOM) { +if (JQUERY_INTEGRATION && hasDOM) { jQuery = context.imports.jQuery; if (!jQueryDisabled && jQuery) {
true
Other
emberjs
ember.js
2aa22eed70030e837dbe2b500b7653653279f25f.json
Add svelte support for jQuery deprecations
packages/@ember/-internals/views/lib/system/jquery_event_deprecation.js
@@ -3,9 +3,10 @@ import { deprecate } from '@ember/debug'; import { global } from '@ember/-internals/environment'; import { HAS_NATIVE_PROXY } from '@ember/-internals/utils'; import { DEBUG } from '@glimmer/env'; +import { JQUERY_INTEGRATION } from '@ember/deprecated-features'; export default function addJQueryEventDeprecation(jqEvent) { - if (!DEBUG || !HAS_NATIVE_PROXY) { + if (!JQUERY_INTEGRATION || !DEBUG || !HAS_NATIVE_PROXY) { return jqEvent; }
true
Other
emberjs
ember.js
2aa22eed70030e837dbe2b500b7653653279f25f.json
Add svelte support for jQuery deprecations
packages/@ember/application/lib/application.js
@@ -30,6 +30,7 @@ import Engine from '@ember/engine'; import { privatize as P } from '@ember/-internals/container'; import { setupApplicationRegistry } from '@ember/-internals/glimmer'; import { RouterService } from '@ember/-internals/routing'; +import { JQUERY_INTEGRATION } from '@ember/deprecated-features'; let librariesRegistered = false; @@ -1131,7 +1132,7 @@ function registerLibraries() { if (!librariesRegistered) { librariesRegistered = true; - if (hasDOM && !jQueryDisabled) { + if (JQUERY_INTEGRATION && hasDOM && !jQueryDisabled) { libraries.registerCoreLibrary('jQuery', jQuery().jquery); } }
true
Other
emberjs
ember.js
2aa22eed70030e837dbe2b500b7653653279f25f.json
Add svelte support for jQuery deprecations
packages/@ember/deprecated-features/index.ts
@@ -9,3 +9,4 @@ export const HANDLER_INFOS = !!'3.9.0'; export const ROUTER_EVENTS = !!'3.9.0'; export const TRANSITION_STATE = !!'3.9.0'; export const COMPONENT_MANAGER_STRING_LOOKUP = !!'4.0.0'; +export const JQUERY_INTEGRATION = !!'3.9.0';
true
Other
emberjs
ember.js
2aa22eed70030e837dbe2b500b7653653279f25f.json
Add svelte support for jQuery deprecations
packages/ember/index.js
@@ -125,7 +125,7 @@ import ApplicationInstance from '@ember/application/instance'; import Engine from '@ember/engine'; import EngineInstance from '@ember/engine/instance'; import { assign, merge } from '@ember/polyfills'; -import { LOGGER, EMBER_EXTEND_PROTOTYPES } from '@ember/deprecated-features'; +import { LOGGER, EMBER_EXTEND_PROTOTYPES, JQUERY_INTEGRATION } from '@ember/deprecated-features'; // ****@ember/-internals/environment**** @@ -560,7 +560,7 @@ Object.defineProperty(Ember, 'TEMPLATES', { Ember.VERSION = VERSION; // ****@ember/-internals/views**** -if (!views.jQueryDisabled) { +if (JQUERY_INTEGRATION && !views.jQueryDisabled) { Object.defineProperty(Ember, '$', { get() { deprecate(
true
Other
emberjs
ember.js
2861674ec08fe3c5342af5a084d8ae55e09a20e7.json
Remove unused svelte spike code...
broccoli/deprecated-features.js
@@ -52,51 +52,3 @@ function handleExportedDeclaration(d, map) { } module.exports = DEPRECATED_FEATURES; - -// TODO: remove this, it is primarily just for testing if svelte is working... -function svelte(infile, outfile) { - console.log(DEPRECATED_FEATURES); // eslint-disable-line no-console - const babel = require('babel-core'); // eslint-disable-line node/no-extraneous-require - - let { code } = babel.transformFileSync(infile, { - plugins: [ - [ - 'debug-macros', - { - debugTools: { - source: '@ember/debug', - assertPredicateIndex: 1, - isDebug: false, - }, - svelte: { - 'ember-source': '3.3.0', - }, - flags: [ - { - source: '@glimmer/env', - flags: { DEBUG: false }, - }, - { - name: 'ember-source', - source: '@ember/deprecated-features', - flags: DEPRECATED_FEATURES, - }, - { - source: '@ember/canary-features', - flags: { - EMBER_METAL_TRACKED_PROPERTIES: true, - }, - }, - ], - }, - ], - ], - }); - - fs.writeFileSync(outfile, code); -} - -if (process.env.SVELTE_TEST) { - svelte('dist/es/@ember/-internals/metal/lib/property_get.js', 'property_get.svelte.js'); - svelte('dist/es/@ember/-internals/metal/lib/property_set.js', 'property_set.svelte.js'); -}
false
Other
emberjs
ember.js
3c00987af16c2e80c81895f6e18cfe10db37387f.json
Ensure Ember.$.ajax works properly. The recent `Ember.$` deprecation accidentally introduced a regression when using `Ember.$` as _if_ it were the global `jQuery` object. The specific scenario that this cropped up in was an application calling `Ember.$.ajax`.
packages/ember/index.js
@@ -561,19 +561,26 @@ Ember.VERSION = VERSION; // ****@ember/-internals/views**** if (!views.jQueryDisabled) { - Ember.$ = function() { - deprecate( - "Using Ember.$() has been deprecated, use `import jQuery from 'jquery';` instead", - false, - { - id: 'ember-views.curly-components.jquery-element', - until: '4.0.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis', - } - ); - return views.jQuery.apply(this, arguments); - }; + Object.defineProperty(Ember, '$', { + get() { + deprecate( + "Using Ember.$() has been deprecated, use `import jQuery from 'jquery';` instead", + false, + { + id: 'ember-views.curly-components.jquery-element', + until: '4.0.0', + url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis', + } + ); + + return views.jQuery; + }, + + configurable: true, + enumerable: true, + }); } + Ember.ViewUtils = { isSimpleClick: views.isSimpleClick, getViewElement: views.getViewElement,
true
Other
emberjs
ember.js
3c00987af16c2e80c81895f6e18cfe10db37387f.json
Ensure Ember.$.ajax works properly. The recent `Ember.$` deprecation accidentally introduced a regression when using `Ember.$` as _if_ it were the global `jQuery` object. The specific scenario that this cropped up in was an application calling `Ember.$.ajax`.
packages/ember/tests/reexports_test.js
@@ -2,7 +2,7 @@ import Ember from '../index'; import { FEATURES } from '@ember/canary-features'; import { confirmExport } from 'internal-test-helpers'; import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; -import { jQueryDisabled } from '@ember/-internals/views'; +import { jQueryDisabled, jQuery } from '@ember/-internals/views'; moduleFor( 'ember reexports', @@ -57,12 +57,17 @@ if (!jQueryDisabled) { 'ember reexports: jQuery enabled', class extends AbstractTestCase { [`@test Ember.$ is exported`](assert) { - assert.ok(Ember.$, 'Ember.$ export exists'); expectDeprecation(() => { let body = Ember.$('body').get(0); assert.equal(body, document.body, 'Ember.$ exports working jQuery instance'); }, "Using Ember.$() has been deprecated, use `import jQuery from 'jquery';` instead"); } + + '@test Ember.$ _**is**_ window.jQuery'(assert) { + expectDeprecation(() => { + assert.strictEqual(Ember.$, jQuery); + }, "Using Ember.$() has been deprecated, use `import jQuery from 'jquery';` instead"); + } } ); }
true
Other
emberjs
ember.js
45b1f2e0c40a563471f9b13bdb4c0f73fcd2639c.json
Add v3.7.2 to CHANGELOG.md. [ci skip]
CHANGELOG.md
@@ -19,6 +19,13 @@ - [#17357](https://github.com/emberjs/ember.js/pull/17357) Allow notifyPropertyChange to be imported from @ember/object - [#17413](https://github.com/emberjs/ember.js/pull/17413) Fix missing import in instance-initializer blueprint for ember-mocha +### v3.7.2 (January 22, 2019) + +* Upgrade @glimmer/* packages to 0.35.10. Fixes a few issues: + * Usage of positional arguments with custom components. + * Forwarding attributes via `...attributes` to a dynamic component. + * Prevent errors when rendering many template blocks (`Error: Operand over 16-bits. Got 65536`). + ### v3.7.1 (January 21, 2019) - [#17461](https://github.com/emberjs/ember.js/pull/17461) [BUGFIX] Fix substate interactions with aborts
false
Other
emberjs
ember.js
900028f01704feab6c0411b0efac97db91105c26.json
Add v3.4.8 to CHANGELOG.
CHANGELOG.md
@@ -77,6 +77,13 @@ - [#16978](https://github.com/emberjs/ember.js/pull/16978) [BUGFIX] Properly teardown alias - [#16877](https://github.com/emberjs/ember.js/pull/16877) [CLEANUP] Allow routes to be named "array" and "object" +### v3.4.8 (January 22, 2019) + +* Upgrade @glimmer/* packages to 0.35.10. Fixes a few issues: + * Usage of positional arguments with custom components. + * Forwarding attributes via `...attributes` to a dynamic component. + * Prevent errors when rendering many template blocks (`Error: Operand over 16-bits. Got 65536`). + ### v3.4.7 (December 7, 2018) - [#17271](https://github.com/emberjs/ember.js/pull/17271) [BUGFIX] Update `backburner.js` to 2.4.2.
false
Other
emberjs
ember.js
5a89657ad11d77a7b75ff3a67a06c1c33abb9ae6.json
Add v3.7.1 to CHANGELOG [ci skip] (cherry picked from commit dd7a1990eace1a17fcbc99333bfc7e66de768b7c)
CHANGELOG.md
@@ -18,6 +18,10 @@ - [#17357](https://github.com/emberjs/ember.js/pull/17357) Allow notifyPropertyChange to be imported from @ember/object - [#17413](https://github.com/emberjs/ember.js/pull/17413) Fix missing import in instance-initializer blueprint for ember-mocha +### v3.7.1 (January 21, 2019) + +- [#17461](https://github.com/emberjs/ember.js/pull/17461) [BUGFIX] Fix substate interactions with aborts + ### v3.7.0 (January 7, 2019) - [#17254](https://github.com/emberjs/ember.js/pull/17254) [BREAKING] Explicitly drop support for Node 4
false
Other
emberjs
ember.js
bb1953dab05e6f8e3f8ca8f416b8ec983e7678b7.json
Add deprecation for Ember.$() Deprecated as per RFC386.
packages/ember/index.js
@@ -561,7 +561,18 @@ Ember.VERSION = VERSION; // ****@ember/-internals/views**** if (!views.jQueryDisabled) { - Ember.$ = views.jQuery; + Ember.$ = function() { + deprecate( + "Using Ember.$() has been deprecated, use `import jQuery from 'jquery';` instead", + false, + { + id: 'ember-views.curly-components.jquery-element', + until: '4.0.0', + url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis', + } + ); + return views.jQuery.apply(this, arguments); + }; } Ember.ViewUtils = { isSimpleClick: views.isSimpleClick,
true
Other
emberjs
ember.js
bb1953dab05e6f8e3f8ca8f416b8ec983e7678b7.json
Add deprecation for Ember.$() Deprecated as per RFC386.
packages/ember/tests/reexports_test.js
@@ -52,6 +52,21 @@ moduleFor( } ); +if (!jQueryDisabled) { + moduleFor( + 'ember reexports: jQuery enabled', + class extends AbstractTestCase { + [`@test Ember.$ is exported`](assert) { + assert.ok(Ember.$, 'Ember.$ export exists'); + expectDeprecation(() => { + let body = Ember.$('body').get(0); + assert.equal(body, document.body, 'Ember.$ exports working jQuery instance'); + }, "Using Ember.$() has been deprecated, use `import jQuery from 'jquery';` instead"); + } + } + ); +} + let allExports = [ // @ember/-internals/environment ['ENV', '@ember/-internals/environment', { get: 'getENV' }], @@ -170,7 +185,6 @@ let allExports = [ ['Logger', '@ember/-internals/console', 'default'], // @ember/-internals/views - !jQueryDisabled && ['$', '@ember/-internals/views', 'jQuery'], ['ViewUtils.isSimpleClick', '@ember/-internals/views', 'isSimpleClick'], ['ViewUtils.getViewElement', '@ember/-internals/views', 'getViewElement'], ['ViewUtils.getViewBounds', '@ember/-internals/views', 'getViewBounds'],
true
Other
emberjs
ember.js
c0b6b95fa000bf87a9109253099325e5f2607aeb.json
Add deprecation for this.$() in curly components Deprecated as per RFC386.
packages/@ember/-internals/glimmer/tests/integration/components/curly-components-test.js
@@ -3612,6 +3612,8 @@ if (jQueryDisabled) { class extends RenderingTestCase { ['@test it has a jQuery proxy to the element']() { let instance; + let element1; + let element2; let FooBarComponent = Component.extend({ init() { @@ -3627,13 +3629,17 @@ if (jQueryDisabled) { this.render('{{foo-bar}}'); - let element1 = instance.$()[0]; + expectDeprecation(() => { + element1 = instance.$()[0]; + }, 'Using this.$() in a component has been deprecated, consider using this.element'); this.assertComponentElement(element1, { content: 'hello' }); runTask(() => this.rerender()); - let element2 = instance.$()[0]; + expectDeprecation(() => { + element2 = instance.$()[0]; + }, 'Using this.$() in a component has been deprecated, consider using this.element'); this.assertComponentElement(element2, { content: 'hello' }); @@ -3642,6 +3648,7 @@ if (jQueryDisabled) { ['@test it scopes the jQuery proxy to the component element'](assert) { let instance; + let $span; let FooBarComponent = Component.extend({ init() { @@ -3657,14 +3664,18 @@ if (jQueryDisabled) { this.render('<span class="outer">outer</span>{{foo-bar}}'); - let $span = instance.$('span'); + expectDeprecation(() => { + $span = instance.$('span'); + }, 'Using this.$() in a component has been deprecated, consider using this.element'); assert.equal($span.length, 1); assert.equal($span.attr('class'), 'inner'); runTask(() => this.rerender()); - $span = instance.$('span'); + expectDeprecation(() => { + $span = instance.$('span'); + }, 'Using this.$() in a component has been deprecated, consider using this.element'); assert.equal($span.length, 1); assert.equal($span.attr('class'), 'inner');
true
Other
emberjs
ember.js
c0b6b95fa000bf87a9109253099325e5f2607aeb.json
Add deprecation for this.$() in curly components Deprecated as per RFC386.
packages/@ember/-internals/glimmer/tests/integration/components/dynamic-components-test.js
@@ -835,6 +835,8 @@ if (jQueryDisabled) { class extends RenderingTestCase { ['@test it has a jQuery proxy to the element']() { let instance; + let element1; + let element2; let FooBarComponent = Component.extend({ init() { @@ -850,13 +852,17 @@ if (jQueryDisabled) { this.render('{{component "foo-bar"}}'); - let element1 = instance.$()[0]; + expectDeprecation(() => { + element1 = instance.$()[0]; + }, 'Using this.$() in a component has been deprecated, consider using this.element'); this.assertComponentElement(element1, { content: 'hello' }); runTask(() => this.rerender()); - let element2 = instance.$()[0]; + expectDeprecation(() => { + element2 = instance.$()[0]; + }, 'Using this.$() in a component has been deprecated, consider using this.element'); this.assertComponentElement(element2, { content: 'hello' }); @@ -865,6 +871,7 @@ if (jQueryDisabled) { ['@test it scopes the jQuery proxy to the component element'](assert) { let instance; + let $span; let FooBarComponent = Component.extend({ init() { @@ -880,14 +887,18 @@ if (jQueryDisabled) { this.render('<span class="outer">outer</span>{{component "foo-bar"}}'); - let $span = instance.$('span'); + expectDeprecation(() => { + $span = instance.$('span'); + }, 'Using this.$() in a component has been deprecated, consider using this.element'); assert.equal($span.length, 1); assert.equal($span.attr('class'), 'inner'); runTask(() => this.rerender()); - $span = instance.$('span'); + expectDeprecation(() => { + $span = instance.$('span'); + }, 'Using this.$() in a component has been deprecated, consider using this.element'); assert.equal($span.length, 1); assert.equal($span.attr('class'), 'inner');
true
Other
emberjs
ember.js
c0b6b95fa000bf87a9109253099325e5f2607aeb.json
Add deprecation for this.$() in curly components Deprecated as per RFC386.
packages/@ember/-internals/glimmer/tests/integration/components/life-cycle-test.js
@@ -1603,7 +1603,7 @@ if (!jQueryDisabled) { 'Run loop and lifecycle hooks - jQuery only', class extends RenderingTestCase { ['@test lifecycle hooks have proper access to this.$()'](assert) { - assert.expect(6); + assert.expect(7); let component; let FooBarComponent = Component.extend({ tagName: 'div', @@ -1634,8 +1634,12 @@ if (!jQueryDisabled) { template: 'hello', }); let { owner } = this; - let comp = owner.lookup('component:foo-bar'); - runAppend(comp); + + expectDeprecation(() => { + let comp = owner.lookup('component:foo-bar'); + runAppend(comp); + runTask(() => tryInvoke(component, 'destroy')); + }, 'Using this.$() in a component has been deprecated, consider using this.element'); runTask(() => tryInvoke(component, 'destroy')); } }
true
Other
emberjs
ember.js
c0b6b95fa000bf87a9109253099325e5f2607aeb.json
Add deprecation for this.$() in curly components Deprecated as per RFC386.
packages/@ember/-internals/views/lib/mixins/view_support.js
@@ -5,6 +5,7 @@ import { assert } from '@ember/debug'; import { hasDOM } from '@ember/-internals/browser-environment'; import { matches } from '../system/utils'; import { default as jQuery, jQueryDisabled } from '../system/jquery'; +import { deprecate } from '@ember/debug'; function K() { return this; @@ -177,6 +178,15 @@ export default Mixin.create({ this.tagName !== '' ); assert('You cannot access this.$() with `jQuery` disabled.', !jQueryDisabled); + deprecate( + 'Using this.$() in a component has been deprecated, consider using this.element', + false, + { + id: 'ember-views.curly-components.jquery-element', + until: '4.0.0', + url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis', + } + ); if (this.element) { return sel ? jQuery(sel, this.element) : jQuery(this.element); }
true
Other
emberjs
ember.js
fce8b3bf2f9a3bfb559e2ff8e094ad99fb4ec70e.json
Simplify prod tests * container tests pass in prod build now * omit ember-testing and @ember/debug tests from ember-tests.prod.js
CONTRIBUTING.md
@@ -280,7 +280,7 @@ Note: before using this approach, please be certain your test is really dependin To recreate this build environment locally: * Run `ember serve --environment=production` in a terminal (takes much much longer than a default `ember s`) -* Browse to `localhost:4200/tests/index.html?skipPackage=container,ember-testing,@ember/debug&dist=prod&prod=true` +* Browse to `localhost:4200/tests/index.html?dist=prod&prod=true` ### Single Unexplained Test Suite Failure
true
Other
emberjs
ember.js
fce8b3bf2f9a3bfb559e2ff8e094ad99fb4ec70e.json
Simplify prod tests * container tests pass in prod build now * omit ember-testing and @ember/debug tests from ember-tests.prod.js
RELEASE.md
@@ -132,9 +132,9 @@ end 1. Any feature that has been GOed gets changed to true 1. Run `ember s -prod` 1. Run tests at `http://localhost:4200/tests/index.html` -1. Run production tests `http://localhost:4200/tests/index.html?skipPackage=container,ember-testing,@ember/debug&dist=prod&prod=true` -1. In `.travis.yml`, remove `branches:` section e.g. [this commit](https://github.com/emberjs/ember.js/commit/e38ec5d910721a9e02a819b4105a4875723f4b1b). -1. Now we have to look at the commit just prior to branching 2.4.0.beta-1. Then find the commit after that to start the new branch at. +2. Run production tests `http://localhost:4200/tests/index.html?dist=prod&prod=true` +3. In `.travis.yml`, remove `branches:` section e.g. [this commit](https://github.com/emberjs/ember.js/commit/e38ec5d910721a9e02a819b4105a4875723f4b1b). +4. Now we have to look at the commit just prior to branching 2.4.0.beta-1. Then find the commit after that to start the new branch at. ### Changelog
true
Other
emberjs
ember.js
fce8b3bf2f9a3bfb559e2ff8e094ad99fb4ec70e.json
Simplify prod tests * container tests pass in prod build now * omit ember-testing and @ember/debug tests from ember-tests.prod.js
bin/run-tests.js
@@ -74,20 +74,14 @@ function generateEachPackageTests() { } function generateBuiltTests() { - // Container isn't publicly available. - // ember-testing and @ember/debug are stripped from prod/min. - var common = 'skipPackage=container,ember-testing,@ember/debug'; - - testFunctions.push(() => run(common)); - testFunctions.push(() => run(common + '&dist=min&prod=true')); - testFunctions.push(() => run(common + '&dist=prod&prod=true')); - testFunctions.push(() => run(common + '&enableoptionalfeatures=true&dist=prod&prod=true')); - testFunctions.push(() => run(common + '&legacy=true')); - testFunctions.push(() => run(common + '&legacy=true&dist=min&prod=true')); - testFunctions.push(() => run(common + '&legacy=true&dist=prod&prod=true')); - testFunctions.push(() => - run(common + '&legacy=true&enableoptionalfeatures=true&dist=prod&prod=true') - ); + testFunctions.push(() => run('')); + testFunctions.push(() => run('dist=min&prod=true')); + testFunctions.push(() => run('dist=prod&prod=true')); + testFunctions.push(() => run('enableoptionalfeatures=true&dist=prod&prod=true')); + testFunctions.push(() => run('legacy=true')); + testFunctions.push(() => run('legacy=true&dist=min&prod=true')); + testFunctions.push(() => run('legacy=true&dist=prod&prod=true')); + testFunctions.push(() => run('legacy=true&enableoptionalfeatures=true&dist=prod&prod=true')); } function generateOldJQueryTests() {
true
Other
emberjs
ember.js
fce8b3bf2f9a3bfb559e2ff8e094ad99fb4ec70e.json
Simplify prod tests * container tests pass in prod build now * omit ember-testing and @ember/debug tests from ember-tests.prod.js
ember-cli-build.js
@@ -247,6 +247,7 @@ function buildBundles(packagesES, dependenciesES, templateCompilerDependenciesES '*/tests/**' /* packages */, 'license.js', ], + exclude: ['@ember/debug/tests/**', 'ember-testing/tests/**'], }), bootstrapModule('empty'), ]);
true
Other
emberjs
ember.js
919574fecb2a9a7d649cbe4d46692af193c6b57b.json
Add v3.8.0-beta.2 to CHANGELOG [ci skip] (cherry picked from commit a2dd42ffa95182b6c925b88f6c25a6d1a90e2961)
CHANGELOG.md
@@ -1,5 +1,8 @@ # Ember Changelog +### v3.8.0-beta.2 (January 14, 2019) +- [#17467](https://github.com/emberjs/ember.js/pull/17467) [BUGFIX] Fix substate interactions with aborts + ### v3.8.0-beta.1 (January 7, 2019) - [#17143](https://github.com/emberjs/ember.js/pull/17143) / [#17375](https://github.com/emberjs/ember.js/pull/17375) [FEATURE] Implement Element Modifier Manager RFC (see [emberjs/rfcs#0373](https://github.com/emberjs/rfcs/blob/master/text/0373-Element-Modifier-Managers.md)).
false
Other
emberjs
ember.js
480248e8b757625af598b515148052bfba01d4c7.json
use Date.now instead of Number(new Date())
packages/@ember/-internals/utils/lib/guid.ts
@@ -53,7 +53,7 @@ const NON_OBJECT_GUIDS = new Map(); @type String @final */ -export const GUID_KEY = intern(`__ember${Number(new Date())}`); +export const GUID_KEY = intern(`__ember${Date.now()}`); /** Generates a new guid, optionally saving the guid to the object that you
true
Other
emberjs
ember.js
480248e8b757625af598b515148052bfba01d4c7.json
use Date.now instead of Number(new Date())
packages/@ember/-internals/utils/lib/symbol.ts
@@ -11,7 +11,7 @@ export default function symbol(debugName: string): string { // TODO: Investigate using platform symbols, but we do not // want to require non-enumerability for this API, which // would introduce a large cost. - let id = GUID_KEY + Math.floor(Math.random() * Number(new Date())); + let id = GUID_KEY + Math.floor(Math.random() * Date.now()); let symbol = intern(`__${debugName}${id}__`); GENERATED_SYMBOLS.push(symbol); return symbol;
true
Other
emberjs
ember.js
480248e8b757625af598b515148052bfba01d4c7.json
use Date.now instead of Number(new Date())
packages/@ember/runloop/tests/later_test.js
@@ -26,7 +26,7 @@ function wait(callback, maxWaitCount = 100) { // run loop has to flush, it would have considered // the timer already expired. function pauseUntil(time) { - while (Number(new Date()) < time) { + while (Date.now() < time) { /* do nothing - sleeping */ } } @@ -113,7 +113,7 @@ moduleFor( 1 ); - pauseUntil(Number(new Date()) + 100); + pauseUntil(Date.now() + 100); }); assert.ok(firstRunLoop, 'first run loop captured'); @@ -247,7 +247,7 @@ moduleFor( // fine that they're not called in this run loop; just need to // make sure that invokeLaterTimers doesn't end up scheduling // a negative setTimeout. - pauseUntil(Number(new Date()) + 60); + pauseUntil(Date.now() + 60); }, 1); later(() => {
true
Other
emberjs
ember.js
39c5eb74d4e12089ae6a8199749947efb44b4c1d.json
use Date.now in time function
packages/@ember/instrumentation/index.ts
@@ -105,14 +105,10 @@ function populateListeners(name: string) { } const time = ((): (() => number) => { - let perf: MaybePerf = 'undefined' !== typeof window ? window.performance || {} : {}; + let perf: MaybePerf = 'undefined' !== typeof window ? window.performance : {}; let fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; - // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) - return fn - ? fn.bind(perf) - : () => { - return Number(new Date()); - }; + + return fn ? fn.bind(perf) : Date.now; })(); /**
false
Other
emberjs
ember.js
2648bec5bbcbae51b09376cb386aad364bd2e429.json
Add v3.8.0-beta.1 to CHANGELOG [ci skip] (cherry picked from commit 2ddd49bbc5e05b3c68df9b07d0df2cde06a1f2fd)
CHANGELOG.md
@@ -1,5 +1,20 @@ # Ember Changelog +### v3.8.0-beta.1 (January 7, 2019) + +- [#17143](https://github.com/emberjs/ember.js/pull/17143) / [#17375](https://github.com/emberjs/ember.js/pull/17375) [FEATURE] Implement Element Modifier Manager RFC (see [emberjs/rfcs#0373](https://github.com/emberjs/rfcs/blob/master/text/0373-Element-Modifier-Managers.md)). +- [#17054](https://github.com/emberjs/ember.js/pull/17054) / [#17376](https://github.com/emberjs/ember.js/pull/17376) [FEATURE] Implement `array` helper RFC (see [emberjs/rfcs#0318](https://github.com/emberjs/rfcs/blob/master/text/0318-array-helper.md)) +- [#16735](https://github.com/emberjs/ember.js/pull/16735) [BUGFIX] Observed properties not being marked as enum +- [#17319](https://github.com/emberjs/ember.js/pull/17319) [CLEANUP] Remove deprecated 'POSITIONAL_PARAM_CONFLICT' +- [#17394](https://github.com/emberjs/ember.js/pull/17394) [CLEANUP] Remove deprecated code in mixins/array +- [#17166](https://github.com/emberjs/ember.js/pull/17166) Improve performance of get() / set() +- [#16710](https://github.com/emberjs/ember.js/pull/16710) Deprecation of (private) `NAME_KEY` +- [#17244](https://github.com/emberjs/ember.js/pull/17244) Upgrade to Glimmer VM 0.37.0 +- [#17216](https://github.com/emberjs/ember.js/pull/17216) Use native Error instead of custom Error subclass. +- [#17340](https://github.com/emberjs/ember.js/pull/17340) Remove unused `hooks` variable from qunit-rfc-232 util-test blueprint +- [#17357](https://github.com/emberjs/ember.js/pull/17357) Allow notifyPropertyChange to be imported from @ember/object +- [#17413](https://github.com/emberjs/ember.js/pull/17413) Fix missing import in instance-initializer blueprint for ember-mocha + ### v3.7.0 (January 7, 2019) - [#17254](https://github.com/emberjs/ember.js/pull/17254) [BREAKING] Explicitly drop support for Node 4
false
Other
emberjs
ember.js
b025751325a93d61278c96952aaea220da1e8d88.json
Add v3.7.0 to CHANGELOG [ci skip] (cherry picked from commit e8261a08115432830cf9abbd8c4b1166d8fe2bbb)
CHANGELOG.md
@@ -1,23 +1,18 @@ # Ember Changelog -### v3.7.0-beta.3 (December 24, 2018) +### v3.7.0 (January 7, 2019) +- [#17254](https://github.com/emberjs/ember.js/pull/17254) [BREAKING] Explicitly drop support for Node 4 +- [#17426](https://github.com/emberjs/ember.js/pull/17426) [BUGFIX] Fix 'strict mode does not allow function declarations' +- [#17431](https://github.com/emberjs/ember.js/pull/17431) [BUGFIX] Fix ability to override a computed.volatile - [#17398](https://github.com/emberjs/ember.js/pull/17398) [BUGFIX] Avoid console.trace for every Ember.warn - [#17399](https://github.com/emberjs/ember.js/pull/17399) [BUGFIX] Local variable shadowing assert - [#17403](https://github.com/emberjs/ember.js/pull/17403) [BUGFIX] Ensure legacy build of template compiler can be loaded. - -### v3.7.0-beta.2 (December 17, 2018) - - [#17328](https://github.com/emberjs/ember.js/pull/17328) [BUGFIX] Ensure that delayed transition retrys work - [#17374](https://github.com/emberjs/ember.js/pull/17374) [BUGFIX] Fix cyclic references on Array.prototype - -### v3.7.0-beta.1 (December 6, 2018) - -- [#17254](https://github.com/emberjs/ember.js/pull/17254) [BREAKING] Explicitly drop support for Node 4 -- [#16898](https://github.com/emberjs/ember.js/pull/16898) Add RFC 232 style util test blueprint for Mocha -- [#17128](https://github.com/emberjs/ember.js/pull/17128) [BUGFIX] Fix Sourcemaps build - [#17134](https://github.com/emberjs/ember.js/pull/17134) [CLEANUP] Remove deprecated '_router' - [#17133](https://github.com/emberjs/ember.js/pull/17133) [CLEANUP] Remove deprecated 'property{Did,Will}Change' +- [#16898](https://github.com/emberjs/ember.js/pull/16898) Add RFC 232 style util test blueprint for Mocha ### v3.6.1 (December 18, 2018)
false
Other
emberjs
ember.js
f8364b72102429e0dc0d9ad5b1973a5dc5a87b2f.json
Fix trailing whitespace lint
packages/@ember/polyfills/lib/assign.ts
@@ -17,7 +17,6 @@ export function assign(target: object, ...sources: any[]): any; var c = { company: 'Other Company' }; var d = { company: 'Tilde Inc.' }; assign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }; - ``` @method assign
false
Other
emberjs
ember.js
a9158275054eceed85d6d66b91dd5d01b755c7b8.json
fix issue with overidability of computed.volatile
packages/@ember/-internals/metal/lib/computed.ts
@@ -501,12 +501,11 @@ class ComputedProperty extends Descriptor implements DescriptorWithDependentKeys /* called before property is overridden */ teardown(obj: object, keyName: string, meta?: any): void { - if (this._volatile) { - return; - } - let cache = peekCacheFor(obj); - if (cache !== undefined && cache.delete(keyName)) { - removeDependentKeys(this, obj, keyName, meta); + if (!this._volatile) { + let cache = peekCacheFor(obj); + if (cache !== undefined && cache.delete(keyName)) { + removeDependentKeys(this, obj, keyName, meta); + } } super.teardown(obj, keyName, meta); }
true
Other
emberjs
ember.js
a9158275054eceed85d6d66b91dd5d01b755c7b8.json
fix issue with overidability of computed.volatile
packages/@ember/-internals/metal/tests/computed_test.js
@@ -76,6 +76,16 @@ moduleFor( assert.equal(count, 1, 'should have invoked computed property'); } + ['@test can override volatile computed property'](assert) { + let obj = {}; + + defineProperty(obj, 'foo', computed(function() {}).volatile()); + + set(obj, 'foo', 'boom'); + + assert.equal(obj.foo, 'boom'); + } + ['@test defining computed property should invoke property on set'](assert) { let obj = {}; let count = 0;
true
Other
emberjs
ember.js
cbbc4c4fd014823df44fbdf2eceaec3520014beb.json
Resolve path names correctly
packages/@ember/-internals/metal/lib/property_get.ts
@@ -96,6 +96,10 @@ export function get(obj: object, keyName: string): any { let isFunction = type === 'function'; let isObjectLike = isObject || isFunction; + if (isPath(keyName)) { + return isObjectLike ? _getPath(obj, keyName) : undefined; + } + let value: any; if (isObjectLike) { @@ -119,9 +123,6 @@ export function get(obj: object, keyName: string): any { } if (value === undefined) { - if (isPath(keyName)) { - return _getPath(obj, keyName); - } if ( isObject && !(keyName in obj) &&
false
Other
emberjs
ember.js
5cf65438ca86ed4a3411ce29028509e0ccd0e74c.json
Use Map() for descriptor store
packages/@ember/-internals/meta/lib/meta.ts
@@ -92,7 +92,7 @@ type Listener = RemoveAllListener | StringListener | FunctionListener; let currentListenerVersion = 1; export class Meta { - _descriptors: any | undefined; + _descriptors: Map<string, any> | undefined; _watching: any | undefined; _mixins: any | undefined; _deps: any | undefined; @@ -256,6 +256,20 @@ export class Meta { } } + _findInheritedMap(key: string, subkey: string): any | undefined { + let pointer: Meta | null = this; + while (pointer !== null) { + let map : Map<string, any> = pointer[key]; + if (map !== undefined) { + let value = map.get(subkey); + if (value !== undefined) { + return value; + } + } + pointer = pointer.parent; + } + } + _hasInInheritedSet(key: string, value: any) { let pointer: Meta | null = this; while (pointer !== null) { @@ -461,12 +475,12 @@ export class Meta { : '', !this.isMetaDestroyed() ); - let map = this._getOrCreateOwnMap('_descriptors'); - map[subkey] = value; + let map = this._descriptors || (this._descriptors = new Map()); + map.set(subkey, value); } peekDescriptors(subkey: string) { - let possibleDesc = this._findInherited2('_descriptors', subkey); + let possibleDesc = this._findInheritedMap('_descriptors', subkey); return possibleDesc === UNDEFINED ? undefined : possibleDesc; } @@ -480,16 +494,15 @@ export class Meta { while (pointer !== null) { let map = pointer._descriptors; if (map !== undefined) { - for (let key in map) { + map.forEach((value, key) => { seen = seen === undefined ? new Set() : seen; if (!seen.has(key)) { seen.add(key); - let value = map[key]; if (value !== UNDEFINED) { fn(key, value); } } - } + }); } pointer = pointer.parent; }
false