-
Notifications
You must be signed in to change notification settings - Fork 41
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
Make an optional js feature #86
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ repository = "https://github.com/dylanhart/ulid-rs" | |
default = ["std"] | ||
std = ["rand"] | ||
postgres = ["dep:postgres-types", "dep:bytes"] | ||
js = ["getrandom/js"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a default feature? It seems odd to have a feature that needs to be enabled when compiling for JS targets. Does this break the library when turned off? The existing WASM target was contributed and I'm not really sure on the best practices here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it should be a default feature, because for example If on the other hand, this is not default, for those that uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I think it is best to remove dependency on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another workaround is to move getrandom to a dev dependency #88 , which has the minimum change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
[dependencies] | ||
serde = { version = "1.0", optional = true } | ||
|
@@ -25,7 +26,7 @@ postgres-types = { version = "0.2.6", optional = true } | |
bytes = { version = "1.4.0", optional = true } | ||
|
||
[target.wasm32-unknown-unknown.dependencies] | ||
getrandom = { version = "0.2", features = ["js"] } | ||
getrandom = "0.2" | ||
web-time = "1" | ||
|
||
[dev-dependencies] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs documentation in README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added a line to the README. Please have a look, thanks!