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

Bug/overrides for token #210

Closed
wants to merge 2 commits into from

Conversation

develop084
Copy link

What changed / motivation ?

The OverridesForTokenType type was updated to allow more flexibility when defining overrides in the stylex.createTheme function. The property names are no longer restricted to a specific type, providing greater flexibility for direct use of string literals.

Linked PR/Issues

Fixes # (replace with the relevant issue number, if applicable)

Additional Context

No additional context is necessary for this change.

Pre-flight checklist

@facebook-github-bot
Copy link

Hi @develop084!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 18, 2023
Copy link
Contributor

@nmn nmn left a comment

Choose a reason for hiding this comment

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

I'm not sure this fixes the initial problem, and I think it causes some regressions.

The only change in this PR is that instead of requiring variable media queries to start with @, it can not be any string.

This makes the types less safe, but doesn't fix the initial problem. The actual fix is going to be a bit more complicated then this.

[Key in keyof Config]:
| Config[Key]
| { +default: Config[Key], +[string]: Config[Key] },
| { default: Config[Key]; [property: string]: Config[Key] };
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert this line.
+ means readonly in Flow and is needed.
[string] is valid in Flow, and there is no need for the property: bit.
Please bring back the + here.

Copy link
Author

Choose a reason for hiding this comment

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

Okay I will correct this

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of your PR? Every change this PR breaks Flow by trying to change it to Typescript syntax.

Copy link
Author

Choose a reason for hiding this comment

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

@nmn I thought the problem occurred , can be fixed by changing the type, it was my first try to contribute to open source I think I am not at the ryt place then.
Thanks

Copy link
Author

Choose a reason for hiding this comment

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

I will try to fix what's bad in my PR, I am sure that I'll learn something :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@develop084 From what I understand, you're trying to change the types of createTheme to allow changing some of the variables instead of all of them.

I've already made this fix and it'll be out in the next release in a few days.


I don't want to discourage you from learning and contributing. I would suggest reading the Contribution.md document, and learn more about Flow at flow.org

Then, make sure you have the Flow plugin for VSCode installed and functional before you make your next attempt.

@nmn nmn closed this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants