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

Add support for ember-resolver v13 #186

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mkszepp
Copy link
Contributor

@mkszepp mkszepp commented Sep 19, 2024

ember-resolver v13 is now a native class instead of a EmberObject.

With EmberObject there was possible to reopen the class for making changes to pluralizedTypes.
This isn't anymore working with native classes. For this reason we need to provide users a short instructions like they can configure ember-can inside there app.

The changes are not braking for ember-resolver <= 12 and can be shipped as fix.

fix #185, close #184
implement logic from comment #184 (comment)

The app.js / .ts looks at end like:

import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'my-app/config/environment';
import { extendResolver } from 'ember-can';

export default class App extends Application {
  modulePrefix = config.modulePrefix;
  podModulePrefix = config.podModulePrefix;
  Resolver = extendResolver(Resolver);
}

loadInitializers(App, config.modulePrefix);

Why import { extendResolver } from 'ember-can'; instead of import Resolver from 'ember-can';?
The advantage is, that when an app has already extended the Resolver he can pass his extended resolver and the extending order is not relevant.

PR changes:

  • Add function for app
  • Use old resolver logic only for ember-resolver < 13
  • Add tests for ember-resolver < 12 with current latest ember-source LTS
  • Add instructions for users in install documentation

Copy link

@wozny1989 wozny1989 left a comment

Choose a reason for hiding this comment

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

Nice @mkszepp, looks very nice! 👍

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.

Incompatibility with ember-resolver v13.x
2 participants