Upgrade 0.61 to 0.62
- Change
startupjsand all@startupjs/*dependencies in yourpackage.jsonto^0.62 - Run
yarnafter the version bump
Upgrade CSSX to v0.3 (Breaking)
CSSX was upgraded to new version 0.3. This changes how eslint is setup and what new features are available when writing pug and styles in pug.
Follow migration guide here to upgrade your eslint config and to understand the new features: https://cssx.dev/migration-guides/0.3
Worker Rewrite (Breaking)
@startupjs/worker was redesigned.
This migration guide focuses on moving from the old worker API to the new one.
Quick Migration Checklist
- Move your jobs to
workerJobs/*.js(if they are not there already). - Keep job handler in
export default. - Replace singleton calls at enqueue-time (for example old
addSingletonJob(...)) withexport const singleton = ...in the job module. - Replace cron payload
jobDatawithdata. - Move worker runtime options to
startupjs.config.jsplugin config (plugins.worker.server). - If you run a dedicated worker microservice in production:
- set
autoStartProduction: falsein app server config - use
npx startupjs start-worker-productionfor the worker service command
- set
New Job Contract
Each file in workerJobs now uses:
Singleton Migration
Old
Singleton behavior was configured when adding the job (for example addSingletonJob(...)).
New
Singleton behavior is declared in the job itself:
or keyed:
Result: callers now use regular runJob(...), and deduplication is centralized in job definition.
Cron Migration
Old
Cron payload could be defined with jobData.
New
Use only data:
cron.jobData is deprecated and now rejected.
Running Jobs
Use:
Behavior:
runJob()always waits for completion- returns your handler result directly
- throws if the job fails
data can be any JSON-serializable value (not only objects).
Configuration Migration
Old
Worker runtime behavior was commonly controlled via env/getParam-style configuration.
New
Configure worker in StartupJS plugin options:
Deployment Migration (Important)
App server + embedded worker (default)
No extra setup required. Worker auto-starts by default.
Dedicated worker microservice (recommended for production)
In app server config:
In worker service command:
If you previously used start-worker in production, switch to start-worker-production.
Optional package.json script (if your deploy uses yarn <script>):
Queue Topology Changes
- Supported worker names are fixed:
defaultandpriority. - By default, worker startup runs both queues.
- By default, jobs go to
default. - To route a specific job to
priority, declare:
-
prioritymeans this job can be processed by a dedicated priority capacity, separate from regular background load. -
This is useful for latency-sensitive jobs (for example OTP, urgent notifications, critical sync).
-
To control which workers are started in a worker process, use:
Recommended production topology:
- Use one dedicated worker microservice running both queues.
- You do not need to set
WORKERSfor this default case.
Optional extra reliability topology:
- Add a second worker microservice running only priority (
WORKERS=priority).
This gives stronger guarantees that priority jobs are processed ASAP even when default queue load is high.