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 deferred routes registration #100

Merged
merged 22 commits into from
Oct 27, 2023

Conversation

patricklafrance
Copy link
Member

@patricklafrance patricklafrance commented Oct 26, 2023

This PR introduces new APIs to support deferred routes registration with the ultimate goal of conditionally adding routes based on feature flags.

What changed

@squide/core

  • Updated the ModuleRegisterFunction type to accept a function as the return value.
  • Added a completeLocalModuleRegistrations function to complete the second phase of the registration process for local modules.

@squide/webpack-module-federation

  • Added a completeRemoteModuleRegistrations function to complete the second phase of the registration process for local remote modules.
  • Added a completeModuleRegistrations function to execute completeLocalModuleRegistrations and completeRemoteModuleRegistrations in a single call.
  • Added the useAreModulesRegistered hook to re-render the application once all the modules are registered (but not ready).
  • Reworked the useAreModulesReady hook to be complimentary to the useAreModulesRegistered hook when deferred registrations are registered. The hook is backward compatible and includes no breaking changes.
  • Added a features section to the defineConfig functions options.

What's next

  • Adding a generic AppRouter component
  • Writing many guides explaining all the APIs that has been added lately

@patricklafrance patricklafrance changed the title Fix/prevent double login feat: Add support for deferred routes registration Oct 26, 2023
@patricklafrance patricklafrance merged commit f41f6bb into main Oct 27, 2023
1 check passed
@patricklafrance patricklafrance deleted the fix/prevent-double-login branch October 27, 2023 17:26
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