Skip to content

feat(angular): allow per-component standalone import paths for better code-splitting - #31303

Open
OS-jacobbell wants to merge 10 commits into
major-9.0from
FW-6470
Open

feat(angular): allow per-component standalone import paths for better code-splitting#31303
OS-jacobbell wants to merge 10 commits into
major-9.0from
FW-6470

Conversation

@OS-jacobbell

@OS-jacobbell OS-jacobbell commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Issue number: resolves #30114


What is the current behavior?

Any standalone components imported by one page are bundled with every page. E.g. a landing page will deliver all Ionic Framework components used by the web app, even if most of them are not used by the landing page. Because all components are imported from one file, build tools don't split the code well.

What is the new behavior?

  • Components can be imported from individual files, allowing build tools to bundle some components only with certain pages. E.g. import { IonToolbar } from '@ionic/angular/ion-toolbar'
  • @ionic/angular is now a barrel file, maintaining backwards compatibility.
  • Replaced ng-packagr build system with calling ngc directly.
  • Changed standalone/src pattern to src/standalone.
  • Made packages/angular/package.json the package.json that will be used in the npm package, in line with the React and Vue packages.

Does this introduce a breaking change?

  • Yes
  • No

Other information

I'm unfamiliar with Angular npm package best practices, I just set up what seems reasonable to match the React and Vue ones. Also not sure if release scripts will need to be updated.

@OS-jacobbell
OS-jacobbell requested a review from a team as a code owner July 29, 2026 16:48
@OS-jacobbell
OS-jacobbell requested a review from BenOsodrac July 29, 2026 16:48
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Jul 29, 2026 7:17pm

Request Review

@github-actions github-actions Bot added package: core @ionic/core package package: angular @ionic/angular package labels Jul 29, 2026

const p = spawn(cmd, args, { cwd: typescriptPath, stdio: 'inherit', shell: true });
const typescriptPath = path.join(__dirname, '..', 'node_modules', '.bin');
const p = spawn(cmd, args, { cwd: typescriptPath, stdio: 'inherit'});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing shell: true fixes a deprecation warning when building.

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

Labels

package: angular @ionic/angular package package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant