Skip to content

Revert "import service instead of inject from '@ember/service'"#418

Merged
mansona merged 2 commits intomasterfrom
revert-415-inject-from-service-deprecated
Mar 24, 2026
Merged

Revert "import service instead of inject from '@ember/service'"#418
mansona merged 2 commits intomasterfrom
revert-415-inject-from-service-deprecated

Conversation

@mansona
Copy link
Copy Markdown
Contributor

@mansona mansona commented Mar 24, 2026

Reverts #415

This was a real breaking change 🙈 I'm going to follow up with another PR that un-reverts it and drops support for unsupported Ember versions 👍

Edit: I also bumped node since we need require(esm) and the node version doesn't matter for the v2 addon 👍

@mansona mansona added the bug label Mar 24, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 24, 2026

📝 Walkthrough

Walkthrough

This PR systematically refactors service injection patterns across the codebase by removing compatibility fallback logic that selected between emberService.service and emberService.inject exports, replacing it with direct named imports of inject as service from @ember/service. Additionally, the Node.js version in Volta configuration is updated from 18.20.3 to 24.14.1.

Changes

Cohort / File(s) Summary
Ember Service Import Refactoring
ember-moment/src/helpers/-base.js, test-app-{3,4,5}.x/app/{controllers,routes}/*
Removed namespace import and compatibility fallback (emberService.service ?? emberService.inject), replacing with direct named import import { inject as service } from '@ember/service'. Pattern applied consistently across helper and all test app versions.
Node.js Version Update
package.json
Volta-managed Node.js version bumped from 18.20.3 to 24.14.1.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 The imports now dance with such grace,
No fallbacks slow down the race,
From eighteen to twenty-four we leap,
With cleaner Ember, no promises to keep! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: reverting a previous commit that changed service imports. It directly reflects the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-415-inject-from-service-deprecated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
package.json (1)

25-25: Volta Node 24.14.1 pin is repo-wide and will enforce Node 24 for test-app-3.x and contributors using Volta.

The root volta configuration will be inherited by test-app-3.x (which extends ../package.json), forcing it to Node 24.14.1. All test apps declare compatible engines (>= 18), but there is no documented Node version requirement in the repo. Verify this Node 24 requirement is intentional and compatible with your Ember/test-app testing strategy before merging.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 25, The root package.json currently pins Volta's Node
version via the "node": "24.14.1" entry which will be inherited by test-app-3.x
and all contributors using Volta; decide whether you intended to force Node 24
across the repo—if not, either remove or relax this pin (e.g., remove the "node"
entry or change it to a range compatible with your test apps like ">=18") or
explicitly document and justify the Node 24 requirement in the repo README and
update test-app-3.x engines if needed; locate the "node" key in package.json to
make the change and ensure any workspace/test-app engine fields remain
consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@package.json`:
- Line 25: The root package.json currently pins Volta's Node version via the
"node": "24.14.1" entry which will be inherited by test-app-3.x and all
contributors using Volta; decide whether you intended to force Node 24 across
the repo—if not, either remove or relax this pin (e.g., remove the "node" entry
or change it to a range compatible with your test apps like ">=18") or
explicitly document and justify the Node 24 requirement in the repo README and
update test-app-3.x engines if needed; locate the "node" key in package.json to
make the change and ensure any workspace/test-app engine fields remain
consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a85a29e7-8eb0-42da-beb7-54f9440aba69

📥 Commits

Reviewing files that changed from the base of the PR and between e2514a4 and f9e6f18.

📒 Files selected for processing (11)
  • ember-moment/src/helpers/-base.js
  • package.json
  • test-app-3.x/app/controllers/index.js
  • test-app-3.x/app/routes/application.js
  • test-app-3.x/app/routes/index.js
  • test-app-4.x/app/controllers/index.js
  • test-app-4.x/app/routes/application.js
  • test-app-4.x/app/routes/index.js
  • test-app-5.x/app/controllers/index.js
  • test-app-5.x/app/routes/application.js
  • test-app-5.x/app/routes/index.js

Copy link
Copy Markdown
Collaborator

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

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

Approving due to conversation in private about how the change here is technically only supported in 3.28 here, and since ember-moment 10 supports 3.16, we need to actually move this change to an ember-moment 11

@mansona mansona merged commit 33a6daf into master Mar 24, 2026
19 of 21 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants