Proposal for a New API @lit-labs/router package #34
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.
Hi, guys! 👋
First of all, I want to congratulate you on the tremendous work you're doing. I love the idea of being able to collaborate with you and learn from your experience. 🚀
For a little over 1 year and a half, I've been working quite a bit with Lit, whether on personal projects or at my job. It strikes me as an exquisite library for creating Web Components. It's easy to use, has good documentation, and the community is very active. However, I've encountered certain limitations when it comes to using routers, something quite common in web applications. In other frameworks like React, Angular, or Vue, this is very easy to implement.
While it's true that Lit already has a package called
@lit-labs/router
that allows creating routes, this package provides very basic functionality. Additionally, it has an API that isn't very intuitive, especially when nesting routes.Therefore, I've decided to create a router that integrates with Lit and provides a significant portion of the functionalities expected from a modern router, such as:
With that said, I would be delighted to contribute to the Lit team with this project and have this router become part of the official library. 🤝
Basic Usage
HTML Template
Javascript/Typescript