Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support auto-discovery of Angular packages that need SSR transform #1046

Open
2 tasks
brandonroberts opened this issue Apr 22, 2024 · 0 comments
Open
2 tasks
Assignees
Labels
enhancement New feature or request

Comments

@brandonroberts
Copy link
Member

Which scope/s are relevant/related to the feature request?

platform

Information

We have an internal list of commonly used Angular packages that need SSR transform

https://github.com/analogjs/analog/blob/beta/packages/platform/src/lib/router-plugin.ts#L18

For other cases, we instruct people to add them manually to the ssr.noExternal array in the vite config.

https://analogjs.org/docs/features/server/server-side-rendering#transforming-packages-for-ssr-compatibility

Ideally, we can identify angular packages through the package.json and module field that contains fesm** and add those to the ssr.noExternal array internally. This would reduce the amount of manual configuration for SSR, as well as cryptic errors about injection context on packages we don't track manually.

We could also allow opt-ing out based on the name of the package.

This would be configurable also

analog({
  transformAPFPackages: true | {
    exclude: []
  }
})

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@brandonroberts brandonroberts added the enhancement New feature or request label Apr 22, 2024
@brandonroberts brandonroberts self-assigned this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant