Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support for various runtimes beyond Bun, including Cloudflare Workers #6

Closed
dave-calleja opened this issue Aug 1, 2024 · 21 comments · Fixed by #10
Closed
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🕹 aspect: interface Concerns end-users' experience with the software ⭐ goal: addition Addition of new feature good first issue New-contributor friendly 🟧 priority: high Stalls work on the project or its dependents released 🏁 status: ready for de Ready for work

Comments

@dave-calleja
Copy link

The requirement for using Bun is a limitation as it can't be run on cloudflare workers or the like. Are there any plans to support any other runtimes? I am really eager to use this in my project however introducing Bun will add needless complexity to our architecture.

Thanks

@schettn
Copy link
Contributor

schettn commented Aug 2, 2024

Hello.

This is a really good concern. I agree that support for various runtimes is crucial.

I will start working on supporting this Runtimes. I will make this a high priority. Please be please be patient.

In the meantime you could use bun to get started with developing, and switch to your required runtime later.

@dave-calleja
Copy link
Author

Sounds great thanks :)

@schettn
Copy link
Contributor

schettn commented Sep 4, 2024

Hi @dave-calleja, @yicru and @briandiephuis!

Pylon 2.0 will be released in the the following days.

I have updated some core components of Pylon to support the Hono Runtimes.

In the beginning Bun and NodeJS will be officially supported. In theory it should also work with all the other runtimes, but there could be complications due to some still unknown side effects (for example the limited feature set of Cloudflare workers).

Right after I will start working on the Cloudflare workers support.

Once it's released I will provide a migration guide for you!

Quick preview:

  1. Bun:
import {app} from '@getcronit/pylon'

export const graphql = {
  Query: {
    hello: () => {
      return 'Hello, world!'
    }
  },
  Mutation: {}
}

export default app
  1. Node
import {app} from '@getcronit/pylon'
import {serve} from '@hono/node-server'

export const graphql = {
  Query: {
    hello: () => {
      return 'Hello, world!'
    }
  },
  Mutation: {}
}

serve(app, info => {
  console.log(`Server running at ${info.port}`)
})

@yicru
Copy link

yicru commented Sep 4, 2024

@schettn
Great work!
I'm really looking forward to the Cloudflare workers support.

@schettn
Copy link
Contributor

schettn commented Sep 5, 2024

@yicru Works! Guess there will be three official supported runtimes. Bun, Node, and Cloudflare Worker

image

@yicru
Copy link

yicru commented Sep 5, 2024

@schettn
Great! Super excited for the release!

@dave-calleja
Copy link
Author

Thanks for the awesome work @schettn

@schettn
Copy link
Contributor

schettn commented Sep 6, 2024

Hi @dave-calleja @yicru.

Would you be so kind to test the beta?

Quick setup with Cloudflare Workers:

screen-recording-2024-09-06-at-133920_l7VfjFiZ.mp4

Note: The beta docs in WIP, some videos are still missing.

@dave-calleja
Copy link
Author

Looks great so far @schettn ! Will get digging deeper some time next week but once again thanks for the great work!

@schettn
Copy link
Contributor

schettn commented Sep 9, 2024

@schettn schettn added 🟧 priority: high Stalls work on the project or its dependents 🏁 status: ready for de Ready for work ⭐ goal: addition Addition of new feature 💻 aspect: code Concerns the software code in the repository 🕹 aspect: interface Concerns end-users' experience with the software good first issue New-contributor friendly and removed good first issue labels Sep 9, 2024
@schettn schettn self-assigned this Sep 9, 2024
@schettn schettn changed the title Non-bun options Provide support for various runtimes beyond Bun, including Cloudflare Workers Sep 9, 2024
@dave-calleja
Copy link
Author

@schettn works like a charm! This is truly a game changer when it comes to working with graphql. Are there any known performance issues or restrictions with not using bun? So far I have not noticed any.

Please let me know if there is anything I should specifically test to get it out of beta :)

@schettn
Copy link
Contributor

schettn commented Sep 12, 2024

@dave-calleja
Happy that you like it!

There are no real performance issues when comparing it to other frameworks like express (Node.JS), but you can of course benefit when using Bun.

You should be better off by using NodeJS most of the time tbh, especially when you do not care about the performance that much.

This is because some edge cases do not work with Bun yet. Take a look at Bun's priorities.

image

But given the fact that you want to use it with Cloudflare Workers anyway, it doesn't really matter.

@schettn
Copy link
Contributor

schettn commented Sep 12, 2024

Please let me know if there is anything I should specifically test to get it out of beta :)

There are two important things:

  • Verifying all of the Core Concepts
  • Feedback on the development server npm run pylon dev .... (Does is crash sometimes? Does it block the port after crashing? How is the DX? Etc..

All in all I have already tested Pylon V2 excessively and also migrated some of my core services from V1 to V2. So I am comfortable releasing it soon.

@schettn
Copy link
Contributor

schettn commented Sep 12, 2024

@dave-calleja Would you mind sharing you Pylon project with me (if you can)? I would love to see how users build there applications, so I can make Pylon better. Sadly most users are closed-source.

@dave-calleja
Copy link
Author

@schettn Unfortunately the project is private also, but can make public a sanitised version for you benefit.

@schettn schettn mentioned this issue Sep 18, 2024
Copy link

🎉 This issue has been resolved in version @getcronit/pylon-telemetry-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version create-pylon-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version @getcronit/pylon-builder-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version @getcronit/pylon-dev-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version @getcronit/pylon-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@schettn
Copy link
Contributor

schettn commented Sep 18, 2024

@schettn Unfortunately the project is private also, but can make public a sanitised version for you benefit.

I would appreciate that if you have some time for it in the future :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🕹 aspect: interface Concerns end-users' experience with the software ⭐ goal: addition Addition of new feature good first issue New-contributor friendly 🟧 priority: high Stalls work on the project or its dependents released 🏁 status: ready for de Ready for work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants