Skip to content

Conversation

@ClarkXia
Copy link
Collaborator

This pull request introduces a new example demonstrating how to configure a custom fallbackElement for routing in an ice.js application, and adds support for specifying a fallbackElement in the router configuration. The changes include updates to the runtime to accept and use a custom fallback element, as well as the addition of a fully configured example app showcasing this feature.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for configuring a custom fallbackElement in ice.js router configuration. It allows developers to specify a React component that will be displayed while the router is loading new routes, providing a better user experience during navigation transitions.

  • Extends the router configuration interface to accept a fallbackElement property
  • Updates the runtime to use the configured fallback element in RouterProvider
  • Adds a complete example demonstrating the feature with custom loading UI

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/runtime/src/types.ts Adds fallbackElement property to router configuration interface
packages/runtime/src/appConfig.ts Sets default fallbackElement value to null
packages/runtime/src/ClientRouter.tsx Implements fallbackElement support in RouterProvider
examples/with-fallback-element/src/app.tsx Demonstrates custom fallback element configuration
examples/with-fallback-element/src/pages/layout.tsx Shows navigation state-based loading indicator
examples/with-fallback-element/src/pages/index.tsx Basic test page with navigation link
examples/with-fallback-element/src/pages/home.tsx Simple home page component
examples/with-fallback-element/package.json Example project dependencies and scripts
examples/with-fallback-element/ice.config.mts Example project configuration
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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