-
Notifications
You must be signed in to change notification settings - Fork 147
Unify all the macOS diff tags #1392
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
Conversation
// [macOS
, // macOS
, // macOS]
i don't know how i feel about this. bracket means pretty different thing in objc so as i read the functions i would be confused. |
Good point, that might be why we went with the weirder format of " // ]tag" instead of "// tag]". Open to other ideas. I don't expect to merge this for a while... |
One issue I have is that it's a lot easier to search for |
120d431
to
8a17e8e
Compare
Base commit: 21dbc67 |
b001619
to
f5cd9bb
Compare
94690ad
to
b750e6a
Compare
aa35694
to
63648a1
Compare
Hello, I am dividing this PR into 3 chunks and assigning one to each of the people tagged. Please read the PR Description and the documentation added in 63648a1 to get an idea of what has changed and what to look for! 90% of the changes are mechanical, but there is a 10% that includes changes like:
So please keep your eye out for changes like that! The blocks are as follows: Thank you again! |
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.
Signed off for my set of changes, with a couple of minor (non-blocking) comments!
packages/rn-tester/js/examples/ScrollView/ScrollViewIndicatorInsetsExample.macos.js
Show resolved
Hide resolved
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.
Overall looks good! Left some comments on some tags that might need their brackets adjusted. There are also a lot of other comments about stuff that I realized are not related to your PR, such as whether a tag should be added or not - feel free to won't fix since your PR is already pretty big (I saw the project board you opened, could be added to that?). I was just commenting on anything I noticed that didn't make sense to me.
The docs/DiffsWithUpsteam.md was great - some other questions that came up while I was reviewing:
- (I think Mike already asked this) can there be nested macOS diff tags? Personally I find them confusing - in what scenarios should they be used?
- When we use block tags vs. single line tags is a little inconsistent. I saw a couple places where we have // [macOS] at the end of an if statement. I would assume that the entire if block was added for macOS. In other places it's a bit more clear, where we have two tags wrapping the whole if statement
- I think you mentioned this at some point while discussing how to format tags - should tags always be on the same line as some other code, or always on its own line? Just noticed some inconsistencies with this
- I found some of the compound if statements/ifdefs that had a macOS tag at the end a little ambiguous. Was the entire if statement added for macOS, or was the if statement already there but we just modified the condition for macOS? I commented on one of the places where I saw this (
#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_OSX
)
If you have answers to the questions (maybe the answer is just "both options are fine"), might be good to add to the md file.
63648a1
to
8af5386
Compare
* change tags * Add documentation * Address PR comments
Please select one of the following
Summary
This PR resolves #1579 by doing a few things:
// macOS]
instead of// ]macOS
for end tags)docs/DiffsWithUpsteam.md
to document the format of the diff tags. This should be helpful to new and external contributors to the repo.#if !TARGET_OS_OSX
had a single line tag, while the other#else/#endif
had block tagsI did my best to keep this a comment / format only change. To that effect, I did quite a bit of manual work and triple checking to make sure things are consistent. Because I'm effectively going through every diff in our repo, I did notice many places we can make simple one line improvements / usptream changes / diff removals. I attempted to document as many as I could in the following GitHub project: Upstreamable changes / removable diffs . However, I'm sure there were a few small changes that have snuck into this change as well (removing unnecessary diff tags, unused imports or variables, etc).
Changelog
[macOS] [Fixed] - Unify all the macOS diff tags
Test Plan
There was a lot of manual going through all the tags. And then a second time. And then a third time 🙃. I'm going to trust the CI to make sure I didn't break anything.