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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃Ф Use a getter instead of a const val OPERATION_QUERY #4130

Merged
merged 3 commits into from
May 23, 2022

Conversation

ephemient
Copy link
Contributor

Because enormous (64kB) strings cannot fit into a single constant in JVM
bytecode, but the Kotlin compiler will compile huge string literals as
runtime concatenation of smaller constants.

Using a getter instead of a val with a backing field so that for most
users, this does not have any practical impact (as r8 should be able to
inline the simple getter function into a string constant load).

Because enormous (64kB) strings cannot fit into a single constant in JVM
bytecode, but the Kotlin compiler will compile huge string literals as
runtime concatenation of smaller constants.

Using a getter instead of a val with a backing field so that for most
users, this does not have any practical impact (as r8 should be able to
inline the simple getter function into a string constant load).
@apollo-cla
Copy link

@ephemient: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@netlify
Copy link

netlify bot commented May 22, 2022

馃懛 Deploy request for apollo-android-docs pending review.

Visit the deploys page to approve it

Name Link
馃敤 Latest commit 50ee3c7

@ephemient ephemient changed the title Use a getter instead of a const val OPERATION_QUERY 馃Ф Use a getter instead of a const val OPERATION_QUERY May 22, 2022
Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

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

Thanks!

@martinbonnin martinbonnin merged commit 0515652 into apollographql:main May 23, 2022
@ephemient ephemient deleted the too-much-string-to-const branch May 23, 2022 11:28
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

4 participants