{"id":15535572,"url":"https://github.com/stefanpenner/ember-strict-resolver","last_synced_at":"2025-04-19T13:50:00.609Z","repository":{"id":20341489,"uuid":"88831456","full_name":"stefanpenner/ember-strict-resolver","owner":"stefanpenner","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-10T20:28:46.000Z","size":4013,"stargazers_count":10,"open_issues_count":28,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T12:37:10.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefanpenner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-20T06:56:48.000Z","updated_at":"2022-08-28T12:39:52.000Z","dependencies_parsed_at":"2022-07-25T12:33:53.893Z","dependency_job_id":null,"html_url":"https://github.com/stefanpenner/ember-strict-resolver","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanpenner%2Fember-strict-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanpenner%2Fember-strict-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanpenner%2Fember-strict-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanpenner%2Fember-strict-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanpenner","download_url":"https://codeload.github.com/stefanpenner/ember-strict-resolver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249010195,"owners_count":21197797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T11:47:20.788Z","updated_at":"2025-04-19T13:50:00.591Z","avatar_url":"https://github.com/stefanpenner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-strict-resolver\n\n[![Build Status](https://travis-ci.org/stefanpenner/ember-strict-resolver.svg?branch=master)](https://travis-ci.org/stefanpenner/ember-strict-resolver)\n\nFast, concise, zero fun resolver for ember apps.\n\n## installation\n```\nember install ember-strict-resolver\n```\n\n## Usage\n\nin app/resolver.js\n```js\nexport { default } from 'ember-strict-resolver';\n```\n\n_For additional improvements when fully using the ember-strict-resolver monkey patching the registry to no longer cache and simply returning the values passed like the following can be produce extra performance._\n\n```js\n// disable the normalization cache as we no longer normalize, the cache has become a bottle neck.\nEmber.Registry.prototype.normalize = function (i) { return i; }\n```\n\n## Migration\n\nMigrating away from use the _ember-resolver/classic_ can be done in piecemeal by supporting a sub-set of the old resolution formats.\n\n\u003e normalize is needed, because without it you will get errors related to failing to be able to inject services that were never normalized in the registry.\n\n```js\n// app/resolver.js\n\nimport Resolver from 'ember-strict-resolver';\n\nexport default class extends Resolver {\n  legacyMappings = {\n    'service:camelCaseNotSupported': 'service:camel-case-not-supported'\n  };\n\n  resolve(_fullName) {\n    return super.resolve(this.legacyMappings[_fullName] || _fullName);\n  }\n  \n  normalize(_fullName) {\n    return this.legacyMappings[_fullName] || _fullName;\n  }\n}\n```\n\nThis will allow you file PRs with libraries that currently do not support the strict resolver in its entirety.\n\nIn the event that you have a component that is failing to resolve correctly with the error `Attempted to lookup \"helper:nameOfVariable\". Use \"helper:name-of-variable\" instead.` please convert your template to use explicit-this. The template lint can be enabled by turning on [no-implicit-this](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-implicit-this.md).\n\nAn example of what this looks like is the following\n\n```hbs\n// addon/components/templates/foo.hbs\n\n\u003cdiv\u003e\n  {{fullName}}\n\u003c/div\u003e\n```\n\nThis will result in the error, `Attempted to lookup \"helper:fullName\". Use \"helper:full-name\" instead.`. The fix for this would be to decide if this is a argument being passed into foo or if this is a local property.\n\n_fullName_ is coming from an invocation of _Foo_ like the following:\n\n```\n\u003cFoo\n  @fullName=\"The Teamster\"\n/\u003e\n```\n\nThen the fix for your template would be:\n\n```hbs\n// addon/components/templates/foo.hbs\n\n\u003cdiv\u003e\n  {{@fullName}}\n\u003c/div\u003e\n```\n\nIf _fullName_ is a property on your component the fix would be:\n\n```hbs\n// addon/components/templates/foo.hbs\n\n\u003cdiv\u003e\n  {{this.fullName}}\n\u003c/div\u003e\n```\n\n# Development of the addon\n\n* `git clone \u003crepository-url\u003e` this repository\n* `cd strict-resolver`\n* `yarn install`\n\n## Running\n\n* `ember serve`\n* Visit your app at [http://localhost:4200](http://localhost:4200).\n\n## Running Tests\n\n* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)\n* `ember test`\n* `ember test --server`\n\n## Building\n\n* `ember build`\n\nFor more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanpenner%2Fember-strict-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanpenner%2Fember-strict-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanpenner%2Fember-strict-resolver/lists"}