Skip to content

Add way to compile out ASTextNode + TextKit dependencies#1242

Merged
maicki merged 2 commits into
masterfrom
MSTextNode1CompilerFlag
Nov 23, 2018
Merged

Add way to compile out ASTextNode + TextKit dependencies#1242
maicki merged 2 commits into
masterfrom
MSTextNode1CompilerFlag

Conversation

@maicki

@maicki maicki commented Nov 18, 2018

Copy link
Copy Markdown
Contributor

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.

@maicki
maicki force-pushed the MSTextNode1CompilerFlag branch from bfca80b to 7863840 Compare November 18, 2018 21:28
@TextureGroup TextureGroup deleted a comment Nov 19, 2018
@nguyenhuy

Copy link
Copy Markdown
Member

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

@maicki
maicki force-pushed the MSTextNode1CompilerFlag branch from 7863840 to d9d050a Compare November 22, 2018 18:11
@maicki

maicki commented Nov 22, 2018

Copy link
Copy Markdown
Contributor Author

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.

@nguyenhuy nguyenhuy left a comment

Copy link
Copy Markdown
Member

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.

2 participants