-
Notifications
You must be signed in to change notification settings - Fork 12k
refactor(@angular/ssr): export tokens from the /tokens
entry point
#28678
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
Conversation
"src/**/*.ts", | ||
], | ||
), | ||
module_name = "@angular/ssr/tokens", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other ideas for as an entry-point name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@angular/ssr/tokens
seems reasonable to me.
This commit relocates the DI tokens to a dedicated entry point. This change ensures that we do not depend on tree-shaking to eliminate server code from client bundles. Closes angular#28670
1ffc13a
to
3a42d88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the goal to support users doing:
import { REQUEST } from '@angular/ssr/tokens';
inject(REQUEST, { optional: true });
And be able to run that on the client without a risk of retaining server code?
I can see some users having encountering friction from having to import the non-default entry point, but IDE auto-imports should mostly solve that problem, and reducing the risk of server code in the client bundle seems worth the trade-off.
"src/**/*.ts", | ||
], | ||
), | ||
module_name = "@angular/ssr/tokens", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@angular/ssr/tokens
seems reasonable to me.
Correct. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit relocates the DI tokens to a dedicated entry point. This change ensures that we do not depend on tree-shaking to eliminate server code from client bundles.
Closes #28670