Skip to content

Store less unnecessary information in the linkable entities#1487

Draft
d-ronnqvist wants to merge 4 commits into
swiftlang:mainfrom
d-ronnqvist:smaller-linkable-entities
Draft

Store less unnecessary information in the linkable entities#1487
d-ronnqvist wants to merge 4 commits into
swiftlang:mainfrom
d-ronnqvist:smaller-linkable-entities

Conversation

@d-ronnqvist

Copy link
Copy Markdown
Contributor

Bug/issue #, if applicable:

Summary

This makes two changes to the linkable entities data:

  • c4c9fe2 stores to separate isDeprecated and isBeta values instead of a list of platform information. Today, the platforms information is used to compute these two booleans when creating a TopicRenderReference when a page is linked to externally.

    This change reduces the size of the linkable-entities.json file by between 10–30% depending on project.

  • 4e582e9 stores the navigator title as a string instead of a list of declaration fragments. Today, the navigator fragments are joined into a string for the NavigatorItem title.

    This change only reduces the size of the linkable-entities.json file by about 0.5–1.5% depending on project. The reason for this small change is that the vast majority of elements don't have a custom navigator title and those that do typically only have a single identifier fragment, meaning that the rare space savings is only:

    - {"kind":"identifier","spelling":"SomeNavigatorTitle"}
    +                                 "SomeNavigatorTitle"

Both changes are backwards compatible with older linkable-entities.json files.

Dependencies

None

Testing

TODO

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary
  • Updated the LinkableEntities spec to reflect these new fields.

Only platform information is insufficient because symbols also check the presence of a DeprecationSummary when determining if they're deprecated.
This information isn't reflected in external entities today, resulting in differences when such a page is referenced externally.
The navigator ultimately joins the navigator fragments into a plain string.
By doing the same for external entities we avoid storing unnecessary data.
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.

1 participant