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

[TRI-1253] Framework: support for Fastify

Open samejr opened this issue 1 year ago • 15 comments

Build support for Fastify into Trigger.dev

Please make sure to use Typescript for all code

Task 1 - Fastify Adaptor

  • [ ] Create a new folder in packages called fastify
  • [ ] Create the adaptor for Fastify. 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 Fastify project that uses the adaptor in examples/fastify 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/fastify folder and copy in the contents from packages/nextjs/README.md. Adjust the wording to reference Fastify where needed, including updating the the URLs.

Task 3 – Write the documentation

  • [ ] Locate the manual-setup-fastify.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.fastify 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. CleanShot 2023-09-07 at 16 42 14

TRI-1253

samejr avatar Sep 08 '23 15:09 samejr

/bounty $200

samejr avatar Sep 08 '23 16:09 samejr

💎 $200 bounty created by samejr 🙋 If you'd like to work on this issue, comment below to get assigned 👉 To claim this bounty, submit a pull request that includes the text /claim #450 somewhere in its body 📝 Before proceeding, please make sure you can receive payouts in your country 💵 Payment arrives in your account 2-5 days after the bounty is rewarded 💯 You keep 100% of the bounty award 🙏 Thank you for contributing to triggerdotdev/trigger.dev!

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

/attempt #450

Options

mnmt7 avatar Sep 08 '23 16:09 mnmt7

@samejr Can you please assign this issue to me?

mnmt7 avatar Sep 08 '23 16:09 mnmt7

@mnmt7 this attempt is all yours – let me know if you run into anything.

samejr avatar Sep 08 '23 17:09 samejr

/attempt #450

I'll not work on it cause @mnmt7 is already working on it, but I'm adding myself to the queue, just in case.

ologbonowiwi avatar Sep 15 '23 13:09 ologbonowiwi

@ologbonowiwi: the triggerdotdev team prefers to assign a single contributor to the issue rather than let anyone attempt it right away. We recommend waiting for a confirmation from a member before getting started.

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

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

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

As there was no activity on the issue past week, So worked on it in background. Feel free to reject my PR as I am not the first one to claim the bounty.

But this PR uses Fastiy Plugin that allows user to extend their functionalities and is a powerful tool to build a modular application rather than the addHook approach

akhill10 avatar Sep 15 '23 16:09 akhill10

Thanks @akhill10 we'll still check it out 👍

samejr avatar Sep 16 '23 09:09 samejr

🎉🎈 @mnmt7 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 update on this issue ?

qlaffont avatar Feb 22 '24 15:02 qlaffont

We won’t be providing an official Fastify 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 22 '24 15:02 samejr