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

Update for ember 4.12 #2

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
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 .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
Expand Down
30 changes: 19 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js',
'lib/**/*.js',
'node-tests/**/*.js',
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
'./lib/**/*.js',
'./node-tests/**/*.js',
],
excludedFiles: ['addon/**', 'addon-test-support/**', 'app/**', 'tests/dummy/app/**'],
parserOptions: {
Expand All @@ -69,5 +69,13 @@ module.exports = {
mocha: true,
},
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
rules: {
'qunit/require-expect': 'warn',
},
},
],
};
61 changes: 52 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ jobs:
allow-failure:
- false
scenario:
- ember-lts-3.16
- ember-lts-3.20
- ember-lts-3.24
- ember-lts-3.28
- ember-lts-4.4
- ember-release
- ember-beta
- ember-canary
- ember-lts-4.8
#- ember-lts-4.12 # fails due to bug: https://github.com/emberjs/ember.js/issues/20377
- ember-lts-5.4
- ember-lts-5.8
- ember-default-with-jquery
- ember-classic
- embroider-safe
Expand All @@ -92,16 +90,61 @@ jobs:
- scenario: ember-lts-3.28
browser: Firefox
bootstrap: 5
- scenario: ember-lts-4.4
- scenario: ember-lts-4.8
browser: Firefox
bootstrap: 3
- scenario: ember-lts-4.4
- scenario: ember-lts-4.8
browser: Firefox
bootstrap: 4
- scenario: ember-lts-4.4
- scenario: ember-lts-4.8
browser: Firefox
bootstrap: 5
- scenario: ember-lts-5.8
browser: Firefox
bootstrap: 3
- scenario: ember-lts-5.8
browser: Firefox
bootstrap: 4
- scenario: ember-lts-5.8
browser: Firefox
bootstrap: 5
- scenario: node-tests
- scenario: ember-release
browser: Chrome
bootstrap: 3
allow-failure: true
- scenario: ember-release
browser: Chrome
bootstrap: 4
allow-failure: true
- scenario: ember-release
browser: Chrome
bootstrap: 5
allow-failure: true
- scenario: ember-beta
browser: Chrome
bootstrap: 3
allow-failure: true
- scenario: ember-beta
browser: Chrome
bootstrap: 4
allow-failure: true
- scenario: ember-beta
browser: Chrome
bootstrap: 5
allow-failure: true
- scenario: ember-canary
browser: Chrome
bootstrap: 3
allow-failure: true
- scenario: ember-canary
browser: Chrome
bootstrap: 4
allow-failure: true
- scenario: ember-canary
browser: Chrome
bootstrap: 5
allow-failure: true
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/ember-cli-build.js
testem.*
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ To switch Bootstrap version or preprocessor, see the [setup documentation](http:

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

* Ember.js 3.16+ (including all optional features)
* Ember.js 3.28+ (including all optional features)
* Ember CLI 3.15+
* Bootstrap 3 and 4
* Bootstrap 3-5
* all modern evergreen browsers (Chrome, Firefox, Safari, Edge)
* node.js 12+
* FastBoot 3.0+
* node.js 16+
* FastBoot 4.0+
* Embroider: we strive (and test) for maximum compatibility with Embroider, including the most aggressive setting
(`staticComponents`) for tree shaking and code splitting. However as Embroider itself is still considered beta software,
we won't be able to *guarantee* that for the time being.
Expand Down
1 change: 1 addition & 0 deletions addon/components/bs-alert.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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")}}"
...attributes
{{did-update this.showOrHide this._visible}}
{{did-update this.updateVisibility @visible}}
>
{{#unless this.hidden}}
{{#if this.dismissible}}
Expand Down
33 changes: 16 additions & 17 deletions addon/components/bs-alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { later } from '@ember/runloop';
import usesTransition from 'ember-bootstrap/utils/decorators/uses-transition';
import deprecateSubclassing from 'ember-bootstrap/utils/deprecate-subclassing';
import arg from 'ember-bootstrap/utils/decorators/arg';
import { localCopy } from 'tracked-toolbox';

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

/**
* 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.
* @private
*/
_hidden = !this.visible;

/**
* This property controls if the alert should be visible. If false it might still be in the DOM until the fade animation
* has completed.
Expand All @@ -92,15 +85,16 @@ export default class Alert extends Component {
* @default true
* @public
*/
@arg
visible = true;
get visible() {
return this._visible ?? true;
}

/**
* @property _visible
* @private
*/
@localCopy('visible')
_visible;
@tracked
_visible = this.args.visible;

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

get showAlert() {
return this._visible && this.args.fade !== false;
return this.visible && this.args.fade !== false;
}

/**
Expand Down Expand Up @@ -180,7 +174,7 @@ export default class Alert extends Component {
* @private
*/
show() {
this.hidden = this._hidden = false;
this.hidden = false;
}

/**
Expand All @@ -191,7 +185,7 @@ export default class Alert extends Component {
* @private
*/
hide() {
if (this._hidden) {
if (this.hidden) {
return;
}

Expand All @@ -200,24 +194,29 @@ export default class Alert extends Component {
this,
function () {
if (!this.isDestroyed) {
this.hidden = this._hidden = true;
this.hidden = true;
this.args.onDismissed?.();
}
},
this.fadeDuration
);
} else {
this.hidden = this._hidden = true;
this.hidden = true;
this.args.onDismissed?.();
}
}

@action
showOrHide() {
if (this._visible) {
if (this.visible) {
this.show();
} else {
this.hide();
}
}

@action
updateVisibility() {
this._visible = this.args.visible;
}
}
2 changes: 1 addition & 1 deletion addon/components/bs-modal/footer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{else}}
{{#if @submitTitle}}
<Button @onClick={{@onClose}}>{{bs-default @closeTitle "Ok"}}</Button>
<Button @type={{bs-default @submitButtonType "primary"}} onClick={{@onSubmit}} disabled={{bs-default @submitDisabled false}}>{{@submitTitle}}</Button>
<Button @type={{bs-default @submitButtonType "primary"}} @buttonType="submit" onSubmit={{@onSubmit}} disabled={{bs-default @submitDisabled false}}>{{@submitTitle}}</Button>
{{else}}
<Button @type="primary" @onClick={{@onClose}}>{{bs-default @closeTitle "Ok"}}</Button>
{{/if}}
Expand Down
33 changes: 23 additions & 10 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,58 @@ module.exports = async function () {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.16',
name: 'ember-lts-3.28',
npm: {
devDependencies: {
'ember-source': '~3.16.0',
'ember-source': '~3.28.0',
bootstrap: bootstrapVersion,
},
},
},
{
name: 'ember-lts-3.20',
name: 'ember-lts-4.4',
npm: {
devDependencies: {
'ember-source': '~3.20.5',
'ember-source': '~4.4.0',
bootstrap: bootstrapVersion,
},
},
},
{
name: 'ember-lts-3.24',
name: 'ember-lts-4.8',
npm: {
devDependencies: {
'ember-source': '~3.24.0',
'ember-source': '~4.8.0',
bootstrap: bootstrapVersion,
},
},
},
{
name: 'ember-lts-3.28',
name: 'ember-lts-4.12',
npm: {
devDependencies: {
'ember-source': '~3.28.0',
'ember-source': '~4.12.0',
bootstrap: bootstrapVersion,
},
},
env: {
FAIL_ON_DEPRECATION: false,
},
},
{
name: 'ember-lts-4.4',
name: 'ember-lts-5.4',
npm: {
devDependencies: {
'ember-source': '~4.4.0',
'ember-source': '~5.4.0',
bootstrap: bootstrapVersion,
},
},
},
{
name: 'ember-lts-5.8',
npm: {
devDependencies: {
'ember-source': '~5.8.0',
bootstrap: bootstrapVersion,
},
},
Expand Down Expand Up @@ -113,6 +125,7 @@ module.exports = async function () {
npm: {
devDependencies: {
bootstrap: bootstrapVersion,
'ember-source': '~3.28.0',
},
ember: {
edition: 'classic',
Expand Down
Loading
Loading