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

Remove instructions about actions in useSubmission(s) reference #1023

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

amirhhashemi
Copy link
Contributor

@amirhhashemi amirhhashemi commented Jan 15, 2025

  • I have read the Contribution guide
  • This PR references an issue (except for typos, broken links, or other minor problems)

Description(required)

This PR removes the "Creating the action" section from useSubmission(s) reference page and replaces them with a callout to the action reference.

Related issues & labels

Copy link

stackblitz bot commented Jan 15, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Jan 15, 2025

Deploy Preview for solid-docs failed. Why did it fail? →

Name Link
🔨 Latest commit fff40b3
🔍 Latest deploy log https://app.netlify.com/sites/solid-docs/deploys/678b20739d0d520008929bfa

@amirhhashemi amirhhashemi force-pushed the update-use-submissions branch from aed6ad9 to b21eae5 Compare January 15, 2025 16:04
@amirhhashemi amirhhashemi force-pushed the update-use-submissions branch from b21eae5 to c8e6330 Compare January 15, 2025 16:57
Copy link
Member

@LadyBluenotes LadyBluenotes left a comment

Choose a reason for hiding this comment

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

Let me know your thoughts on these changes!


The Action which will trigger the submission should be created with the [`action()`](/solid-router/reference/data-apis/action) helper and, when in a [SolidStart](/solid-start) app, it is recommended to leverage the `"use server"` directive to leverage the caching and RPC capabilities from the server-side.
Learn more about actions in the [`action`](/solid-router/reference/data-apis/action) docs.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Learn more about actions in the [`action`](/solid-router/reference/data-apis/action) docs.
To trigger a submission, [actions](https://docs.solidjs.com/) can be used.
As a note, if building a SolidStart app, it's recommended to utilize the `"use server"` directive to take advantage of server-side caching and RPC capabilities.

Copy link
Contributor Author

@amirhhashemi amirhhashemi Jan 15, 2025

Choose a reason for hiding this comment

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

To trigger a submission, actions can be used.

I think this is a little misleading. action() doesn't trigger a submission on itself.

Submitting a <form> or using useAction triggers a submission.

As a note, if building a SolidStart app, it's recommended to utilize the "use server" directive to take advantage of server-side caching and RPC capabilities.

This is more closely related to actions rather than useSubmission. It might be more suitable for the actions concept page or the action reference page.

Copy link
Contributor Author

@amirhhashemi amirhhashemi Jan 15, 2025

Choose a reason for hiding this comment

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

Also, I'm not sure whether this kind of information is a good fit for a reference page according to diataxis:

It can be tempting to introduce instruction and explanation, simply because description can seem too inadequate to be useful, and because we do indeed need these other things. Instead, link to how-to guides, explanation and introductory tutorials.

Copy link
Member

Choose a reason for hiding this comment

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

Well this information needs to be put somewhere. I want to avoid just removing stuff bc it doesn't fit in a page, but making sure that the content is put in a more appropriate place.

Do you mind showing what alternatives you feel fit better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created an issue that explains part of the problem: #1024

Regarding this line:

As a note, if building a SolidStart app, it's recommended to utilize the "use server" directive to take advantage of server-side caching and RPC capabilities.

I believe a tip callout in the Actions concept page would be the best place for this information.

image


The Action which will trigger the submission should be created with the [`action()`](/solid-router/reference/data-apis/action) helper and, when in a [SolidStart](/solid-start) app. If in a [SolidStart](/solid-start) app to leverage the caching and RPC capabilities from the server-side.
Learn more about actions in the [`action`](/solid-router/reference/data-apis/action) docs.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Learn more about actions in the [`action`](/solid-router/reference/data-apis/action) docs.
To trigger a submission, [actions](https://docs.solidjs.com/) can be used.
As a note, if building a SolidStart app, it's recommended to utilize the `"use server"` directive to take advantage of server-side caching and RPC capabilities.

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.

[Content]: Remove "Creating the action" section in useSubmission(s) reference
2 participants