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

WIP: use typescript for injection file #2

Closed
wants to merge 1 commit into from

Conversation

jtarchie
Copy link

@jtarchie jtarchie commented Mar 26, 2023

This was meant to be a draft PR. I hit the wrong button.

The biloba.js has a lot of gotchya with !! and expected different response types. I wanted to see what the Javascript file would look like with types. Not all types are in there, and more work could be done to be stricter.

This does include a build step and instructions.

@jtarchie jtarchie changed the title use typescript for injection file WIP: use typescript for injection file Mar 26, 2023
@onsi
Copy link
Owner

onsi commented Apr 6, 2023

hey! thanks for this @jtarchie - I haven't had a chance to really play with this yet. I want to clone it and see what the experience is like locally and have been busy/out-of-town the last couple weeks. But i don't want to delay getting back to you any more, so some preliminary (uninformed) thoughts that we can explore together:

  • I'm hesitant to pull in the node ecosystem. I know that a part of this sounds irrational but, fwiw, I don't even have node installed on my machine. I'm a fan of esbuild and know that esbuild can transpile the typescript though without the npm package it can't actually do the typechecking (does that match your understanding)?

  • I have no qualms with typescript and agree that it can be a huge help, particularly in large projects. In this context the scope and context of injected JavaScript file strikes me as pretty small. So I'm just uncertain of the value we're getting out of TypeScript vs the overhead of tooling and infrastructure necessary to support it.

  • With that said, that little JS file managed to get pretty complex. That's partly my bad for trying to keep it super succinct... which is a premature optimization on my part. It might (also?) be good to clean that code up and not be as fancy as I'm trying to be.

On the second point - I just need to clone the thing and play with it locally to get a sense for how obtrusive/unobtrusive it'll be. I'll try to get to that next week.

@jtarchie jtarchie closed this Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants