Skip to content

docs(solidstart): add cron jobs guide using Nitro Tasks API#1534

Open
harshagarwalnyu wants to merge 7 commits into
solidjs:mainfrom
harshagarwalnyu:docs/solidstart-cron-jobs-guide
Open

docs(solidstart): add cron jobs guide using Nitro Tasks API#1534
harshagarwalnyu wants to merge 7 commits into
solidjs:mainfrom
harshagarwalnyu:docs/solidstart-cron-jobs-guide

Conversation

@harshagarwalnyu

Copy link
Copy Markdown
Contributor

Adds a new cron jobs guide to the SolidStart guides section, addressing #964.

The guide covers:

  • Enabling the experimental tasks feature in app.config.ts
  • Setting up cron expressions for scheduled runs
  • Creating a task file in the tasks/ directory (not src/tasks/)
  • The defineTask API from nitropack/runtime
  • Manually triggering tasks via /_nitro/tasks/<name> for testing
  • A note about the supported Nitro presets (dev, node-server, bun, deno-server)

Content is based on the working example shared in the issue. The guide also clarifies the nitropack dev dependency situation since it's a transitive dep that TypeScript sometimes can't resolve without an explicit install.

Closes #964

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
Copilot AI review requested due to automatic review settings June 1, 2026 12:42
@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@netlify

netlify Bot commented Jun 1, 2026

Copy link
Copy Markdown

Deploy Preview for solid-docs ready!

Name Link
🔨 Latest commit 5d5142c
🔍 Latest deploy log https://app.netlify.com/projects/solid-docs/deploys/6a22519bc2fe5e00080b10b5
😎 Deploy Preview https://deploy-preview-1534--solid-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.ts and mapping cron expressions via scheduledTasks.
  • Documents creating a task in the root tasks/ directory with a minimal defineTask example.
  • 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.

Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
- 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 amirhhashemi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I appreciate you taking the time to do this. You did a good job.

Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
Comment thread src/routes/solid-start/(2)guides/(4)cron-jobs.mdx Outdated
kodiakhq Bot and others added 3 commits June 4, 2026 07:35
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
@harshagarwalnyu

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review, this shapes the guide up a lot. Pushed 574e3d0 with all of it applied: renamed to (4)background-tasks.mdx with the Background tasks title, expanded the intro and linked the Nitro platform-support docs, marked tasks as experimental, split scheduling into its own section, swapped in the cleanup-sessions example with package-install-dev, and pointed the on-demand curl at the same task. Replied inline on the caution block since that one needed a bit more than "done".

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.

Documentation Guide on CronJobs (Nitro Tasks)

3 participants