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

[Content]: Guide containing useSubmission & useSubmissions #1026

Open
LadyBluenotes opened this issue Jan 16, 2025 · 5 comments
Open

[Content]: Guide containing useSubmission & useSubmissions #1026

LadyBluenotes opened this issue Jan 16, 2025 · 5 comments
Assignees
Labels
help wanted Looking for assistance on this issue

Comments

@LadyBluenotes
Copy link
Member

📚 Subject area/topic

Learning Guide

📋 Page(s) affected (or suggested, for new content)

n/a

📋 Description of content that is out-of-date or incorrect

Show the different way that useSubmission and useSubmissions combined with action can be used within an application. This should aim to include the information that is getting removed with #1024 to avoid losing it.

It's imperative that within this guide we talk about the security implications of the submission method and possibly progressive enhancement.

Image

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

@LadyBluenotes LadyBluenotes added the help wanted Looking for assistance on this issue label Jan 16, 2025
@LadyBluenotes LadyBluenotes self-assigned this Jan 16, 2025
@amirhhashemi
Copy link
Contributor

amirhhashemi commented Jan 27, 2025

It's basically going to be the same thing as the Data Fetching and Data Mutation guides from SolidStart but for Solid Router, is that correct?

I can port some of the examples from #991 and #994 to Solid Router.

This doesn't fully address the Issue though. But it's a step forward.

@LadyBluenotes
Copy link
Member Author

Can you elaborate on how you believe it "doesn't address the issue", @amirhhashemi?

This guide doesn't need examples just ported over, it requires a more comprehensive dive into both of these in combination with actions.

@amirhhashemi
Copy link
Contributor

I thought by "guide" you meant a how-to guide.

I looked at how we can handle data loss with #1024 more intently. Honestly, I don't think #1024 removes much information. All the information is mentioned in other places:

  1. There is a brief note about progressive enhancement on the Actions page. Though, perhaps we could expand on it slightly more.
  2. There is a note about using enctype="multipart/form-data" for file uploads in the Actions page, if that's what you mean by "security implications."
  3. Although it's not related to how an action is invoked with useSubmission(s), there is a note about using method="post" when handling forms in the action API reference.

The only information being removed is the tip about using "use server" for its benefits. I think the Actions page is a better place for it.

With that being said, I don't see the need for a more comprehensive guide. I think there are some gaps in the docs that, if filled, could help clarify how useSubmission(s) can be used. Here are my suggestions:

  1. A how-to guide could cover many common use cases of useSubmission(s).
  2. It's worth explaining how action works under the hood. I haven't looked it up, but my understanding is that submissions are stored in a queue, and useSubmission(s) just provides access to the queue. A note about this should be added to both the action API reference and the Actions page (with varying degrees of detail).
  3. A note about progressive enhancement could be useful in the action API reference.
  4. The type signature of submissions should be explained in the action API reference—not only the TypeScript types, but what each property does.

@LadyBluenotes
Copy link
Member Author

There seems to be some confusion. This guide is strictly focused on how to approach useSubmission(s) and its various use cases, which involves the use of action. Anything mentioned beyond my initial suggestions falls outside the scope of this issue.

While I understand the interest and appreciate the forward-thinking in other aspects, introducing suggestions unrelated to the direct focus of this guide and issue (ie. action specific information) is not helpful within this issue. The specific needs for this guide were identified based on discussions with the internal team (needing more clarity on useSubmission(s), hence why this issue was created.

If you'd like to discuss other topics, such as what you're talking about with action, or bringing more clarity to other aspects of the docs, feel free to reach out to me directly or bring them up in the docs channel. However, the conversation about actions should not be continued here.

@amirhhashemi
Copy link
Contributor

amirhhashemi commented Jan 27, 2025

Okay, I'm probably missing something. I have a few questions:

This should aim to include the information that is getting removed with #1024 to avoid losing it.

  1. Exactly what information is being removed with [Content]: Clarify useSubmission(s) Documentation to Emphasize Actions Over Form Submissions #1024 that is not already in other sections and needs to be included in this guide?

It's imperative that within this guide we talk about the security implications of the submission method and possibly progressive enhancement.

  1. Can you elaborate on what you mean by "security implications"?
  2. How progressive enhancement is related to submissions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Looking for assistance on this issue
Projects
None yet
Development

No branches or pull requests

2 participants