Skip to content

Recompilation speedup: move as_local_public/0 into ActivityPub.Utils

Alex Gleason requested to merge cycles-constants into develop

#2651 (closed)

In order to use the data in Pleroma.Constants, files must require Pleroma.Constants. However,

  • require creates a compile-time dep
  • as_local_public/0 has a dep on Pleroma.Web
  • As a result, files that require Pleroma.Constants have a compile-time dep on Pleroma.Web

Even though other AP IDs are in this file, I argue that as_local_public is not really a constant since it can change based on the user's configuration. So I think a more appropriate place for it is in ActivityPub.Utils.

This change reduces the length of all existing cycles by 1: https://www.diffchecker.com/jQbwM3G4

Merge request reports

Loading