-
Notifications
You must be signed in to change notification settings - Fork 371
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
[DO NOT MERGE] CXSPA-6939 (PoC) Handling breaking changes related to SSR Error Handling #18789
Open
pawelfras
wants to merge
10
commits into
epic/ssr-error-handling
Choose a base branch
from
feat/CXSPA-6939-poc-handling-breaking-changes
base: epic/ssr-error-handling
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
84e5f45
feat: CXSPA-6939 (PoC) Handling breaking changes related to SSR Error…
pawelfras 2e6ab07
Add license header
github-actions[bot] f8143ee
refactor: two toggles for strict error handling and server error prop…
pawelfras 785f958
Merge branch 'epic/ssr-error-handling' into feat/CXSPA-6939-poc-handl…
pawelfras 398d7f2
adjust prop name in CxErrorHandlerEffect
pawelfras 8e05980
refactor: add an example of fallback if error is undefined
pawelfras b2eb19b
Add license header
github-actions[bot] cba8cbc
chore: mark places associated with ticket CXSPA-6980
pawelfras a08e7df
chore: mark places associated with ticket CXSPA-7197
pawelfras a8f2809
chore: mark places associated with ticket CXSPA-7198
pawelfras File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
core-libs/setup/ssr/error-handling/enable-ssr-error-handling.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <spartacus-team@sap.com> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { InjectionToken } from '@angular/core'; | ||
|
||
/** | ||
* Toggle for enabling the SSR error handling. | ||
*/ | ||
export const ENABLE_SSR_ERROR_HANDLING = new InjectionToken<boolean>( | ||
'ENABLE_SSR_ERROR_HANDLING' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import { ConfigInitializerModule } from './config/config-initializer/config-init | |
import { ConfigValidatorModule } from './config/config-validator/config-validator.module'; | ||
import { ConfigModule } from './config/config.module'; | ||
import { ErrorHandlingModule, HttpErrorHandlerModule } from './error-handling'; | ||
import { EffectsErrorHandlerModule } from './error-handling/effects-error-handler/effects-error-handler.module'; | ||
import { FeaturesConfigModule } from './features-config/features-config.module'; | ||
import { GlobalMessageModule } from './global-message/global-message.module'; | ||
import { HttpModule } from './http/http.module'; | ||
|
@@ -24,6 +23,7 @@ import { StateModule } from './state/state.module'; | |
|
||
@NgModule({ | ||
imports: [ | ||
// breaking change - HttpErrorHandlerInterceptor may have featureService inside manipulate the behavior (implemented) OR we can inform in docs that this module has to be imported | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FeatureToggles for the win. It's easy, simple, documented. |
||
HttpErrorHandlerModule.forRoot(), // Import this module before any other interceptor to handle HTTP errors efficiently | ||
StateModule.forRoot(), | ||
ConfigModule.forRoot(), | ||
|
@@ -40,7 +40,6 @@ import { StateModule } from './state/state.module'; | |
LazyLoadingModule.forRoot(), | ||
HttpModule.forRoot(), | ||
ErrorHandlingModule.forRoot(), | ||
EffectsErrorHandlerModule.forRoot(), | ||
], | ||
}) | ||
export class BaseCoreModule { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm sorry. I don't get the problem - what a breaking change we have? TS Type? Behavior?
And how we're mitigating it?
And if introducing any temporary solutions (e.g. deprecated things), when will we remove them?
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.
As we discussed, usage of a new type in the constructor or making the constructor's params required provide breaking changes.
Action points for such cases:
ErrorActionType
typeerror/payload
paramundefined
(assignnew Error
)