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

Optional feature flags in Pickles.sideLoaded #277

Merged
merged 6 commits into from
Jun 18, 2024
Merged

Optional feature flags in Pickles.sideLoaded #277

merged 6 commits into from
Jun 18, 2024

Conversation

Trivo25
Copy link
Member

@Trivo25 Trivo25 commented Jun 17, 2024

No description provided.

Comment on lines +82 to +88
Pickles_types.Plonk_types.Features.map feature_flags_ ~f:(function
| Some true ->
Pickles_types.Opt.Flag.Yes
| Some false ->
Pickles_types.Opt.Flag.No
| None ->
Pickles_types.Opt.Flag.Maybe )
Copy link
Contributor

Choose a reason for hiding this comment

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

nicely done!
btw if you'd want to model Pickles_types.Opt.Flag.t in TS, as an enum without contents it maps to 0 | 1 | 2, where the order is determined by the order that Yes | No | Maybe appear in the enum definition

{ identifier = Js.to_string rule##.identifier
; feature_flags = rule##.featureFlags
; feature_flags =
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the type of the pickles rule here as well to match the rest (less different types we have to consinder in javascript or here)

@Trivo25 Trivo25 merged commit df307f8 into main Jun 18, 2024
1 check passed
@Trivo25 Trivo25 deleted the maybe-flag branch June 18, 2024 08:15
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