docs(solidstart): add cron jobs guide using Nitro Tasks API#1534
docs(solidstart): add cron jobs guide using Nitro Tasks API#1534harshagarwalnyu wants to merge 7 commits into
Conversation
Documents how to set up scheduled background tasks in SolidStart using Nitro's Tasks API. Covers configuration in app.config.ts, task file structure in tasks/ directory, and manual triggering via the Nitro task endpoint. Closes solidjs#964
|
|
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new SolidStart guide explaining how to schedule and run cron-like background jobs using Nitro’s Tasks API.
Changes:
- Introduces documentation for enabling Nitro tasks in
app.config.tsand mapping cron expressions viascheduledTasks. - Documents creating a task in the root
tasks/directory with a minimaldefineTaskexample. - Describes triggering tasks manually via the Nitro tasks endpoint for development/testing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add caution block warning that /_nitro/tasks/* is publicly accessible in production (node-server, bun, deno-server) and should be protected - Add curl example with explicit GET method for task triggering
amirhhashemi
left a comment
There was a problem hiding this comment.
I appreciate you taking the time to do this. You did a good job.
Rework the SolidStart tasks guide per maintainer review: - rename guide to Background tasks (Nitro calls them tasks, not all are cron) - expand intro and link Nitro platform-support docs instead of hardcoding presets - mark tasks as experimental and split scheduling into its own section - use a practical cleanup-sessions example with package-install-dev - remove the production caution: /_nitro/tasks is a dev-server-only endpoint (registered solely in the _nitro-dev preset via dev-tasks.ts), not exposed by node-server/bun/deno-server presets
|
Thanks for the detailed review, this shapes the guide up a lot. Pushed 574e3d0 with all of it applied: renamed to |
Adds a new cron jobs guide to the SolidStart guides section, addressing #964.
The guide covers:
app.config.tstasks/directory (notsrc/tasks/)defineTaskAPI fromnitropack/runtime/_nitro/tasks/<name>for testingContent is based on the working example shared in the issue. The guide also clarifies the
nitropackdev dependency situation since it's a transitive dep that TypeScript sometimes can't resolve without an explicit install.Closes #964