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

Implement 'add' functionality for template #56

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

ogghead
Copy link
Contributor

@ogghead ogghead commented Dec 7, 2024

What Is This?

Testing

  • Created a new Leptos Spin app and verified spins up
  • Add a Leptos component to an existing Spin app and verified spins up

@ogghead
Copy link
Contributor Author

ogghead commented Dec 7, 2024

@itowlson I don't have the ability to add you as a reviewer but appreciate eyes whenever you get a chance 😄

Copy link
Collaborator

@itowlson itowlson left a comment

Choose a reason for hiding this comment

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

Couple of comments, probably not blocking but wanting to understand / agree in my own mind.

templates/leptos-ssr/metadata/spin-template.toml Outdated Show resolved Hide resolved
templates/leptos-ssr/metadata/snippets/component.txt Outdated Show resolved Hide resolved
templates/leptos-ssr/metadata/snippets/component.txt Outdated Show resolved Hide resolved
Signed-off-by: Darwin Boersma <darwin@sadlark.com>
@ogghead
Copy link
Contributor Author

ogghead commented Dec 11, 2024

@itowlson thanks for the review! I responded to comments and updated the PR to address, let me know if the approach makes sense 🤞😄

Copy link
Collaborator

@itowlson itowlson left a comment

Choose a reason for hiding this comment

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

This all looks reasonable to me - thanks!

I guess I do have one more foundational question which is whether non-root paths are something that Leptos users care about. My admittedly limited impression from the existing integrations was that Leptos would typically handle the whole site, rather than a subpath of it. Even if you had something like an API handled by a non-Leptos framework, you'd still likely have Leptos handling the root because that's where browsers come in.

So I am a bit curious about the motivation. Is this something you or other users have run into, or is it more a sense of "rounding out" the Spin template?

(And I apologise for not asking this earlier before putting you through all this work!)

@ogghead
Copy link
Contributor Author

ogghead commented Dec 11, 2024

This all looks reasonable to me - thanks!

I guess I do have one more foundational question which is whether non-root paths are something that Leptos users care about. My admittedly limited impression from the existing integrations was that Leptos would typically handle the whole site, rather than a subpath of it. Even if you had something like an API handled by a non-Leptos framework, you'd still likely have Leptos handling the root because that's where browsers come in.

So I am a bit curious about the motivation. Is this something you or other users have run into, or is it more a sense of "rounding out" the Spin template?

(And I apologise for not asking this earlier before putting you through all this work!)

I agree with the idea that Leptos should generally be handling the whole site and there isn't much use for hosting it on subpaths, but one case where this is helpful is in federating micro-frontends in large organizations. cough cough Am cough cough azon

You're correct that another goal was "rounding out" the template -- I want the add command to work as flexibly as possible gosh darn it! This setup is not super elegant -- ideally we could strip out the prefix in top level server handlers with dynamic Spin-provided information about the path and have each Leptos component be deployable on any subpath without code changes.

But that will take some changes in leptos_wasi (and potentially leptos itself) I suspect, still mulling over the specifics of how that might be best accomplished. Open to thoughts and ideas!

@itowlson
Copy link
Collaborator

That totally makes sense. Thanks for taking the time to write it up. Happy to :shipit:

@itowlson itowlson merged commit ce648b5 into fermyon:main Dec 11, 2024
2 checks passed
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.

2 participants