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

Remove Enum-like objects #1833

Open
Tracked by #928
blaine-arcjet opened this issue Oct 2, 2024 · 3 comments
Open
Tracked by #928

Remove Enum-like objects #1833

blaine-arcjet opened this issue Oct 2, 2024 · 3 comments
Assignees

Comments

@blaine-arcjet
Copy link
Contributor

The initial design of the SDK used TypeScript enums for various configuration. We've removed those in favor of string unions, which fit more naturally with the way people write both TypeScript and JavaScript. However, we kept around objects that behaved like the enums for migration. Our docs haven't recommended those for a long time, and we're moving towards string values that translate directly to Wasm via jco.

We should deprecate and remove these.

@e-moran
Copy link
Contributor

e-moran commented Dec 18, 2024

We decided in the team call today that we should target deprecating these for the beta, and remove them at a later stage.

The deprecation should will print a warn-level message advising users that they should consider switching to string unions soon. We will then remove them in a future update. The deprecation is tracked by #2621.

@blaine-arcjet blaine-arcjet changed the title Deprecate and remove Enum-like objects Remove Enum-like objects Dec 19, 2024
@e-moran
Copy link
Contributor

e-moran commented Dec 20, 2024

From looking in to this, it seems that the objects we used to use were generated by protobuf. I'm not sure what we actually want to remove here, since they are still used for rpc.

@blaine-arcjet
Copy link
Contributor Author

From looking in to this, it seems that the objects we used to use were generated by protobuf. I'm not sure what we actually want to remove here, since they are still used for rpc.

This is incorrect, the Enum-like objects are hand-written at https://github.com/arcjet/arcjet-js/blob/main/protocol/index.ts
For example, https://github.com/arcjet/arcjet-js/blob/main/protocol/index.ts#L15-L18

These all use ArcjetEnum

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

No branches or pull requests

2 participants