Skip to content

Commit

Permalink
fix typos and link the doc Replacing Component Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueCutOfficial committed Jan 31, 2024
1 parent b211faa commit fc69419
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions DEPRECATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## ember-promise-modals.modals-from-string

_Added in 3.1.0, functionality to be removed in 4.0.0_
_Added in 3.1.0, functionality to be removed in 5.0.0_

The new Embroider build system prefers static imports when dynamically invoking components. To resolve this deprecation, you need to replace the path to the modal component with an imported component class:

Expand Down Expand Up @@ -30,4 +30,6 @@ export class ApplicationController extends Controller {
}
```

This will not work with components organized in the (unsupported) _pods_ structure. If you are using pods, you will need to migrate your component to either the classic structure or to component co-location.
> Caution: old-style components that have their template in `app/templates/components` instead of co-located next to their Javascript in `app/components` can't work correctly when discovered via their component class, because there's no way to locate the template. They should either port to being co-located (which is a simple mechanical transformation and highly recommended) or should import their own template and set it as layout as was traditional in addons before co-location was available.
-- [Replacing Component Helper.md](https://github.com/embroider-build/embroider/blob/main/docs/replacing-component-helper.md#when-youre-invoking-a-component-youve-been-given)
2 changes: 1 addition & 1 deletion addon/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { defer } from 'rsvp';
/**
* @class Modal
* @param {Service} service
* @param {String} name
* @param {String} componentClass
* @param {any} data
* @param {ModalOptions} options
* @method close - closes the modal
Expand Down
2 changes: 1 addition & 1 deletion addon/services/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default Service.extend({
*/
open(componentClass, data, options) {
deprecate(
`Ember Promise Modals: For extendend compatibility with Embroider and it's tree-shaking ability, you need to import and pass in the component class of the modal component you want to display instead of "${componentClass}".`,
`Ember Promise Modals: For extended compatibility with Embroider and its tree-shaking ability, you need to import and pass in the component class of the modal component you want to display instead of "${componentClass}".`,
typeof componentClass !== 'string',
{
id: 'ember-promise-modals.modals-from-string',
Expand Down
2 changes: 1 addition & 1 deletion tests/application/deprecations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module('Application | Deprecations', function (hooks) {
setupPromiseModals(hooks);

if (!ENV.SKIP_EMBROIDER_DEPRECATION_TEST) {
test("opening a modal by it's path triggers a deprecation", async function (assert) {
test('opening a modal by its path triggers a deprecation', async function (assert) {
await visit('/');

assert.dom('.epm-backdrop').doesNotExist();
Expand Down

0 comments on commit fc69419

Please sign in to comment.