Skip to content

docs: explain library secondary entrypoints#67891

Open
weedorflow wants to merge 3 commits intoangular:mainfrom
weedorflow:docs-library-secondary-entrypoints
Open

docs: explain library secondary entrypoints#67891
weedorflow wants to merge 3 commits intoangular:mainfrom
weedorflow:docs-library-secondary-entrypoints

Conversation

@weedorflow
Copy link
Copy Markdown
Contributor

Summary

  • document secondary entrypoints in the library creation guide
  • explain that each secondary entrypoint has its own public-api.ts
  • link to the Angular Package Format entrypoint sections for more detail

Closes #58676

@pullapprove pullapprove bot requested a review from bencodezen March 26, 2026 13:47
@angular-robot angular-robot bot added the area: docs Related to the documentation label Mar 26, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 26, 2026
Copy link
Copy Markdown
Contributor

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a secondary entry-point is, is explained in https://angular.dev/tools/libraries/angular-package-format#entrypoints-and-code-splitting. Over here it should probably explain how to create one instead.

@weedorflow
Copy link
Copy Markdown
Contributor Author

Thanks for the review! I updated the 'Secondary entrypoints' section to focus on how to create a secondary entrypoint (example directory layout + ng-package.json + src/public-api.ts), rather than explaining what it is. Could you please take another look?

Rename the section to 'Creating secondary entrypoints' and restructure
as a numbered 5-step guide covering:
1. directory and file layout
2. ng-package.json configuration
3. exporting symbols from public-api.ts
4. building with ng build
5. importing from the entrypoint in consuming apps

The previous version described the structure but did not walk through
the full creation process end-to-end. This addresses review feedback
requesting actionable creation steps rather than a conceptual overview.
@weedorflow
Copy link
Copy Markdown
Contributor Author

Thanks for the review, @alan-agius4!

I've updated the section based on your feedback. The content now focuses on how to create a secondary entrypoint rather than explaining the concept (which is already covered in the APF docs).

The revised section includes:

  1. Creating the directory structure
  2. Configuring ng-package.json
  3. Exporting symbols from public-api.ts (with a TypeScript example)
  4. Building with ng build
  5. Importing from the secondary entrypoint in a consuming app

Please let me know if this direction is better or if further adjustments are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation should explain the secondary endpoints for library creation

3 participants