Skip to content

Update generation of import examples for static functions - #1020

Merged
kategengler merged 1 commit into
mainfrom
kg-import-examples
Aug 7, 2026
Merged

Update generation of import examples for static functions#1020
kategengler merged 1 commit into
mainfrom
kg-import-examples

Conversation

@kategengler

Copy link
Copy Markdown
Contributor

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.

Base automatically changed from kg-fix-module-bug to main August 7, 2026 02:11
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.
@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for ember-api-docs ready!

Name Link
🔨 Latest commit d7fbabd
🔍 Latest deploy log https://app.netlify.com/projects/ember-api-docs/deploys/6a753ebfed22bb0009197073
😎 Deploy Preview https://deploy-preview-1020--ember-api-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@kategengler
kategengler merged commit 9da4ad7 into main Aug 7, 2026
4 checks passed
@kategengler
kategengler deleted the kg-import-examples branch August 7, 2026 16:14
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.

2 participants