Skip to content

Conversation

@anfelbar
Copy link
Collaborator

About

Adding Typescript support and hello world test.
Run with bazel test //typescript:typesctript_test

Progress #36

Copy link
Contributor

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I don't know much about TypeScript. Sara, Will, or Louis would be able to give a better review.

@@ -0,0 +1,7 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know nothing about typescript: do we need to track external dependencies like this though? For other languages, you can do most things through BUILD or WORKSPACE files, so I'm surprised we need these.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the documentation, we need those files as bazel builds entire projects. I have checked it works as it translated the code into a .js file in bazel-bin and when you execute it show hello world. I think we will improve this an all other examples for a most robust testing. This json file and more will increase in its dependency tree. Anyways, I will wait today, maybe we will have more comments from Will and Sara.

Just for your information, these are the rules I am using: https://github.com/aspect-build/rules_ts

@anfelbar anfelbar requested a review from saraadams November 11, 2022 13:46
@anfelbar anfelbar merged commit e792ede into main Nov 12, 2022
@anfelbar anfelbar deleted the andres-typescript-example branch November 12, 2022 22:53
@@ -0,0 +1,4 @@
export const hello: String = "Hello ";
export const world: String = "World "

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: semicolons after each line (ideally this would pass our linter tests which are not configured for this package)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

"compilerOptions": {
"declaration": true,
"baseUrl": ".",
"types": ["node"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this type? We generally aren't transpiling for Node.js (for the browser instead)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really have a requirement here. I just added typescript support with rules_ts and to execute a simple example. I think, however, that line 5 is not necessary. I will remove it.

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.

4 participants