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

Add support for ember-concurrency v4 and ember-power-select v8 #512

Merged
merged 1 commit into from
Nov 5, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
- ember-canary
- embroider-safe
- embroider-optimized
- ember-concurrency-v3

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 18 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,22 @@ module.exports = {
},
'ember-cli-babel': { enableTypeScriptTransform: true },
},

init() {
this._super.init.apply(this, arguments);
this.maybeAddConcurrencyPlugin();
},

maybeAddConcurrencyPlugin() {
const VersionChecker = require('ember-cli-version-checker');
const checker = new VersionChecker(this.project);
const dep = checker.for('ember-concurrency');

if (dep.gte('4.0.0')) {
// ember-concurrency v4+ requires a custom babel transform. Once we drop ember-concurrency v3 support we can remove this conditional registration.
this.options.babel.plugins.push(
require.resolve('ember-concurrency/async-arrow-task-transform'),
);
}
},
};
3,048 changes: 547 additions & 2,501 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"ember-auto-import": "^2.6.3",
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.3.0",
"ember-concurrency": "^3.1.0",
"ember-cli-version-checker": "^5.1.2",
"ember-concurrency": "^3.1.0 || ^4.0.2",
"ember-data-table": "^2.1.0",
"ember-file-upload": "^8.4.0",
"ember-focus-trap": "^1.1.0",
Expand Down Expand Up @@ -138,6 +139,7 @@
"chromatic": "^6.5.4",
"concurrently": "^8.2.2",
"ember-auto-import": "^2.7.0",
"ember-basic-dropdown": "^8.3.0",
"ember-cli": "~5.5.0",
"ember-cli-autoprefixer": "^2.0.0",
"ember-cli-clean-css": "^3.0.0",
Expand All @@ -148,7 +150,7 @@
"ember-cli-terser": "^4.0.2",
"ember-load-initializers": "^2.1.2",
"ember-page-title": "^8.1.0",
"ember-power-select": "^7.2.0",
"ember-power-select": "^8.0.0",
"ember-qunit": "^8.0.2",
"ember-resolver": "^11.0.1",
"ember-root-url": "^1.0.1",
Expand Down Expand Up @@ -180,7 +182,7 @@
"webpack": "^5.89.0"
},
"optionalDependencies": {
"ember-power-select": "2.x || 3.x || 4.x || 5.x || 6.x || 7.x"
"ember-power-select": "2.x || 3.x || 4.x || 5.x || 6.x || 7.x || 8.x"
},
"peerDependencies": {
"ember-source": "^4.12.0 || ^5.0.0",
Expand Down
1 change: 1 addition & 0 deletions stories/5-components/Content/AuModal.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const Template = (args) => ({

const OverflowTemplate = (args) => ({
template: hbs`
<BasicDropdownWormhole />
<AuModalContainer />
<AuModal
@modalOpen={{this.modalOpen}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {

const Template = (args) => ({
template: hbs`
<BasicDropdownWormhole />
<PowerSelectMultiple
@allowClear={{this.allowClear}}
@renderInPlace={{this.renderInPlace}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default {

const Template = (args) => ({
template: hbs`
<BasicDropdownWormhole />
<PowerSelect
@allowClear={{this.allowClear}}
@renderInPlace={{this.renderInPlace}}
Expand Down
8 changes: 8 additions & 0 deletions styles/plugins/_p-ember-power-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,14 @@ $ember-power-select-multiple-option-line-height: 1.45;
}
}

.ember-power-select-visually-hidden {
height: 1px;
left: -9999px;
overflow: hidden;
position: absolute;
width: 1px;
}

// RTL styles
.ember-power-select-trigger[dir="rtl"] {
padding: $ember-power-select-trigger-rtl-padding;
Expand Down
5 changes: 5 additions & 0 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if
(macroCondition (macroDependencySatisfies "ember-basic-dropdown" "^8.0.0"))
}}
<BasicDropdownWormhole />
{{/if}}
12 changes: 12 additions & 0 deletions tests/dummy/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ module.exports = async function () {
},
embroiderSafe(),
embroiderOptimized(),
{
name: 'ember-concurrency-v3',
npm: {
dependencies: {
'ember-concurrency': '^3.0.0',
},
devDependencies: {
'ember-basic-dropdown': null,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only installed this because ember-power-select v8 has it listed as a peerDependency. In v7 it's bundled as a dependency.

'ember-power-select': '^7.0.0',
},
},
},
],
};
};
Loading