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
[labs/router] New Router API! 🌟 #4593
base: main
Are you sure you want to change the base?
Conversation
|
📊 Tachometer Benchmark ResultsSummaryA summary of the benchmark results will show here once they finish. ResultsThe full results of your benchmarks will show here once they finish. |
While I appreciate the enthusiasm and contribute here, we ask in the contributing guide that PRs have have an associated issue or RFC so that we can have a discussion about the shape of the solution before diving into the code/review process. This is a large PR with changes that might not fit the goals of the labs router. It would be good to come to agreement here before making such a large PR. |
I appreciate your feedback, my intention in submitting this PR was to address some of the points raised in the Proposal for a New API @lit-labs/router package. However, not receiving comments on the initial proposal, I decided to proceed with the implementation in a PR. I understand the importance of having discussions about the shape of the solution before diving into the code review process. I am fully open to collaborate and discuss the goals of the Router Labs and how my changes can better align with those objectives. Thank you again for your guidance, and I would be grateful to receive feedback on the Proposal for a New API @lit-labs/router package |
Context
The
@lit-labs/router
package provides routing functionalities for Single Page Applications (SPAs), but currently, there are areas that could be enhanced:ReactiveController
. This can make it challenging to identify routes, especially when nesting them, as accessing each component is necessary.enter
callback is used to perform multiple tasks, such as loading components lazily, functioning as navigation guards, among others.To address these improvement points, I've created this pull request proposing a more intuitive API and a more satisfying development experience. The proposed enhancements are based on concepts drawn from other popular routing APIs.
Solution
This pull request introduces significant enhancements to the
@lit-labs/router
library, aiming to revolutionize the way routes are managed inLit
applications. With Lit Router API, developers will have a more intuitive API for defining routes, adding pages through lazy loading, and a set of utilities to enhance the navigation experience.Basic Usage