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

fix compatibility with no-fs enviroments (workerd) #1

Open
2 tasks
carafelix opened this issue May 28, 2024 · 0 comments
Open
2 tasks

fix compatibility with no-fs enviroments (workerd) #1

carafelix opened this issue May 28, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@carafelix
Copy link
Member

carafelix commented May 28, 2024

  • remove the import of the upload function for runtimes that do not have a file system
  • add test's for each of the functionalities.

What's the cleanest way to tree shake the upload function? Since the upload function depends on fs an Deno.open respectively

  • opt-out: the upload function it's in the package by default, and in envs like workerds you would "import telegraph from grammy/posts/workerds" (or, /nofs)
  • opt-in: the base package would come for everyone the same, an additional upload function could be imported from "grammy/posts/upload", for example. This way the upload function could be it's own package.

Is there any other way around it?

Edit: I did a small gist using inputFile, for obvious reasons this is not ok, it's specially bad, not because it would first upload it to telegram and then fetch the getFile and the use that link for uploading it to telegraph, it is because the user would the photo, see it delete, and then receive the post).

I'm leaning towards distributing it with no upload function and having a separate package for the upload, like mentioned in the opt-in option. That would need a rework of the telegraph bindings package

@carafelix carafelix added bug Something isn't working enhancement New feature or request labels May 28, 2024
@carafelix carafelix moved this to Todo in Plugins May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
No open projects
Status: Todo
Development

No branches or pull requests

1 participant