Deprecate withServerTransition call and generate static APP_ID#49422
Deprecate withServerTransition call and generate static APP_ID#49422alan-agius4 wants to merge 3 commits intoangular:mainfrom
withServerTransition call and generate static APP_ID#49422Conversation
bf94712 to
30edba2
Compare
|
Nit: You could add an entry to the depreciation guide. |
187ca88 to
8a6c8fe
Compare
There was a problem hiding this comment.
nit: we can extract this value to a separate const to make it more self-documenting:
| factory: () => 'ng', | |
| factory: () => DEFAULT_APP_ID, |
There was a problem hiding this comment.
If it's just static, can we use a value provider? useValue: DEFAULT_APP_ID
There was a problem hiding this comment.
In that case, the default value, will be set in a totally different package since an InjectorToken doesn’t allow useValue.
Ex:
There was a problem hiding this comment.
Should we also remove this call (in the same file)?
angular/packages/platform-server/src/utils.ts
Line 242 in ed110a0
There was a problem hiding this comment.
I did not remove this one as this overload of renderApplication will be deleted in a follow up PR.
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
I’ll add a breaking change message. |
This commit deprecated ` BrowserModule.withServerTransition` instead `APP_ID` should be used instead to configure the app id.
DEPRECATED: `BrowserModule.withServerTransition` has been deprecated. `APP_ID` should be used instead to set the application ID.
NB: Unless, you render multiple Angular applications on the same page, setting an application ID is not necessary.
Before:
```ts
imports: [
BrowserModule.withServerTransition({ appId: 'serverApp' }),
...
]
```
After:
```ts
imports: [
BrowserModule,
{ provide: APP_ID, useValue: 'serverApp' },
...
],
```
Prior to this change, a random application ID was generated each time which forced users using server rendering to provide an application ID themselves. This was needed to handle rare cases when multiple Angular applications are rendered on the same page.
With this change the application ID is no longer generated randomly and instead it is hard coded.
BREAKING CHANGE:
The `APP_ID` token value is no longer randomly generated. If you are bootstrapping multiple application on the same page you will need to set to provide the `APP_ID` yourself.
```ts
bootstrapApplication(ComponentA, {
providers: [
{ provide: APP_ID, useValue: 'app-a' },
// ... other providers ...
]
});
```
This commit removes the usages of `withServerTransition` form tests.
df29310 to
915ab07
Compare
|
@atscott, PTAL. |
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
|
This PR was merged into the repository by commit cf98777. |
Prior to this change, a random application ID was generated each time which forced users using server rendering to provide an application ID themselves. This was needed to handle rare cases when multiple Angular applications are rendered on the same page.
With this change the application ID is no longer generated randomly and instead it is hard coded.
BREAKING CHANGE:
The `APP_ID` token value is no longer randomly generated. If you are bootstrapping multiple application on the same page you will need to set to provide the `APP_ID` yourself.
```ts
bootstrapApplication(ComponentA, {
providers: [
{ provide: APP_ID, useValue: 'app-a' },
// ... other providers ...
]
});
```
PR Close #49422
This commit removes the usages of `withServerTransition` form tests. PR Close #49422
…rverTransition` This commit removes generation of `.withServerTransition` in the universal schematic as is deprecated. DEPRECATED: the `app-id` option in the app-shell and universal schematics has been deprecated without replacement. See: angular/angular#49422 for more information about the rational of this change.
…rverTransition` This commit removes generation of `.withServerTransition` in the universal schematic as is deprecated. DEPRECATED: the `app-id` option in the app-shell and universal schematics has been deprecated without replacement. See: angular/angular#49422 for more information about the rational of this change.
…rverTransition` This commit removes generation of `.withServerTransition` in the universal schematic as is deprecated. DEPRECATED: the `app-id` option in the app-shell and universal schematics has been deprecated without replacement. See: angular/angular#49422 for more information about the rational of this change.
|
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. |
feat(platform-browser): deprecate
withServerTransitioncallThis commit deprecated
BrowserModule.withServerTransitioninsteadAPP_IDshould be used instead to configure the app id.DEPRECATED:
BrowserModule.withServerTransitionhas been deprecated.APP_IDshould be used instead to set the application ID.NB: Unless, you render multiple Angular applications on the same page, setting an application ID is not necessary.
Before:
After:
refactor(core): generate a static application ID.
Prior to this change, a random application ID was generated each time which forced users using server rendering to provide an application ID themselves. This was needed to handle rare cases when multiple Angular applications are rendered on the same page.
With this change the application ID is no longer generated randomly and instead it is hard coded.
BREAKING CHANGE:
The
APP_IDtoken value is no longer randomly generated. If you are bootstrapping multiple application on the same page you will need to set to provide theAPP_IDyourself.