upgrade ember-source to ~3.13 (#266)

Also fixes an issue with owner injection. This must be done in `.create()` and not on `.extend()`. Ember 3.13 seems to be more strict about that one.
This commit is contained in:
Jeldrik Hanschke 2019-10-29 12:31:22 +01:00 committed by GitHub
parent 7e189ab83c
commit 75a198f3e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 41 deletions

View file

@ -157,13 +157,13 @@ export default Controller.extend(Validations, {
});
if (!isEmpty(answer.get('labelTranslation'))) {
return AnswerObject.extend(owner.ownerInjection(), {
return AnswerObject.extend({
i18n: service(),
label: computed('i18n.locale', function() {
return this.i18n.t(this.labelTranslation);
}),
labelTranslation: answer.get('labelTranslation')
}).create();
}).create(owner.ownerInjection());
} else {
return AnswerObject.extend({
label: answer.get('label')
@ -179,11 +179,7 @@ export default Controller.extend(Validations, {
let isFindADate = this.isFindADate;
let lastDate;
// https://github.com/offirgolan/ember-cp-validations#basic-usage---objects
// To lookup validators, container access is required which can cause an issue with Object creation
// if the object is statically imported. The current fix for this is as follows.
let owner = getOwner(this);
let SelectionObject = EmberObject.extend(owner.ownerInjection(), SelectionValidations, {
let SelectionObject = EmberObject.extend(SelectionValidations, {
// forceAnswer and isFreeText must be included in model
// cause otherwise validations can't depend on it
forceAnswer: this.forceAnswer,
@ -214,7 +210,11 @@ export default Controller.extend(Validations, {
labelValue = value;
}
return SelectionObject.create({
// https://github.com/offirgolan/ember-cp-validations#basic-usage---objects
// To lookup validators, container access is required which can cause an issue with Object creation
// if the object is statically imported. The current fix for this is as follows.
let owner = getOwner(this);
return SelectionObject.create(owner.ownerInjection(), {
labelValue,
momentFormat
});

View file

@ -4,7 +4,7 @@ module.exports = {
app: {
javascript: {
pattern: 'assets/*.js',
limit: '385KB',
limit: '390KB',
compression: 'gzip'
},
css: {

View file

@ -65,7 +65,7 @@
"ember-power-calendar-moment": "^0.1.4",
"ember-qunit": "^4.5.1",
"ember-resolver": "^5.3.0",
"ember-source": "~3.12.0",
"ember-source": "~3.13.0",
"ember-test-selectors": "^2.0.0",
"ember-transition-helper": "^1.0.0",
"ember-truth-helpers": "^2.1.0",

View file

@ -224,7 +224,7 @@
esutils "^2.0.2"
js-tokens "^4.0.0"
"@babel/parser@^7.0.0", "@babel/parser@^7.3.4", "@babel/parser@^7.6.0", "@babel/parser@^7.6.3", "@babel/parser@^7.6.4":
"@babel/parser@^7.0.0", "@babel/parser@^7.3.4", "@babel/parser@^7.4.5", "@babel/parser@^7.6.0", "@babel/parser@^7.6.3", "@babel/parser@^7.6.4":
version "7.6.4"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.4.tgz#cb9b36a7482110282d5cb6dd424ec9262b473d81"
integrity sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==
@ -376,7 +376,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-transform-block-scoping@^7.5.5", "@babel/plugin-transform-block-scoping@^7.6.3":
"@babel/plugin-transform-block-scoping@^7.4.4", "@babel/plugin-transform-block-scoping@^7.5.5", "@babel/plugin-transform-block-scoping@^7.6.3":
version "7.6.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz#6e854e51fbbaa84351b15d4ddafe342f3a5d542a"
integrity sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw==
@ -515,6 +515,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-transform-object-assign@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.2.0.tgz#6fdeea42be17040f119e38e23ea0f49f31968bde"
integrity sha512-nmE55cZBPFgUktbF2OuoZgPRadfxosLOpSgzEPYotKSls9J4pEPcembi8r78RU37Rph6UApCpNmsQA4QMWK9Ng==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-transform-object-super@^7.5.5":
version "7.5.5"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9"
@ -697,7 +704,7 @@
"@babel/parser" "^7.6.0"
"@babel/types" "^7.6.0"
"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.6", "@babel/traverse@^7.2.4", "@babel/traverse@^7.3.4", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.6.3":
"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.6", "@babel/traverse@^7.2.4", "@babel/traverse@^7.3.4", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.5.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.6.3":
version "7.6.3"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.3.tgz#66d7dba146b086703c0fb10dd588b7364cec47f9"
integrity sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==
@ -1574,10 +1581,10 @@ ast-types@0.10.1:
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.1.tgz#f52fca9715579a14f841d67d7f8d25432ab6a3dd"
integrity sha512-UY7+9DPzlJ9VM8eY0b2TUZcZvF+1pO0hzMtAyjBYKhOmnvRlqYNYnWdtsMj0V16CGaMlpL0G1jnLbLo4AyotuQ==
ast-types@0.9.6:
version "0.9.6"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9"
integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=
ast-types@0.13.2:
version "0.13.2"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48"
integrity sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA==
astral-regex@^1.0.0:
version "1.0.0"
@ -1877,7 +1884,7 @@ babel-plugin-debug-macros@^0.2.0, babel-plugin-debug-macros@^0.2.0-beta.6:
dependencies:
semver "^5.3.0"
babel-plugin-debug-macros@^0.3.0, babel-plugin-debug-macros@^0.3.2:
babel-plugin-debug-macros@^0.3.0, babel-plugin-debug-macros@^0.3.2, babel-plugin-debug-macros@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/babel-plugin-debug-macros/-/babel-plugin-debug-macros-0.3.3.tgz#29c3449d663f61c7385f5b8c72d8015b069a5cb7"
integrity sha512-E+NI8TKpxJDBbVkdWkwHrKgJi696mnRL8XYrOPYw82veNHPDORM9WIQifl6TpIo8PNy2tU2skPqbfkmHXrHKQA==
@ -2585,7 +2592,7 @@ broccoli-clean-css@^1.1.0:
inline-source-map-comment "^1.0.5"
json-stable-stringify "^1.0.0"
broccoli-concat@^3.2.2, broccoli-concat@^3.7.4:
broccoli-concat@^3.2.2, broccoli-concat@^3.7.3, broccoli-concat@^3.7.4:
version "3.7.4"
resolved "https://registry.yarnpkg.com/broccoli-concat/-/broccoli-concat-3.7.4.tgz#7371e846eb7a97cb44ccff10f68582bcadcafacd"
integrity sha512-9gRv1tyCQuq2+48DT9DQyxRNLOuwDtHybDeYuWA3g26HFqZd0PGAOeXcLXHpKRhxzrEbU6Gm28dZ/KolMr04cQ==
@ -5410,12 +5417,14 @@ ember-rfc176-data@^0.3.12:
resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.12.tgz#90d82878e69e2ac9a5438e8ce14d12c6031c5bd2"
integrity sha512-g9HeZj/gU5bfIIrGXkP7MhS2b3Vu5DfNUrYr14hy99TgIvtZETO+96QF4WOEUXGjIJdfTRjerVnQlqngPQSv1g==
ember-router-generator@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/ember-router-generator/-/ember-router-generator-1.2.3.tgz#8ed2ca86ff323363120fc14278191e9e8f1315ee"
integrity sha1-jtLKhv8yM2MSD8FCeBkeno8TFe4=
ember-router-generator@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ember-router-generator/-/ember-router-generator-2.0.0.tgz#d04abfed4ba8b42d166477bbce47fccc672dbde0"
integrity sha512-89oVHVJwmLDvGvAUWgS87KpBoRhy3aZ6U0Ql6HOmU4TrPkyaa8pM0W81wj9cIwjYprcQtN9EwzZMHnq46+oUyw==
dependencies:
recast "^0.11.3"
"@babel/parser" "^7.4.5"
"@babel/traverse" "^7.4.5"
recast "^0.18.1"
ember-router-service-polyfill@^1.0.3:
version "1.0.3"
@ -5439,11 +5448,18 @@ ember-source-channel-url@^2.0.1:
dependencies:
got "^8.0.1"
ember-source@~3.12.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.12.0.tgz#92f72894836d4497e704901c1d061c61b066bddf"
integrity sha512-4iA2BgYmNLWysifLyt2LCQgU9ux/NiTR/MT7KTt9HUyTDJyivcdyKNtfrUQst/1InUvn+MxuQ0ZsbQICJkX6yA==
ember-source@~3.13.0:
version "3.13.3"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.13.3.tgz#65794f79dec0512d833332575f13c77f9ccae2a1"
integrity sha512-aDmzAwpCa4H6ozd+RbsQs9/Pfo4wbnDVe9eb2D05PH9W6zRpiUa+pTluJsUFDfbi+jYGPQnjty2U/UQYBayFvg==
dependencies:
"@babel/helper-module-imports" "^7.0.0"
"@babel/plugin-transform-block-scoping" "^7.4.4"
"@babel/plugin-transform-object-assign" "^7.2.0"
"@ember/edition-utils" "^1.1.1"
babel-plugin-debug-macros "^0.3.3"
babel-plugin-filter-imports "^3.0.0"
broccoli-concat "^3.7.3"
broccoli-funnel "^2.0.2"
broccoli-merge-trees "^3.0.2"
chalk "^2.4.2"
@ -5454,10 +5470,11 @@ ember-source@~3.12.0:
ember-cli-path-utils "^1.0.0"
ember-cli-string-utils "^1.1.0"
ember-cli-version-checker "^3.1.3"
ember-router-generator "^1.2.3"
ember-router-generator "^2.0.0"
inflection "^1.12.0"
jquery "^3.4.1"
resolve "^1.11.1"
silent-error "^1.1.1"
ember-template-lint@^1.1.0:
version "1.3.0"
@ -5803,7 +5820,7 @@ espree@^5.0.1:
acorn-jsx "^5.0.0"
eslint-visitor-keys "^1.0.0"
esprima@^3.1.3, esprima@~3.1.0:
esprima@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=
@ -10089,16 +10106,6 @@ realize-package-specifier@~3.0.1:
dezalgo "^1.0.1"
npm-package-arg "^4.1.1"
recast@^0.11.3:
version "0.11.23"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3"
integrity sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=
dependencies:
ast-types "0.9.6"
esprima "~3.1.0"
private "~0.1.5"
source-map "~0.5.0"
recast@^0.12.0:
version "0.12.9"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.12.9.tgz#e8e52bdb9691af462ccbd7c15d5a5113647a15f1"
@ -10110,6 +10117,16 @@ recast@^0.12.0:
private "~0.1.5"
source-map "~0.6.1"
recast@^0.18.1:
version "0.18.5"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.18.5.tgz#9d5adbc07983a3c8145f3034812374a493e0fe4d"
integrity sha512-sD1WJrpLQAkXGyQZyGzTM75WJvyAd98II5CHdK3IYbt/cZlU0UzCRVU11nUFNXX9fBVEt4E9ajkMjBlUlG+Oog==
dependencies:
ast-types "0.13.2"
esprima "~4.0.0"
private "^0.1.8"
source-map "~0.6.1"
redeyed@~1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-1.0.1.tgz#e96c193b40c0816b00aec842698e61185e55498a"
@ -10955,7 +10972,7 @@ source-map@0.4.x, source-map@^0.4.2:
dependencies:
amdefine ">=0.0.4"
source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.0:
source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7:
version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=