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

Power your code with TypeScript #1168

Open
moltar opened this issue Jan 15, 2021 · 5 comments
Open

Power your code with TypeScript #1168

moltar opened this issue Jan 15, 2021 · 5 comments

Comments

@moltar
Copy link

moltar commented Jan 15, 2021

Power your code with JavaTypeScript

Since Dataform is written in TypeScript, it would be great to get native support for TypeScript in scripts as well.

That would then allow developers to get IntelliSense support and compiler can check for type errors.

Thanks!

@dgillis91
Copy link

My team is moving to dataform and we will be relying pretty heavily on js. I'd much rather have ts support, though.

I was considering just transpiling to js, but it would be better to have it in dataform. Any tips for tackling it if I make a fork?

@dgillis91
Copy link

@BenBirt - wanted to get some advice on this one and didn't know who to bump. Any advice here?

Probably a fairly heavy lift for me, but I'm willing to give it a shot. I also think I can get some people inside our company interested on working this, too.

@Ekrekr
Copy link
Contributor

Ekrekr commented Mar 26, 2024

Now that v3 is merged in as the main branch, this should be simpler to do - there's less code that this would have to be applied to.

This would probably need some hacking to figure out the best solution. I could see the solution to this being along the lines of:

  • Add typescript as a dependency to the Core and CLI packages.
  • Add an option to workflow_settings.yaml that swaps to expecting typescript rather than javascript.
  • Transpile from TS to JS directly in what's currently the JS part of SQLX block extraction:
    function compileSqlx(rootNode: SyntaxTreeNode, path: string): string {
    .
  • Alternatively, set up ts.transpile for the vm2 compiler in the CLI, Support TypeScript. patriksimek/vm2#323,
    const userCodeVm = new NodeVM({
    .
  • I don't know if these would provide nice type validation during compilation though.
  • Edit: another consideration is that typescript as a dependency is huge, so may cause compile timeouts.

If you want to chat further, hit me up! My email is eliaskassell@google.com.

@moltar
Copy link
Author

moltar commented Mar 26, 2024

FYI with this landing #1550, I am also no longer interested in this project, thus do not need this feature. I will not close the issue, as it might be useful to others, but I will unsubscribe from further updates. Please don't hesitate to close this issue if you don't find it relevant.

@Ekrekr
Copy link
Contributor

Ekrekr commented Mar 26, 2024

No worries @moltar! From my last chat with them, https://www.datashell.dev are in the process of creating a CLI tool that can run Dataform compiled graphs (which are now agnostic to the SQL warehouse) against other warehouses - I would keep an eye on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants