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
WIP: fix Ember.computed.bool is not a function #351
WIP: fix Ember.computed.bool is not a function #351
Conversation
(Edited) FYI, this pull request fixes the issue for me. For anyone needing this PR, you can install using |
Oh, nice. |
@r0one I'm not a maintainer on this package, so I haven't merged your PR, I'm just suggesting how to install it while the maintainers create a new release. I think you should keep this PR open |
Well, I haven't dug Ember's documentation, but according to folks from the other PR, importing Btw I haven't ran any tests... The other PR seemed to have been taken much more seriously haha But you're right, I'll keep it open and in WIP status so that it gets the maintainers' attention, they'll decide what to do with it. |
I think that is because ember-moment is on a very old version of ember-cli-babel. |
@r0one if you want to rebase, that'd be great -- I setup GitHub Actions, so we have CI now -- we can make sure this doesn't break anything |
👀 |
Wouldn't this pull request be considered a breaking change? Since the code is no longer converting whatever value is set into a Boolean. Wouldn't the solution be to do the same thing that computer.bool does and wrap "Boolean()" around the fetched value. |
I think the next release we do of ember-moment is going to be a breaking change anyway, because we can't test against 3.13+ atm |
If anyone is blocked to upgrade
diff --git a/node_modules/ember-moment/addon/helpers/-base.js b/node_modules/ember-moment/addon/helpers/-base.js
index b3fbb05..e93671a 100644
--- a/node_modules/ember-moment/addon/helpers/-base.js
+++ b/node_modules/ember-moment/addon/helpers/-base.js
@@ -6,7 +6,8 @@ import { inject as service } from '@ember/service';
export default Helper.extend({
moment: service(),
disableInterval: false,
- globalAllowEmpty: computed.bool('moment.__config__.allowEmpty'),
+ globalAllowEmpty: computed('moment.__config__.allowEmpty', function()
+ {return this.get('moment.__config__.allowEmpty'); }),
supportsGlobalAllowEmpty: true,
localeOrTimeZoneChanged: observer('moment.locale', 'moment.timeZone', function() {
this.recompute(); |
thanks for the stop-gap @esbanarango -- I think since it's been 8 days since asking for a rebase, I'm going to take this over. I'll post back here when released (if CI for existing support matrix is green) |
superseded by #359 |
Fix released in 8.0.2 |
When using the moment-format helper on an ember app transpiled for the latest 2 versions of Chrome and Firefox (tested on Firefox 90.0.2), I get the following error:
Uncaught (in promise) TypeError: Ember.computed.bool is not a function
(stack trace below).This seems to be caused by this transpiled code:
The source code is very similar, I believe that
computed.bool
has been deprecated and thatcomputed
is now a decorator.