-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ASTextNode2] Provide compiler flag to enable ASTextNode2 for all usages. #410
Conversation
…ges. The runtime switch is helpful, but is too slow to be shipped in a large production application where startup time is carefully optimized. Although this doesn't pass text-related snapshot tests when enabled, it does allow apps to rely on built-in components like ASButtonNode using the same text stack as when they are manually creating ASTextNode2 instances. A simpler approach would be to use a #define ASTextNode ASTextNode2, but this would create unusual keyword highlighting in code referencing ASTextNode. However, because it would be less invasive and this is not on by default, we could do that instead if preferred.
@@ -11,6 +11,7 @@ | |||
// | |||
|
|||
#import <AsyncDisplayKit/ASTextNode2.h> | |||
#import <AsyncDisplayKit/ASTextNode.h> // Definition of ASTextNodeDelegate |
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.
In the future everything will be merged. However, in a separate diff, we could clean this up to add an ASTextNodeDefinitions.h or similar to declare both the highlight enum and the delegate protocol.
I'm aiming to keep this particular diff quick, but it does raise the question of what our migration path should be to ASTextNode2.
🚫 CI failed with log |
🚫 CI failed with log |
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.
To make the relationship between this compile-time flag and the runtime options more clear, lets:
- Add linking comments between the two sites (ASAvailability.h and ASTextNode+Beta.h).
- Rename the macro to something like
ASTEXTNODE_EXPERIMENT_GLOBAL_ENABLE
to reinforce the connection.
Beyond that I'm cool with landing this puppy.
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.
Perfect!
…ges. (TextureGroup#410) * [ASTextNode2] Provide compiler flag to enable ASTextNode2 for all usages. The runtime switch is helpful, but is too slow to be shipped in a large production application where startup time is carefully optimized. Although this doesn't pass text-related snapshot tests when enabled, it does allow apps to rely on built-in components like ASButtonNode using the same text stack as when they are manually creating ASTextNode2 instances. A simpler approach would be to use a #define ASTextNode ASTextNode2, but this would create unusual keyword highlighting in code referencing ASTextNode. However, because it would be less invasive and this is not on by default, we could do that instead if preferred. * Update AsyncDisplayKit.h * [ASTextNode2] Improve naming and documentation of ASTEXTNODE_EXPERIMENT_GLOBAL_ENABLE * [ASTextNode2] CHANGELOG.md for TextureGroup#410.
The runtime switch is helpful, but is too slow to be shipped in a large
production application where startup time is carefully optimized.
Although this doesn't pass text-related snapshot tests when enabled, it
does allow apps to rely on built-in components like ASButtonNode using
the same text stack as when they are manually creating ASTextNode2
instances.
A simpler approach would be to use a #define ASTextNode ASTextNode2,
but this would create unusual keyword highlighting in code referencing
ASTextNode. However, because it would be less invasive and this is
not on by default, we could do that instead if preferred.