Loading the bundled list is now synchronous. The async factory was the only
asynchronous thing in the library and guarded a cost (a ~2 ms one-time index
build, measured) that never needed guarding; removing it drops async/await/
throws from every bundled-list call site.
Changed (breaking)
PublicSuffixList.sharedis now a synchronous, non-throwingstatic let,
not anasync throwsfactory. It decodes a precompiled binary blob
(public_suffix_list.bin) once on first access and caches it process-wide.
Call sites becomePublicSuffixList.shared.lookup(...)— notry, noawait.loading(from:)is now synchronousthrows(PublicSuffixListError)(it still
parses.dattext for custom lists).PublicSuffixListErroris reduced to its single reachable case,
ruleParsingError. A corrupt bundled blob is a package defect and traps via
preconditionFailurerather than throwing.
Removed
- The
@concurrent asyncbundled()factory. - The
@concurrent asyncshared()factory and theSharedListCacheactor
behind it (astatic letprovides the once-only caching). PublicSuffixListError.missingBundledResourceand.bundleLoadFailed.
Internal
- New
PSLBinaryFormat(PSL1 little-endian blob, encode/decode) mirroring the
existing IDNA mapping table format. - New in-package
psl-compileexecutable that reuses the realRulesParserto
generate the blob, so it can never drift from the.dat.script/UpdatePSL.swift
regenerates the blob after a refresh. - The bundle now ships only
public_suffix_list.bin; the.datis kept in-repo
as the generator and staleness-test input (excluded from the app bundle),
dropping ~142 KB of dead text from shipping builds. - A CI staleness guard asserts the checked-in blob matches the checked-in
.dat.