Skip to content

Commit d0a855c

Browse files
authored
Merge pull request #3 from SeeClickFix/update_for_ember_4.12
Update for ember 4.12
2 parents 0021939 + 955519f commit d0a855c

File tree

22 files changed

+3651
-3044
lines changed

22 files changed

+3651
-3044
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# misc
1414
/coverage/
1515
!.*
16+
.*/
1617
.eslintcache
1718

1819
# ember-try

.eslintrc.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ module.exports = {
3939
// node files
4040
{
4141
files: [
42-
'.eslintrc.js',
43-
'.prettierrc.js',
44-
'.template-lintrc.js',
45-
'ember-cli-build.js',
46-
'index.js',
47-
'testem.js',
48-
'blueprints/*/index.js',
49-
'config/**/*.js',
50-
'tests/dummy/config/**/*.js',
51-
'lib/**/*.js',
52-
'node-tests/**/*.js',
42+
'./.eslintrc.js',
43+
'./.prettierrc.js',
44+
'./.template-lintrc.js',
45+
'./ember-cli-build.js',
46+
'./index.js',
47+
'./testem.js',
48+
'./blueprints/*/index.js',
49+
'./config/**/*.js',
50+
'./tests/dummy/config/**/*.js',
51+
'./lib/**/*.js',
52+
'./node-tests/**/*.js',
5353
],
5454
excludedFiles: ['addon/**', 'addon-test-support/**', 'app/**', 'tests/dummy/app/**'],
5555
parserOptions: {
@@ -69,5 +69,13 @@ module.exports = {
6969
mocha: true,
7070
},
7171
},
72+
{
73+
// Test files:
74+
files: ['tests/**/*-test.{js,ts}'],
75+
extends: ['plugin:qunit/recommended'],
76+
rules: {
77+
'qunit/require-expect': 'warn',
78+
},
79+
},
7280
],
7381
};

.github/workflows/ci.yml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -109,42 +109,6 @@ jobs:
109109
browser: Firefox
110110
bootstrap: 5
111111
- scenario: node-tests
112-
# - scenario: ember-release
113-
# browser: Chrome
114-
# bootstrap: 3
115-
# allow-failure: true
116-
# - scenario: ember-release
117-
# browser: Chrome
118-
# bootstrap: 4
119-
# allow-failure: true
120-
# - scenario: ember-release
121-
# browser: Chrome
122-
# bootstrap: 5
123-
# allow-failure: true
124-
# - scenario: ember-beta
125-
# browser: Chrome
126-
# bootstrap: 3
127-
# allow-failure: true
128-
# - scenario: ember-beta
129-
# browser: Chrome
130-
# bootstrap: 4
131-
# allow-failure: true
132-
# - scenario: ember-beta
133-
# browser: Chrome
134-
# bootstrap: 5
135-
# allow-failure: true
136-
# - scenario: ember-canary
137-
# browser: Chrome
138-
# bootstrap: 3
139-
# allow-failure: true
140-
# - scenario: ember-canary
141-
# browser: Chrome
142-
# bootstrap: 4
143-
# allow-failure: true
144-
# - scenario: ember-canary
145-
# browser: Chrome
146-
# bootstrap: 5
147-
# allow-failure: true
148112
steps:
149113
- name: Checkout code
150114
uses: actions/checkout@v4

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
/ember-cli-build.js
2727
testem.*
2828
/tests/
29+
/yarn-error.log
2930
/yarn.lock
3031
.gitkeep
3132

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ To switch Bootstrap version or preprocessor, see the [setup documentation](http:
2424

2525
Ember Bootstrap works and is fully [tested](https://github.com/kaliber5/ember-bootstrap/actions?query=workflow%3ACI+branch%3Amaster) with
2626

27-
* Ember.js 3.16+ (including all optional features)
27+
* Ember.js 3.28+ (including all optional features)
2828
* Ember CLI 3.15+
29-
* Bootstrap 3 and 4
29+
* Bootstrap 3-5
3030
* all modern evergreen browsers (Chrome, Firefox, Safari, Edge)
31-
* node.js 12+
32-
* FastBoot 3.0+
31+
* node.js 16+
32+
* FastBoot 4.0+
3333
* Embroider: we strive (and test) for maximum compatibility with Embroider, including the most aggressive setting
3434
(`staticComponents`) for tree shaking and code splitting. However as Embroider itself is still considered beta software,
3535
we won't be able to *guarantee* that for the time being.

addon/components/bs-alert.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
class="{{unless this.hidden "alert"}} {{if this.fade "fade"}} {{if this.dismissible "alert-dismissible"}} {{bs-type-class "alert" @type}} {{if this.showAlert (if (macroCondition (macroGetOwnConfig "isNotBS3")) "show" "in")}}"
33
...attributes
44
{{did-update this.showOrHide this._visible}}
5+
{{did-update this.updateVisibility @visible}}
56
>
67
{{#unless this.hidden}}
78
{{#if this.dismissible}}

addon/components/bs-alert.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { later } from '@ember/runloop';
55
import usesTransition from 'ember-bootstrap/utils/decorators/uses-transition';
66
import deprecateSubclassing from 'ember-bootstrap/utils/deprecate-subclassing';
77
import arg from 'ember-bootstrap/utils/decorators/arg';
8-
import { localCopy } from 'tracked-toolbox';
98

109
/**
1110
Implements [Bootstrap alerts](http://getbootstrap.com/components/#alerts)
@@ -74,12 +73,6 @@ export default class Alert extends Component {
7473
@tracked
7574
hidden = !this.visible;
7675

77-
/**
78-
* This is an unfortunate duplication of the previous property, but this is untracked to avoid causing the dreaded "same computation" assertion in GlimmerVM when reading a tracked property before setting it.
79-
* @private
80-
*/
81-
_hidden = !this.visible;
82-
8376
/**
8477
* This property controls if the alert should be visible. If false it might still be in the DOM until the fade animation
8578
* has completed.
@@ -92,15 +85,16 @@ export default class Alert extends Component {
9285
* @default true
9386
* @public
9487
*/
95-
@arg
96-
visible = true;
88+
get visible() {
89+
return this._visible ?? true;
90+
}
9791

9892
/**
9993
* @property _visible
10094
* @private
10195
*/
102-
@localCopy('visible')
103-
_visible;
96+
@tracked
97+
_visible = this.args.visible;
10498

10599
/**
106100
* Set to false to disable the fade out animation when hiding the alert.
@@ -114,7 +108,7 @@ export default class Alert extends Component {
114108
fade = true;
115109

116110
get showAlert() {
117-
return this._visible && this.args.fade !== false;
111+
return this.visible && this.args.fade !== false;
118112
}
119113

120114
/**
@@ -180,7 +174,7 @@ export default class Alert extends Component {
180174
* @private
181175
*/
182176
show() {
183-
this.hidden = this._hidden = false;
177+
this.hidden = false;
184178
}
185179

186180
/**
@@ -191,7 +185,7 @@ export default class Alert extends Component {
191185
* @private
192186
*/
193187
hide() {
194-
if (this._hidden) {
188+
if (this.hidden) {
195189
return;
196190
}
197191

@@ -200,24 +194,29 @@ export default class Alert extends Component {
200194
this,
201195
function () {
202196
if (!this.isDestroyed) {
203-
this.hidden = this._hidden = true;
197+
this.hidden = true;
204198
this.args.onDismissed?.();
205199
}
206200
},
207201
this.fadeDuration
208202
);
209203
} else {
210-
this.hidden = this._hidden = true;
204+
this.hidden = true;
211205
this.args.onDismissed?.();
212206
}
213207
}
214208

215209
@action
216210
showOrHide() {
217-
if (this._visible) {
211+
if (this.visible) {
218212
this.show();
219213
} else {
220214
this.hide();
221215
}
222216
}
217+
218+
@action
219+
updateVisibility() {
220+
this._visible = this.args.visible;
221+
}
223222
}

addon/components/bs-modal/footer.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{else}}
66
{{#if @submitTitle}}
77
<Button @onClick={{@onClose}}>{{bs-default @closeTitle "Ok"}}</Button>
8-
<Button @type={{bs-default @submitButtonType "primary"}} onClick={{@onSubmit}} disabled={{bs-default @submitDisabled false}}>{{@submitTitle}}</Button>
8+
<Button @type={{bs-default @submitButtonType "primary"}} @buttonType="submit" onSubmit={{@onSubmit}} disabled={{bs-default @submitDisabled false}}>{{@submitTitle}}</Button>
99
{{else}}
1010
<Button @type="primary" @onClick={{@onClose}}>{{bs-default @closeTitle "Ok"}}</Button>
1111
{{/if}}

config/ember-try.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,58 @@ module.exports = async function () {
99
useYarn: true,
1010
scenarios: [
1111
{
12-
name: 'ember-lts-3.16',
12+
name: 'ember-lts-3.28',
1313
npm: {
1414
devDependencies: {
15-
'ember-source': '~3.16.0',
15+
'ember-source': '~3.28.0',
1616
bootstrap: bootstrapVersion,
1717
},
1818
},
1919
},
2020
{
21-
name: 'ember-lts-3.20',
21+
name: 'ember-lts-4.4',
2222
npm: {
2323
devDependencies: {
24-
'ember-source': '~3.20.5',
24+
'ember-source': '~4.4.0',
2525
bootstrap: bootstrapVersion,
2626
},
2727
},
2828
},
2929
{
30-
name: 'ember-lts-3.24',
30+
name: 'ember-lts-4.8',
3131
npm: {
3232
devDependencies: {
33-
'ember-source': '~3.24.0',
33+
'ember-source': '~4.8.0',
3434
bootstrap: bootstrapVersion,
3535
},
3636
},
3737
},
3838
{
39-
name: 'ember-lts-3.28',
39+
name: 'ember-lts-4.12',
4040
npm: {
4141
devDependencies: {
42-
'ember-source': '~3.28.0',
42+
'ember-source': '~4.12.0',
4343
bootstrap: bootstrapVersion,
4444
},
4545
},
46+
env: {
47+
FAIL_ON_DEPRECATION: false,
48+
},
4649
},
4750
{
48-
name: 'ember-lts-4.4',
51+
name: 'ember-lts-5.4',
4952
npm: {
5053
devDependencies: {
51-
'ember-source': '~4.4.0',
54+
'ember-source': '~5.4.0',
55+
bootstrap: bootstrapVersion,
56+
},
57+
},
58+
},
59+
{
60+
name: 'ember-lts-5.8',
61+
npm: {
62+
devDependencies: {
63+
'ember-source': '~5.8.0',
5264
bootstrap: bootstrapVersion,
5365
},
5466
},
@@ -113,6 +125,7 @@ module.exports = async function () {
113125
npm: {
114126
devDependencies: {
115127
bootstrap: bootstrapVersion,
128+
'ember-source': '~3.28.0',
116129
},
117130
ember: {
118131
edition: 'classic',

0 commit comments

Comments
 (0)