Skip to content

Change Request.referrerPolicy to a polymorphic variant #66

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

Closed

Conversation

tom-sherman
Copy link
Contributor

@tom-sherman tom-sherman commented Dec 21, 2021

Relates to #30 and #38

This introduces a minor (IMO) inconsistency with the JS api. In JS-land you can pass referrerPolicy: "", with this PR you must pass either None or omit it.

I did initially have #"" as one of the variants but it surfaced a bug in rescript formatting. See https://github.com/rescript-lang/rescript-compiler/issues/5346

@tom-sherman
Copy link
Contributor Author

I've just realised that omitting the #"" variant is incorrect as this is a valid referrerPolicy when reading from a Request instance. I'm going to revert the commit where I removed it and mark this PR as WIP as it's blocked by the rescript formatting bug.

Would be great if anyone knew of an alternative solution!

@tom-sherman
Copy link
Contributor Author

Can't mark as WIP so closing for now.

@TheSpyder
Copy link
Owner

I'm surprised you don't have access to swap a PR to be a draft PR. I hope we are able to do this one day, I hate having None as a defined constructor anywhere because it can shadow option constructors if open is used incorrectly.

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