Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Restore support for Ember 2.x #331

Merged
merged 2 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
matrix:
ember-version:
[
# ember-lts-2.8,
# ember-lts-2.12,
# ember-lts-2.18,
ember-lts-2.8,
ember-lts-2.12,
ember-lts-2.18,
ember-lts-3.4,
ember-lts-3.8,
ember-lts-3.12,
Expand Down
11 changes: 9 additions & 2 deletions addon/-private/data-view/elements/occluded-content.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { set } from '@ember/object';
import { DEBUG } from '@glimmer/env';
import { IS_GLIMMER_2, gte as emberVersionGTE } from 'ember-compatibility-helpers';

import document from '../../utils/document-shim';

Expand All @@ -26,6 +27,12 @@ export default class OccludedContent {
this.isOccludedContent = true;
this.rendered = false;

if (!emberVersionGTE('3.0.0')) {
// In older versions of Ember, binding anything on an object in the template
// adds observers which creates __ember_meta__
this.__ember_meta__ = null; // eslint-disable-line camelcase
}

if (DEBUG) {
Object.preventExtensions(this);
}
Expand All @@ -50,11 +57,11 @@ export default class OccludedContent {
}

get realUpperBound() {
return this.upperBound;
return IS_GLIMMER_2 ? this.upperBound : this.upperBound.previousSibling;
}

get realLowerBound() {
return this.lowerBound;
return IS_GLIMMER_2 ? this.lowerBound : this.lowerBound.nextSibling;
}

get parentNode() {
Expand Down
11 changes: 9 additions & 2 deletions addon/-private/data-view/elements/virtual-component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { set } from '@ember/object';
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';
import { IS_GLIMMER_2, gte as emberVersionGTE } from 'ember-compatibility-helpers';

import document from '../../utils/document-shim';

Expand All @@ -21,17 +22,23 @@ export default class VirtualComponent {

this.rendered = false;

if (!emberVersionGTE('3.0.0')) {
// In older versions of Ember, binding anything on an object in the template
// adds observers which creates __ember_meta__
this.__ember_meta__ = null; // eslint-disable-line camelcase
}

if (DEBUG) {
Object.preventExtensions(this);
}
}

get realUpperBound() {
return this.upperBound;
return IS_GLIMMER_2 ? this.upperBound : this.upperBound.previousSibling;
}

get realLowerBound() {
return this.lowerBound;
return IS_GLIMMER_2 ? this.lowerBound : this.lowerBound.nextSibling;
}

getBoundingClientRect() {
Expand Down
11 changes: 10 additions & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ module.exports = async function() {
},
npm: {
devDependencies: {
'ember-source': null
'ember-source': null,
'ember-factory-for-polyfill': '1.3.1'
},
dependencies: {
'ember-compatibility-helpers': '1.2.1'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this in ember-try since it's a dependency of the addon already now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is required. I confirmed it by dropping it locally and running the try config.

The dependency in the package.json is ^1.2.1, where this is 1.2.1. Wait wait, I agree, the resolutions should take care of that, however practically it doesn't do the trick on its own.

},
resolutions: {
'ember-compatibility-helpers': '1.2.1'
}
},
},
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'@ember/jquery': '^1.1.0',
'ember-source': '~2.12.0'
},
},
Expand All @@ -34,6 +42,7 @@ module.exports = async function() {
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'@ember/jquery': '^1.1.0',
'ember-source': '~2.18.0'
},
},
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
"broccoli-funnel": "^2.0.2",
"broccoli-merge-trees": "^3.0.1",
"broccoli-rollup": "^4.1.1",
"ember-compatibility-helpers": "^1.2.1",
"ember-cli-babel": "^7.12.0",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-version-checker": "^3.1.3",
"ember-raf-scheduler": "0.2.0"
},
"devDependencies": {
"@ember/jquery": "^1.1.0",
"@ember/optional-features": "^0.7.0",
"bootstrap": "~3.3.5",
"broccoli-asset-rev": "^3.0.0",
Expand Down Expand Up @@ -98,8 +98,5 @@
},
"ember-addon": {
"configPath": "tests/dummy/config"
},
"resolutions": {
"ember-compatibility-helpers": "1.2.1"
}
}
2 changes: 1 addition & 1 deletion tests/dummy/config/optional-features.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"jquery-integration": true
"jquery-integration": false
}
63 changes: 48 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -948,18 +948,6 @@
ember-cli-typescript "^2.0.1"
heimdalljs "^0.3.0"

"@ember/jquery@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@ember/jquery/-/jquery-1.1.0.tgz#33d062610a5ceaa5c5c8a3187f870d47d6595940"
integrity sha512-zePT3LiK4/2bS4xafrbOlwoLJrDFseOZ95OOuVDyswv8RjFL+9lar+uxX6+jxRb0w900BcQSWP/4nuFSK6HXXw==
dependencies:
broccoli-funnel "^2.0.2"
broccoli-merge-trees "^3.0.2"
ember-cli-babel "^7.11.1"
ember-cli-version-checker "^3.1.3"
jquery "^3.4.1"
resolve "^1.11.1"

"@ember/optional-features@^0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@ember/optional-features/-/optional-features-0.7.0.tgz#f65a858007020ddfb8342f586112750c32abd2d9"
Expand Down Expand Up @@ -3755,7 +3743,7 @@ ember-cli-babel@^6.12.0, ember-cli-babel@^6.16.0, ember-cli-babel@^6.6.0, ember-
ember-cli-version-checker "^2.1.2"
semver "^5.5.0"

ember-cli-babel@^7.1.0, ember-cli-babel@^7.11.0, ember-cli-babel@^7.11.1, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.20.5, ember-cli-babel@^7.7.0, ember-cli-babel@^7.7.3, ember-cli-babel@^7.8.0:
ember-cli-babel@^7.1.0, ember-cli-babel@^7.11.0, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.20.5, ember-cli-babel@^7.7.0, ember-cli-babel@^7.7.3, ember-cli-babel@^7.8.0:
version "7.23.1"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.23.1.tgz#d1517228ede08a5d4b045c78a7429728e956b30b"
integrity sha512-qYggmt3hRs6QJ6cRkww3ahMpyP8IEV2KFrIRO/Z6hu9MkE/8Y28Xd5NjQl6fPV3oLoG0vwuHzhNe3Jr7Wec8zw==
Expand Down Expand Up @@ -4042,6 +4030,15 @@ ember-cli-version-checker@^4.1.0:
semver "^6.3.0"
silent-error "^1.1.1"

ember-cli-version-checker@^5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-5.1.2.tgz#649c7b6404902e3b3d69c396e054cea964911ab0"
integrity sha512-rk7GY+FmLn/2e22HsZs0Ycrz8HQ1W3Fv+2TFOuEFW9optnDXDgkntPBIl6gact/LHsfBM5RKbM3dHsIIeLgl0Q==
dependencies:
resolve-package-path "^3.1.0"
semver "^7.3.4"
silent-error "^1.1.1"

ember-cli@~3.12.0:
version "3.12.1"
resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.12.1.tgz#b387c206d4091f91685ba7323ececbbcfb80282a"
Expand Down Expand Up @@ -4152,7 +4149,7 @@ ember-code-snippet@^2.4.1:
es6-promise "^1.0.0"
glob "^7.1.3"

ember-compatibility-helpers@1.2.1, ember-compatibility-helpers@^1.1.1:
ember-compatibility-helpers@^1.1.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ember-compatibility-helpers/-/ember-compatibility-helpers-1.2.1.tgz#87c92c4303f990ff455c28ca39fb3ee11441aa16"
integrity sha512-6wzYvnhg1ihQUT5yGqnLtleq3Nv5KNv79WhrEuNU9SwR4uIxCO+KpyC7r3d5VI0EM7/Nmv9Nd0yTkzmTMdVG1A==
Expand All @@ -4161,6 +4158,15 @@ [email protected], ember-compatibility-helpers@^1.1.1:
ember-cli-version-checker "^2.1.1"
semver "^5.4.1"

ember-compatibility-helpers@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/ember-compatibility-helpers/-/ember-compatibility-helpers-1.2.2.tgz#839e0c24190b7a2ec8c39b80e030811b1a95b6d3"
integrity sha512-EKyCGOGBvKkBsk6wKfg3GhjTvTTkcEwzl/cv4VYvZM18cihmjGNpliR4BymWsKRWrv4VJLyq15Vhk3NHkSNBag==
dependencies:
babel-plugin-debug-macros "^0.2.0"
ember-cli-version-checker "^5.1.1"
semver "^5.4.1"

[email protected]:
version "3.11.5"
resolved "https://registry.yarnpkg.com/ember-data/-/ember-data-3.11.5.tgz#8bb0c6b265d1c5345364f29b6aa5b450b9770e2d"
Expand Down Expand Up @@ -6704,6 +6710,13 @@ lowercase-keys@^1.0.0:
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==

lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"

make-dir@^1.0.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
Expand Down Expand Up @@ -8050,6 +8063,14 @@ resolve-package-path@^2.0.0:
path-root "^0.1.1"
resolve "^1.13.1"

resolve-package-path@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/resolve-package-path/-/resolve-package-path-3.1.0.tgz#35faaa5d54a9c7dd481eb7c4b2a44410c9c763d8"
integrity sha512-2oC2EjWbMJwvSN6Z7DbDfJMnD8MYEouaLn5eIX0j8XwPsYCVIyY9bbnX88YHVkbr8XHqvZrYbxaLPibfTYKZMA==
dependencies:
path-root "^0.1.1"
resolve "^1.17.0"

resolve-path@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/resolve-path/-/resolve-path-1.4.0.tgz#c4bda9f5efb2fce65247873ab36bb4d834fe16f7"
Expand All @@ -8063,7 +8084,7 @@ resolve-url@^0.2.1:
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=

resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1:
resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1:
version "1.19.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c"
integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==
Expand Down Expand Up @@ -8234,6 +8255,13 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==

semver@^7.3.4:
version "7.3.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97"
integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==
dependencies:
lru-cache "^6.0.0"

[email protected]:
version "0.17.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
Expand Down Expand Up @@ -9514,6 +9542,11 @@ yallist@^3.0.0:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==

yam@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/yam/-/yam-1.0.0.tgz#7f6c91dc0f5de75a031e6da6b3907c3d25ab0de5"
Expand Down