Update generation of import examples for static functions - #1020
Merged
Conversation
Previously, all import examples for static functions relied upon there
being a legacy mapping for the API in mappings.json. This meant that
newly added APIs would not display import examples.
Deciding whether to generate an import example now relies on whether the
package contains an `@` or if the package is `rsvp` -- the sole non-@
package that displays import examples today. This strikes a balance of
restoring, even on slightly older versions, the import examples that
should have been there while maintaining no examples on very old (<2.18)
versions.
Additionally added support for @noimport tag in doc blocks to indicate
APIs that do no have imports (aka built-in keywords for use in
templates).
Also added @exampleimport for doc blocks so that import paths can be
overridden. Right now the example import generation expects imports
to always be import { name } from 'module'; but there are cases where
this may not be true so the ability to override and have them specified
in the codebase is preferable.
kategengler
force-pushed
the
kg-import-examples
branch
from
August 7, 2026 02:11
38c9986 to
d7fbabd
Compare
✅ Deploy Preview for ember-api-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
jaredgalanis
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, all import examples for static functions relied upon there
being a legacy mapping for the API in mappings.json. This meant that
newly added APIs would not display import examples.
Deciding whether to generate an import example now relies on whether the
package contains an
@or if the package isrsvp-- the sole non-@package that displays import examples today. This strikes a balance of
restoring, even on slightly older versions, the import examples that
should have been there while maintaining no examples on very old (<2.18)
versions.
Additionally added support for @noimport tag in doc blocks to indicate
APIs that do no have imports (aka built-in keywords for use in
templates).
Also added @exampleimport for doc blocks so that import paths can be
overridden. Right now the example import generation expects imports
to always be import { name } from 'module'; but there are cases where
this may not be true so the ability to override and have them specified
in the codebase is preferable.