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

Switch deprecated Ember.String.pluralize() over to ember-inflector #533

Merged

Conversation

blkeller
Copy link
Contributor

Description

Ember.String.pluralize() has been deprecated: emberjs/ember-inflector#131. Because of this, our project that uses emberfire was throwing a large number of warnings during the Ember test suite, all of which were traceable back to emberfire. This patch takes the recommended approach of importing from ember-inflector.

Code sample

Not applicable, but here's an example of the deprecation warnings seen on a single test without this patch in place:

    ---
        Log: |
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    findAll@http://localhost:39544/assets/vendor.js:86472:17\\n    _findAll@http://localhost:39544/assets/vendor.js:96687:17\\n    _fetchAll@http://localhost:39544/assets/vendor.js:99383:27\\n    findAll@http://localhost:39544/assets/vendor.js:99351:17\\n    model@http://localhost:39544/assets/emergenttradingcom.js:2302:14\\n    deserialize@http://localhost:39544/assets/vendor.js:49066:14\\n    applyHook@http://localhost:39544/assets/vendor.js:67083:16\\n    runSharedModelHook@http://localhost:39544/assets/vendor.js:67679:20\\n    getModel@http://localhost:39544/assets/vendor.js:67877:14\\n    bind/<@http://localhost:39544/assets/vendor.js:66936:14\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    run@http://localhost:39544/assets/vendor.js:25930:21\\n    run@http://localhost:39544/assets/vendor.js:43351:12\\n    visit@http://localhost:39544/assets/vendor.js:60858:8\\n    helper/</<@http://localhost:39544/assets/vendor.js:60336:16\\n    isolate@http://localhost:39544/assets/vendor.js:61466:17\\n    then/onFulfillment<@http://localhost:39544/assets/vendor.js:61403:16\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    then/<@http://localhost:39544/assets/vendor.js:69522:16\\n    @http://localhost:39544/assets/vendor.js:60350:9\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    listenForChanges@http://localhost:39544/assets/vendor.js:86437:19\\n    recordWasPushed@http://localhost:39544/assets/vendor.js:86406:9\\n    _emberfireHandleRecordPush/<@http://localhost:39544/assets/vendor.js:87172:19\\n    _emberfireHandleRecordPush@http://localhost:39544/assets/vendor.js:87168:15\\n    _push@http://localhost:39544/assets/vendor.js:87204:13\\n    superWrapper@http://localhost:39544/assets/vendor.js:62055:17\\n    _findAll/<@http://localhost:39544/assets/vendor.js:96699:5\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    listenForChanges@http://localhost:39544/assets/vendor.js:86437:19\\n    recordWasPushed@http://localhost:39544/assets/vendor.js:86406:9\\n    _emberfireHandleRecordPush/<@http://localhost:39544/assets/vendor.js:87172:19\\n    _emberfireHandleRecordPush@http://localhost:39544/assets/vendor.js:87168:15\\n    _push@http://localhost:39544/assets/vendor.js:87204:13\\n    superWrapper@http://localhost:39544/assets/vendor.js:62055:17\\n    _findAll/<@http://localhost:39544/assets/vendor.js:96699:5\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    listenForChanges@http://localhost:39544/assets/vendor.js:86437:19\\n    recordWasPushed@http://localhost:39544/assets/vendor.js:86406:9\\n    _emberfireHandleRecordPush/<@http://localhost:39544/assets/vendor.js:87172:19\\n    _emberfireHandleRecordPush@http://localhost:39544/assets/vendor.js:87168:15\\n    _push@http://localhost:39544/assets/vendor.js:87204:13\\n    superWrapper@http://localhost:39544/assets/vendor.js:62055:17\\n    _findAll/<@http://localhost:39544/assets/vendor.js:96699:5\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    listenForChanges@http://localhost:39544/assets/vendor.js:86437:19\\n    recordWasPushed@http://localhost:39544/assets/vendor.js:86406:9\\n    _emberfireHandleRecordPush/<@http://localhost:39544/assets/vendor.js:87172:19\\n    _emberfireHandleRecordPush@http://localhost:39544/assets/vendor.js:87168:15\\n    _push@http://localhost:39544/assets/vendor.js:87204:13\\n    superWrapper@http://localhost:39544/assets/vendor.js:62055:17\\n    _findAll/<@http://localhost:39544/assets/vendor.js:96699:5\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    listenForChanges@http://localhost:39544/assets/vendor.js:86437:19\\n    recordWasPushed@http://localhost:39544/assets/vendor.js:86406:9\\n    _emberfireHandleRecordPush/<@http://localhost:39544/assets/vendor.js:87172:19\\n    _emberfireHandleRecordPush@http://localhost:39544/assets/vendor.js:87168:15\\n    _push@http://localhost:39544/assets/vendor.js:87204:13\\n    superWrapper@http://localhost:39544/assets/vendor.js:62055:17\\n    _findAll/<@http://localhost:39544/assets/vendor.js:96699:5\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    listenForChanges@http://localhost:39544/assets/vendor.js:86437:19\\n    recordWasPushed@http://localhost:39544/assets/vendor.js:86406:9\\n    _emberfireHandleRecordPush/<@http://localhost:39544/assets/vendor.js:87172:19\\n    _emberfireHandleRecordPush@http://localhost:39544/assets/vendor.js:87168:15\\n    _push@http://localhost:39544/assets/vendor.js:87204:13\\n    superWrapper@http://localhost:39544/assets/vendor.js:62055:17\\n    _findAll/<@http://localhost:39544/assets/vendor.js:96699:5\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from \\\'ember-inflector\\\'; [deprecation id: ember-inflector.globals]\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    raiseOnDeprecation@http://localhost:39544/assets/vendor.js:29889:9\\n    registerHandler/HANDLERS[type]@http://localhost:39544/assets/vendor.js:30081:9\\n    invoke@http://localhost:39544/assets/vendor.js:30093:9\\n    deprecate@http://localhost:39544/assets/vendor.js:29947:7\\n    get@http://localhost:39544/assets/vendor.js:81763:7\\n    pathForType@http://localhost:39544/assets/vendor.js:86887:7\\n    _getCollectionRef@http://localhost:39544/assets/vendor.js:86896:25\\n    listenForChanges@http://localhost:39544/assets/vendor.js:86437:19\\n    recordWasPushed@http://localhost:39544/assets/vendor.js:86406:9\\n    _emberfireHandleRecordPush/<@http://localhost:39544/assets/vendor.js:87172:19\\n    _emberfireHandleRecordPush@http://localhost:39544/assets/vendor.js:87168:15\\n    _push@http://localhost:39544/assets/vendor.js:87204:13\\n    superWrapper@http://localhost:39544/assets/vendor.js:62055:17\\n    _findAll/<@http://localhost:39544/assets/vendor.js:96699:5\\n    tryCatcher@http://localhost:39544/assets/vendor.js:69280:14\\n    invokeCallback@http://localhost:39544/assets/vendor.js:69458:15\\n    publish@http://localhost:39544/assets/vendor.js:69444:9\\n    @http://localhost:39544/assets/vendor.js:60354:16\\n    invokeWithOnError@http://localhost:39544/assets/vendor.js:25680:21\\n    flush@http://localhost:39544/assets/vendor.js:25550:25\\n    flush@http://localhost:39544/assets/vendor.js:25742:25\\n    end@http://localhost:39544/assets/vendor.js:25852:26\\n    Backburner/this._boundAutorunEnd@http://localhost:39544/assets/vendor.js:25814:17\'\n' }
    ...

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@blkeller
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@blkeller
Copy link
Contributor Author

I tried triggering another round of tests, but it looks like Travis is registering intermittent failures due to Firebase connection timeouts.

I'm not positive, but I don't believe this is related to my code change, right?

not ok 22 Firefox 51.0 - Acceptance: live firebase connection handles live connections in testing
    ---
        message: >
            timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
        stack: >
            [35]</</Runnable.prototype.resetTimeout/this.timer<@http://localhost:7357/assets/test-support.js:6326:19
            
        Log: |
    ...

@p0six
Copy link

p0six commented Dec 1, 2017

my project also throws a large number of these deprecation warnings - kinda annoying :D please correct CI checks and push this through

@erichiggins
Copy link

@blkeller Probably worth triggering the build again to see if there may just have been issues w/ TravisCI that day.

@blkeller
Copy link
Contributor Author

@erichiggins I just tried triggering the build again, but I'm getting timeout failures on that same one test. Looking back at the build history, it's very inconsistent as to whether the failure occurs or not. Over the course of three build events, test suites with identical parameters have passed at some times and failed at others.

Thanks for filing the related issue. Hopefully we'll hear something from a project maintainer soon.

@tchan
Copy link

tchan commented Dec 30, 2017

Any status updates for this?

@theazureshadow
Copy link

Can this be pushed through? This issue may prevent adoption of Ember 3.0, the next Ember version, which is imminent. The errors here seem to be transient build errors.

@jamesdaniels jamesdaniels merged commit 667b133 into FirebaseExtended:master Jan 23, 2018
@jamesdaniels
Copy link
Contributor

Thanks for the PR, sorry for the trouble with the tests.

@blkeller
Copy link
Contributor Author

Thanks for the merge. Any chance of seeing this in a new 2.0.x release to npm soon?

@blkeller blkeller deleted the pluralize-deprecation-fix branch January 23, 2018 18:54
@jamesdaniels
Copy link
Contributor

Yeah, I'll kick off a deploy shortly.

@jamesdaniels
Copy link
Contributor

2.0.9 has been released

@blkeller
Copy link
Contributor Author

Thank you!

@erichiggins
Copy link

Thank you @blkeller and @jamesdaniels !

@blkeller blkeller restored the pluralize-deprecation-fix branch April 21, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants