Skip to content

v0.2.3

Latest

Choose a tag to compare

@ddon ddon released this 21 May 06:43
· 10 commits to main since this release

Core helper adoption + sitemap locale-prefix refactor.

Added

  • PhoenixKitEntities.UrlResolver.locale_prefix/2 — resolves the constant locale path-prefix (/en, ``, …) for a (language, is_default) pair. Built for batch callers like sitemap generation: resolve once and prepend to many paths instead of re-reading the site-wide locale settings per URL.

Changed

  • UrlResolver now delegates to the framework-shared phoenix_kit core helpers instead of maintaining parallel copies: build_path_with_language/3's prefix decision goes through PhoenixKit.Modules.Sitemap.LocalePath.emit_prefix?/2, and the boot-safe primary-language check uses PhoenixKit.Modules.Languages.prefixless_primary_safe?/0 (which also handles the mix-task context the previous local rescue missed). Behaviour-preserving.
  • SitemapSource resolves the locale prefix once per generation and threads it through the entry builders, replacing the per-URL (language, is_default) arguments. The previous code re-read the site-wide locale settings via PhoenixKit.Cache per generated URL (~4·N·L lookups returning the same constant); per-generation settings lookups now drop from O(N·L) to O(1).

Fixed

  • EntityData.public_path/3 and public_alternates/3 docstrings documented the pre-default_language_no_prefix behaviour and shipped example URLs that were wrong under the default (setting OFF); prose and examples corrected.

Hex: https://hex.pm/packages/phoenix_kit_entities/0.2.3 · Docs: https://hexdocs.pm/phoenix_kit_entities/0.2.3