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

Add way to compile out ASTextNode + TextKit dependencies #1242

Merged
merged 2 commits into from
Nov 23, 2018

Conversation

maicki
Copy link
Contributor

@maicki maicki commented Nov 18, 2018

Currently we are having ASTextNode and ASTextNode2 which are adding quit a bit of size to Texture. As it becomes more and more clear that ASTextNode2 gonna be the future of text node within Texture we will provide a way to opt out of ASTextNode and make ASTextNode2 the default by default.

To be able to completly opt out of ASTextNode and all of it's TextKit dependency we are introducing a compiler flag called AS_ENABLE_TEXTNODE. By default the value is YES / 1 to reflect the old behavior.

Furthermore there is a CocoaPods subspec added to disable the flag.

If the flag is disabled and ASTextNode2 is used only this will reduce around 300kb of Texture size.

@nguyenhuy
Copy link
Member

Should we also compile out the ASTextNode2 experiment (ASExperimentalTextNode and friends) if only ASTextNode2 is available?

@maicki
Copy link
Contributor Author

maicki commented Nov 22, 2018

I just updated the diff to compile out ASExperimentalTextNode and fix tests. Furthermore for the time being we will define ASTextNode to ASTextNode2 if AS_ENABLE_TEXTNODE is NO.

Copy link
Member

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

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

Great to be able to reduce the framework's size when some code is never used.

@maicki maicki merged commit f2bc63f into master Nov 23, 2018
@maicki maicki deleted the MSTextNode1CompilerFlag branch December 13, 2018 02:21
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.

None yet

2 participants