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

feat: add support for redirect http code in transition plugin #629

Merged
merged 4 commits into from
Dec 24, 2024

Conversation

stas-nc
Copy link
Member

@stas-nc stas-nc commented Dec 20, 2024

Additionally:

  • refactor some file to TS
  • fix issue with tests order and isolation
  • add local ci tools

domain?: string;
};

export type SpecialRoute = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes sense to introduce some common parent interface for Route and SpecialRoute?

@stas-nc stas-nc force-pushed the feature/redirect branch 2 times, most recently from fec8d45 to 273db3f Compare December 24, 2024 11:00
ilc/client/TransitionHooksExecutor.js Show resolved Hide resolved
ilc/common/router/errors.ts Outdated Show resolved Hide resolved
ilc/common/router/errors.ts Outdated Show resolved Hide resolved
Copy link

Coverage Report

Ilc/server

Commit SHA:07e35fd202557d18a00d804e6932b181a8964101

Test coverage results 🧪

Code coverage diff between base branch:master and head branch: feature/redirect 
File details
Status File % Stmts % Branch % Funcs % Lines
🔴 total 91.76 (-0.16) 84.57 (-0.1) 90.64 (0.03) 91.54 (-0.17)
/codebase/client.js 0 100 100 0
/codebase/client.plugins.manifest.js 0 100 100 0
/codebase/server.plugins.manifest.js 100 100 100 100
/codebase/common/DefaultCacheWrapper.spec.ts 100 100 100 100
/codebase/common/DefaultCacheWrapper.ts 100 95 100 100
/codebase/common/Environment.js 100 100 100 100
/codebase/common/EvictingCacheStorage.spec.ts 100 100 100 100
/codebase/common/EvictingCacheStorage.ts 100 100 100 100
/codebase/common/SdkOptions.js 100 100 100 100
/codebase/common/UrlProcessor.js 100 100 100 100
/codebase/common/constants.js 0 100 100 0
/codebase/common/i18nCookie.js 100 100 100 100
/codebase/common/utils.ts 81.63 42.85 80 77.5
/codebase/common/Slot/Slot.js 87.5 100 75 87.5
/codebase/common/Slot/SlotCollection.js 88.88 0 100 88.88
/codebase/common/Slot/SpaSlot.js 0 100 0 0
/codebase/common/Slot/SpaSlotCollection.js 0 0 0 0
/codebase/common/Slot/test/fixture.js 100 100 100 100
✨ 🆕 /codebase/common/router/Router.ts 98 90 100 98
✨ 🆕 /codebase/common/router/errors.ts 100 100 100 100
✨ 🆕 /codebase/common/transition-hooks/ActionType.ts 100 100 100 100
✨ 🆕 /codebase/common/transition-hooks/errors.ts 100 100 100 100
✨ 🆕 /codebase/server/TransitionHooksExecutor.ts 90.9 84.61 100 90.9
/codebase/server/app.js 96.92 90 100 96.77
/codebase/server/http.d.ts 0 0 0 0
/codebase/server/i18n.js 94.44 88.46 100 93.47
/codebase/server/index.js 0 100 100 0
/codebase/server/objectToBase64.js 100 100 100 100
/codebase/server/serveStatic.js 40 100 100 40
/codebase/server/server.js 0 0 0 0
/codebase/server/application/application.js 90 50 100 90
/codebase/server/context/context.js 100 100 100 100
/codebase/server/errorHandler/ErrorHandler.js 96.96 69.23 100 96.92
/codebase/server/errorHandler/factory.js 100 100 100 100
/codebase/server/logger/accessLogger.js 89.47 50 100 89.47
/codebase/server/logger/enhanceLogger.js 94.73 83.33 100 94.73
/codebase/server/plugins/PluginsLoader.js 76.92 50 50 76.92
/codebase/server/plugins/pluginManager.js 100 100 100 100
/codebase/server/plugins/reportingPlugin.js 100 75 100 100
/codebase/server/registry/Registry.js 96.94 85.93 100 96.77
/codebase/server/registry/TemplateParser.js 100 100 100 100
/codebase/server/registry/errors.ts 100 100 100 100
/codebase/server/registry/factory.ts 100 100 100 100
/codebase/server/registry/isTemplateValid.js 100 100 100 100
/codebase/server/routes/pingPluginFactory.ts 66.66 100 50 75
/codebase/server/routes/renderTemplateHandlerFactory.ts 26.66 0 33.33 28.57
/codebase/server/routes/wildcardRequestHandlerFactory.ts 94.54 68.75 100 94.54
/codebase/server/services/CanonicalTagService.js 100 50 100 100
/codebase/server/services/CspBuilderService.js 100 90 100 100
/codebase/server/services/HrefLangService.js 92.85 68.75 100 92.85
/codebase/server/tailor/configs-injector.js 99.09 86.76 100 99.06
/codebase/server/tailor/error-handler.js 86.95 80 100 86.95
/codebase/server/tailor/errors.js 100 100 100 100
/codebase/server/tailor/factory.js 94.11 0 66.66 94.11
/codebase/server/tailor/fetch-template.js 100 100 100 100
/codebase/server/tailor/filter-headers.js 100 83.33 100 100
/codebase/server/tailor/fragment-hooks.js 94.11 95 100 94.11
/codebase/server/tailor/merge-configs.js 100 100 100 100
/codebase/server/tailor/parse-override-config.js 100 100 100 100
/codebase/server/tailor/process-fragment-response.js 100 93.75 100 100
/codebase/server/tailor/request-fragment.js 91.86 76.19 90 91.86
🔴 /codebase/server/tailor/server-router.js 98.57 (-0.02) 96.15 (0) 100 (0) 98.55 (-0.02)
/codebase/server/utils/helpers.ts 100 100 100 100
/codebase/server/utils/utils.js 100 100 100 100
/codebase/tests/helpers.js 75 100 78.57 75
/codebase/common/guard/actionTypes.js 100 100 100 100
/codebase/common/guard/errors.js 100 100 100 100
/codebase/common/router/Router.js 98.3 91.66 100 98.27
/codebase/common/router/errors.js 100 100 100 100
/codebase/server/GuardManager.js 100 100 100 100

Ilc/client

Commit SHA:07e35fd202557d18a00d804e6932b181a8964101

Test coverage results 🧪

Code coverage diff between base branch:master and head branch: feature/redirect 
File details
Status File % Stmts % Branch % Funcs % Lines
🟢 total 92.78 (-0.04) 83.24 (0.06) 91.16 (0.03) 92.94 (-0.04)
/codebase/client/AsyncBootUp.js 100 75 100 100
/codebase/client/BundleLoader.js 92.45 97.06 80 92.31
/codebase/client/ClientRouter.js 95.24 90.53 95.65 95.03
/codebase/client/CssTrackedApp.ts 94.38 88.57 93.1 96.25
/codebase/client/ParcelApi.js 97.06 87.5 100 96.97
✨ 🆕 /codebase/client/TransitionHooksExecutor.js 96.15 77.78 100 96.15
/codebase/client/WrapApp.js 97.18 76.47 93.75 98.53
/codebase/client/composeAppSlotPairsToRegister.js 100 100 100 100
/codebase/client/dispatchSynchronizedEvent.js 96.97 100 100 96.55
/codebase/client/i18n.js 90.91 80 90.91 90.48
/codebase/client/utils.js 88 71.43 90 91.67
/codebase/client/ErrorHandlerManager/ErrorHandlerManager.js 100 90 100 100
/codebase/client/TransitionManager/TransitionBlocker.js 93.94 87.5 100 93.94
/codebase/client/TransitionManager/TransitionBlockerList.js 84.21 50 84.62 80
/codebase/client/TransitionManager/TransitionManager.js 87.94 75.93 85.71 87.86
/codebase/client/TransitionManager/GlobalSpinner/GlobalSpinner.js 100 100 100 100
/codebase/client/TransitionManager/ScrollController/ScrollController.js 95.83 100 100 95.83
/codebase/client/TransitionManager/SlotRenderObserver/SlotRenderObserver.js 85.19 79.17 100 84.62
/codebase/client/TransitionManager/errors/CriticalSlotTransitionError.js 100 100 100 100
/codebase/client/configuration/IlcConfigRoot.js 84.62 50 92.31 84.62
/codebase/client/configuration/SystemJSImportMap.js 86.67 75 100 86.67
/codebase/client/configuration/getIlcConfigRoot.js 100 100 100 100
/codebase/client/constants/ilcEvents.js 100 100 100 100
/codebase/client/errors/BaseError.js 100 80 100 100
/codebase/client/errors/CorsError.js 100 100 100 100
/codebase/client/errors/CriticalFragmentError.js 100 100 100 100
/codebase/client/errors/CriticalInternalError.js 100 100 100 100
/codebase/client/errors/CriticalRuntimeError.js 100 100 100 100
/codebase/client/errors/FetchTemplateError.js 100 100 100 100
/codebase/client/errors/FragmentError.js 100 100 100 100
/codebase/client/errors/InternalError.js 100 100 100 100
/codebase/client/errors/NavigationError.js 100 100 100 100
/codebase/client/errors/RuntimeError.js 100 100 100 100
/codebase/client/errors/UnhandledError.js 100 100 100 100
/codebase/client/navigationEvents/index.js 100 100 100 100
/codebase/client/navigationEvents/setupEvents.js 87.8 83.33 94.12 87.5
/codebase/client/registry/BrowserCacheStorage.ts 100 100 100 100
/codebase/common/DefaultCacheWrapper.ts 96.61 80.77 100 96.43
/codebase/common/Environment.js 100 100 100 100
/codebase/common/EvictingCacheStorage.ts 100 100 100 100
/codebase/common/SdkOptions.js 100 100 100 100
/codebase/common/UrlProcessor.js 100 100 100 100
/codebase/common/constants.js 100 100 100 100
/codebase/common/i18nCookie.js 100 100 100 100
/codebase/common/utils.ts 63.27 18.75 53.33 57.5
/codebase/common/Slot/Slot.js 83.33 100 75 83.33
/codebase/common/Slot/SlotCollection.js 87.5 50 100 87.5
/codebase/common/Slot/SpaSlot.js 92.31 100 83.33 92.31
/codebase/common/Slot/SpaSlotCollection.js 88.89 100 66.67 94.12
/codebase/common/Slot/test/fixture.js 100 100 100 100
✨ 🆕 /codebase/common/router/Router.ts 98 91.89 100 98
✨ 🆕 /codebase/common/router/errors.ts 100 100 100 100
✨ 🆕 /codebase/common/transition-hooks/ActionType.ts 100 100 100 100
✨ 🆕 /codebase/common/transition-hooks/errors.ts 100 100 100 100
/codebase/client/GuardManager.js 96.15 77.78 100 96.15
/codebase/common/guard/actionTypes.js 100 100 100 100
/codebase/common/guard/errors.js 100 100 100 100
/codebase/common/router/Router.js 98.28 93.55 100 98.28
/codebase/common/router/errors.js 100 100 100 100

Registry

@stas-nc stas-nc merged commit 47e0d28 into master Dec 24, 2024
16 checks passed
@stas-nc stas-nc deleted the feature/redirect branch December 24, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants