trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

[TRI-1250] Framework: support for Nuxt

Open samejr opened this issue 2 years ago • 24 comments
trafficstars

Build support for Nuxt into Trigger.dev

Please make sure to use Typescript for all code

Task 1 - Nuxt Adaptor

  • [ ] Create a new folder in packages called nuxt
  • [ ] Create the adaptor for Nuxt. Use this Next.js adaptor code as reference when creating yours. Include all setup configurations to fully support the framework, e.g. Next.js requires adaptor support for both App and Pages routers.
  • [ ] Create a basic Nuxt project that uses the adaptor in examples/nuxt folder. Include a basic Job in Trigger.dev, e.g. a simple Job that just does a delay inside it. Screen grab the full Run dashboard page showing it successfully worked. Here are examples of how to do cross-project references in package.json and tsconfig.json.
  • [ ] Provide a screen grab of your terminal showing the Adaptor is working

Task 2 – Add a README.md file

  • [ ] Create a new README.md file inside the packages/nuxt folder and copy in the contents from packages/nextjs/README.md. Adjust the wording to reference Nuxt where needed, including updating the the URLs.

Task 3 – Write the documentation

  • [ ] Locate the manual-setup-nuxt.mdx folder in /docs/_snippets/. Use this file to write your documentation, overwriting any contents of that file. Follow the structure of this Next.js example for reference when writing yours.
  • [ ] Update the table at the bottom of the client-adaptors.mdx page with the framework you’ve worked on.

Task 4 – Update the webapp onboarding

  • [ ] In the route.tsx page located in _app.orgs.$organizationSlug.projects.$projectParam.setup.nuxt replace the <FrameworkComingSoon/> component with your new onboarding steps. Follow the same structure as the Next.js example when creating your own. Ignore the very top step for adding this framework to a new project, just focus on the steps to add it to an existing project (so don’t include the <RadioGroup/> toggle selector at the top). Make sure you also include the useProjectSetupComplete(); hook at the top of the page – this triggers a particle effect when the new job is successfully created and redirects to the Jobs list 🥳 .
  • [ ] In the FrameworkSelector.tsx file, add “supported” to the framework you’ve worked on.

From SyncLinear.com | TRI-1250

samejr avatar Sep 08 '23 15:09 samejr

/bounty $200

samejr avatar Sep 08 '23 16:09 samejr

~~## 💎 $200 bounty • Trigger.dev (YC W23)~~

~~### Steps to solve:~~ ~~1. Start working: Comment /attempt #447 with your implementation plan~~ ~~2. Submit work: Create a pull request including /claim #447 in the PR body to claim the bounty~~ ~~3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts~~

~~Thank you for contributing to triggerdotdev/trigger.dev!~~

~~Add a bountyShare on socials~~

algora-pbc[bot] avatar Sep 08 '23 16:09 algora-pbc[bot]

/attempt #447

Options

neo773 avatar Sep 08 '23 16:09 neo773

@samejr Can I assigned to this as I was the first one to claim the issue?

neo773 avatar Sep 08 '23 16:09 neo773

@neo773 i've just assigned you to this issue for this attempt.

samejr avatar Sep 08 '23 16:09 samejr

💡 @neo773 submitted a pull request that claims the bounty. You can visit your org dashboard to reward.

algora-pbc[bot] avatar Sep 09 '23 16:09 algora-pbc[bot]

Is this issue is still open ? Can I look into this issue?

playgude2 avatar Oct 15 '23 14:10 playgude2

🎉🎈 @neo773 has been awarded $200! 🎈🎊

algora-pbc[bot] avatar Oct 19 '23 13:10 algora-pbc[bot]

@samejr

I think this issue is resolved?

rishi-raj-jain avatar Nov 16 '23 12:11 rishi-raj-jain

This issue hasn't been merged yet, but I've awarded the bounty as the PR is good. We're still working out how best to proceed with some of these frameworks.

samejr avatar Nov 18 '23 13:11 samejr

Any news on this? #460 looks good, why not merge the framework/nuxt branch and put Beta label on it or something to get more people testing it out? I'd be happy to test if needed.

IvanBernatovic avatar Nov 26 '23 21:11 IvanBernatovic

I'd like to try this out in a nuxt project. Is there anything left pending for this?

genu avatar Nov 28 '23 00:11 genu

Sorry for the pressure, but when will this eventually make it to the master?

nikuscs avatar Dec 11 '23 11:12 nikuscs

There is a branch with the Nuxt package from that PR but we haven't had time to test and add CLI automatic installation support.

For now, you can use this file as reference: https://github.com/triggerdotdev/trigger.dev/blob/frameworks/nuxt/packages/nuxtjs/src/index.ts

That is the only code required to create an api/trigger POST route in your app. This is all that the framework packages do. You will have to follow some other steps like setting up environment variables, you can use the Express manual setup guide for now: https://trigger.dev/docs/documentation/guides/manual/express

samejr avatar Dec 18 '23 13:12 samejr

@samejr I tested those PR diffs in my Nuxt project and managed to get it working. To everyone who's gonna test Nuxt integration like this: The biggest bump was verifying the Dev environment key. To validate it I had to run npx @trigger.dev/cli@latest init which also wrongfully recognized Nuxt project as Remix project and added unnecessary npm dependency. But it's easy to clean it up and kind of expected since published npm package doesn't have Nuxt support yet.

@samejr The reason this took a long time is I assumed npx @trigger.dev/cli@latest init only adds required dependencies and fields to package.json so I ignored it. During that time I couldn't get setup working due to unverified API key, as mentioned before.

IvanBernatovic avatar Dec 19 '23 16:12 IvanBernatovic

Hi @IvanBernatovic, any update on shipping Nuxt compatability?

platform-kit avatar Jan 31 '24 23:01 platform-kit

Hi there! Would love to see this supported by default, since I successfully used trigger.dev in a Next.js project, I want to also migrate to it in other Nuxt projects. Is there anything we can do to get this merged?

Managed to get it to run somehow. But it's only registering jobs when directly defined inside the same file where the server gets created (/server/api/trigger.ts). But not they are in a /jobs folder and imported with import '@/jobs'. Did somebody experience the same?

madebyfabian avatar Feb 07 '24 08:02 madebyfabian

Hi, any news on this @samejr ? 👀

robinsimonklein avatar Feb 12 '24 20:02 robinsimonklein

Hey, we won’t be providing an official Nuxt package for v2. But if someone has created a good working example we’re more than happy to share it widely.

Instead, v3 will be shipping next month and will not require any framework specific code: https://trigger.dev/blog/v3-announcement

samejr avatar Feb 14 '24 09:02 samejr

that sounds great, but how long till v3 is out of beta ? would love to use trigger.dev, now kinda stuck as i cant use neither of them on my nuxt project without an easy plug in

Flowko avatar Mar 20 '24 22:03 Flowko

Hey @Flowko - we're about 1 week away from releasing the developer preview. We'll be dropping an announcement as soon as it's ready on Twitter(X) and in our Discord if you want to get notified.

samejr avatar Mar 21 '24 09:03 samejr

Hi. Nitro/Nuxt maintainer here! Please let me know if need any helps, particularly I'm interested to see how we can integrate triggerdev with nitro tasks API and good luck with v3 release 👍🏼

pi0 avatar Mar 21 '24 10:03 pi0

Hey @pi0 thanks for offering to help 👍. We're slowly letting people into v3 now which is framework agnostic so it should just work with Nuxt. We do have users with Nuxt apps so I might reach out for help if we have any issues testing as none of us have used Nuxt. 😀 Very happy to discuss nitro tasks too – maybe on our Discord is best for that discussion.

samejr avatar Mar 27 '24 09:03 samejr

If you get Pooya on board for this, it will only get better.

DavidDeSloovere avatar Jun 05 '24 21:06 DavidDeSloovere

I'm closing this issue because in v3 the product is framework independent and works with Nuxt. https://trigger.dev/docs/quick-start

matt-aitken avatar Sep 05 '24 09:09 matt-aitken