I know this is probably a very complex feature, but I'd like to work with TypeScript when writing functions.
Some stretch goals:
- full integration with VSCode so we no longer have to use the web editor
- add support for testing functions (through CI/CD)
OP created this message more than two years ago. Since then we don't have any news from MongoDB. It is not in their roadmap. To be honest I'm not sure we'll see this feature in 2023...
Therefore on our projects, we are migrating all of our Realm Functions to Azure Functions. It's much better: TypeScript support, local development server, efficient CLI, etc.
Yes please! Having to go to the docs to find out what's in Context or globals like https://www.mongodb.com/docs/atlas/app-services/functions/globals/#std-label-bson feels like going back to 2018
It's relatively easy to set up manual transpilation through a Husky pre-commit hook, but the .ts source file needs to be outside of your realm directory structure otherwise it is cleared later when doing an update from the UI, and you still lack type definitions for the Mongo variables.
Native Typescript support, offering IntelliSense autocompletion and type safety would be a great fit for Atlas Functions as it is usually critical these run safely. It is hard to take Atlas as a platform seriously without it.
I do not know if it's appropriate to write here, but still, it might help someone who is looking for a way to develop functions in typescript. I actually went for my approach, which I asked about in the comment below. You may use the CLI build tool made for making functions development easier: https://www.npmjs.com/package/@realm-fun/cli. It is far from delivering the full-fledged typescript support, but it is something / replacement for the time being before Mongo team comes up with their own approach to the issue XD
not only typescript support, we need to see which line and function is causing the error.
right now 1 function calling other function does not show which function is causing the error and which line. we dont have stack information, its very very difficult to debug.
plus error logs are limited in length, this is a huge disadvantage when app scale in terms of complexity
Give it to me, baby! TypeScript is awesome and must be supported!
TS support would be great!
(We use github for deploys so we're able to edit/test locally, but some sort of integrated way to simulate function payloads etc locally would be nice.)
Bump for this - we've got a massive chunk of function code that we'd love to move to realm, but it's all in typescript! Migrating it would be an excessive amount of work right now...