refactor(web): export appConfig and add main.spec.ts for bootstrap verification#600
Merged
kyasbal merged 1 commit intoGoogleCloudPlatform:mainfrom Apr 8, 2026
Merged
Conversation
- Removed `KHIIconRegistrationModule` and `...environment.pluginModules` from `imports` in `web/src/app/root.component.ts`. - Removed imports of `KHIIconRegistrationModule` and `environment` from `web/src/app/root.component.ts`. - Created `web/src/main.spec.ts` with a test for `appConfig` initialization. - In `web/src/main.ts`, moved the configuration object from `bootstrapApplication` to a new exported `appConfig` constant. - Added `importProvidersFrom(KHIIconRegistrationModule)` and `importProvidersFrom(...environment.pluginModules)` to `appConfig.providers` in `web/src/main.ts`.
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the Angular bootstrap process by moving configuration into a standalone appConfig object and migrating module imports to application providers. It also adds a new test file web/src/main.spec.ts to verify application initialization. I have no feedback to provide as there were no review comments to evaluate.
K53
approved these changes
Apr 8, 2026
Merged
via the queue into
GoogleCloudPlatform:main
with commit Apr 8, 2026
659a3ac
9 of 10 checks passed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
During the merge of #585, some modules that should have been extracted (e.g., using
importProvidersFrom) were not expanded correctly, causing application initialization to fail. To prevent similar root module configuration errors from passing undetected in the future, this PR adds a unit test to verify that application initialization completes successfully.Changes
main.ts: Refactored to exportappConfigas anApplicationConfigobject. This makes the DI configuration testable.main.spec.ts: Added a new test file that usesTestBedandApplicationInitStatusto verify that allAPP_INITIALIZERs execute without errors.root.component.ts: MovedKHIIconRegistrationModuleandenvironment.pluginModulesfrom component imports tomain.tsproviders to centralize application-level dependencies.Motivation(日本語訳)
#585 のマージの際、モジュール内を展開(
importProvidersFromなどを使用)すべきところを展開しておらず、アプリケーションの初期化に失敗するバグが発生しました。今後、ルートモジュールの構成ミスによってアプリケーションが起動できなくなるのをテストで確実に検知できるようにするため、このPRでは起動設定のテストを追加しました。Changes(日本語訳)
main.ts:bootstrapApplicationに渡していた設定をappConfigとしてエクスポートし、テスト可能にしました。main.spec.ts:TestBedとApplicationInitStatusを使用して、すべてのAPP_INITIALIZERがエラーなく実行されることを確認するテストを追加しました。root.component.ts: コンポーネントのimportsにあったKHIIconRegistrationModuleとenvironment.pluginModulesをmain.tsのprovidersに移動し、アプリケーションレベルの依存関係を集約しました。