ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Public `setModifierManager` is not documented

Open chriskrycho opened this issue 5 years ago • 3 comments

The merged RFC specifies a public import setModifierManager:

original RFC text

Ember will provide a new API to assign the modifier manager for a element modifier class:

// my-app/app/modifier/foo.js

import EmberObject from '@ember/object';
import { createManager } from './basic-manager';
import { setModifierManager } from '@ember/modifier';

export default setModifierManager(createManager, EmberObject.extend({
  // ...
}));
// my-app/app/modifier/basic-manager.js

// ...

export function createManager(owner) {
  return new BasicManager(owner);
}

setModifierManager takes two parameters. The first parameter is a function that takes an Owner and returns an instance of a manager. The second parameter is the base class that applications would extend from.

Currently, setModifierManager is undocumented:

https://github.com/emberjs/ember.js/blob/ef3688b0986d06f4902166d8433a0441ae70af46/packages/%40ember/-internals/glimmer/lib/utils/custom-modifier-manager.ts#L1-L5

We should document it!

chriskrycho avatar May 12 '20 16:05 chriskrycho

I see that we don't have documentation still, do we want to? I can grab it if we still do

ddo-ab avatar Oct 02 '25 17:10 ddo-ab

yes, it's public API and should be documented <3 (all the manager APIs should be documented)

NullVoxPopuli avatar Oct 02 '25 17:10 NullVoxPopuli

Actually I think this can be closed? setModifierManager only exists in https://github.com/emberjs/ember.js/blob/11ec39fe49bfccfdfabedab8aaded2d439070a21/packages/%40ember/modifier/index.ts#L10

And setComponentManager already has documentation

ddo-ab avatar Oct 02 '25 18:10 ddo-ab