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

support route parameters and inject them into the component #354

Merged
merged 21 commits into from
Feb 21, 2021

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Feb 21, 2021

Valuable discussion: #300
Resolves: #298

Ideally we'd put this onto context but given our system allowing for multiple matched routes it seems safer to inject these props into the page.

An alternative solution would be to wrap the rendered routes in a context (on the Router side) and have a new useRoute hook.

@changeset-bot
Copy link

changeset-bot bot commented Feb 21, 2021

🦋 Changeset detected

Latest commit: ff6c16c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-iso Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2021

Size Change: +322 B (0%)

Total Size: 688 kB

Filename Size Change
packages/wmr/demo/dist/about/index.html 637 B +2 B (0%)
packages/wmr/demo/dist/chunks/index.********.js 302 B +108 B (+56%) 🆘
packages/wmr/demo/dist/chunks/prerender.********.js 2.45 kB -1 B (0%)
packages/wmr/demo/dist/class-fields/index.html 613 B +2 B (0%)
packages/wmr/demo/dist/env/index.html 692 B +2 B (0%)
packages/wmr/demo/dist/error/index.html 623 B +1 B (0%)
packages/wmr/demo/dist/files/index.html 656 B +2 B (0%)
packages/wmr/demo/dist/index.********.js 6.96 kB +205 B (+3%)
packages/wmr/demo/dist/index.html 682 B +1 B (0%)
ℹ️ View Unchanged
Filename Size Change
packages/wmr/demo/dist/assets/Calendar.********.css 702 B 0 B
packages/wmr/demo/dist/assets/style.********.css 386 B 0 B
packages/wmr/demo/dist/chunks/class-fields.********.js 200 B 0 B
packages/wmr/demo/dist/chunks/compat.********.js 15.3 kB 0 B
packages/wmr/demo/dist/compat/index.html 1.4 kB 0 B
packages/wmr/wmr.cjs 656 kB 0 B

compressed-size-action

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Left a few comments, let me.know what you think 👍

packages/sw-plugin/example/public/index.js Outdated Show resolved Hide resolved
packages/wmr/demo/public/lib/loc.js Outdated Show resolved Hide resolved
packages/wmr/demo/public/lib/loc.js Outdated Show resolved Hide resolved
packages/preact-iso/router.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Co-authored-by: Marvin Hagemeister <hello@marvinh.dev>
Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

This is great! 🙌

@JoviDeCroock JoviDeCroock merged commit fab59f8 into main Feb 21, 2021
@JoviDeCroock JoviDeCroock deleted the router-params branch February 21, 2021 21:32
@github-actions github-actions bot mentioned this pull request Feb 21, 2021
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.

Using parameters with preact-iso/router
3 participants