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: exports enums js #774

Merged
merged 10 commits into from
Feb 19, 2024
Merged

fix: exports enums js #774

merged 10 commits into from
Feb 19, 2024

Conversation

loks0n
Copy link
Member

@loks0n loks0n commented Feb 15, 2024

  • Adds export of enums in the Node SDK index.d.ts
  • Use readonly objects with Object.freeze for node
  • Simplify enums object in template params

@loks0n loks0n changed the base branch from master to 1.5.x February 15, 2024 11:20
@abnegate
Copy link
Contributor

@loks0n Lets keep the TS enums:

  • Enums prevent usage of the string literal value which is a breaking change.

The breaking change is okay for SDKs, this will be the case for all typed languages, since we now expect the enum type instead of a string

  • Enums are not available is in vanilla JS, meaning we would have to (badly) emulate the implementation for the node SDK.

Node can continue using plain objects instead of TS enums

Use UPPER_SNAKE_CASE for js enums keys

If this is a convention we are using elsewhere let's do it, otherwise in my experience they should be pascal case

@loks0n
Copy link
Member Author

loks0n commented Feb 16, 2024

The breaking change is okay for SDKs, this will be the case for all typed languages, since we now expect the enum type instead of a string

Not a fan of this DX personally but OK

Node can continue using plain objects instead of TS enums

OK

If this is a convention we are using elsewhere let's do it, otherwise in my experience they should be pascal case

Both are acceptable just personally preferred UPPER_SNAKE, reverted.

@abnegate abnegate merged commit e74194f into 1.5.x Feb 19, 2024
34 checks passed
@abnegate abnegate deleted the fix-exports-enums-js branch February 19, 2024 05:09
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