HF-307: align getRegisteredFunctionNames with the license gate, deprecate its static form (9/9) - #1743
Open
marcin-kordas-hoc wants to merge 1 commit into
Open
Conversation
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | dcf9354 | Commit Preview URL Branch Preview URL |
Aug 21 2026, 02:18 AM |
Performance comparison of head (dcf9354) vs base (4c8258e) |
marcin-kordas-hoc
marked this pull request as ready for review
August 20, 2026 12:54
marcin-kordas-hoc
force-pushed
the
hf-329-token-dialects
branch
from
August 20, 2026 13:09
02e3434 to
e7b250b
Compare
marcin-kordas-hoc
force-pushed
the
hf-307-registered-function-names
branch
from
August 20, 2026 13:09
b727d70 to
d314b32
Compare
marcin-kordas-hoc
force-pushed
the
hf-329-token-dialects
branch
from
August 21, 2026 01:31
e7b250b to
4c8258e
Compare
marcin-kordas-hoc
force-pushed
the
hf-307-registered-function-names
branch
from
August 21, 2026 01:32
d314b32 to
0f210ad
Compare
This was referenced Aug 21, 2026
… gate The instance method now lists exactly what the instance can evaluate, through the same listable ids and the same licenseListsFunction rule the metadata API and the interpreter share: protected built-ins included (OFFSET was missing before), the instance's own translation snapshot instead of a fresh global language lookup, and no function the license key does not include. A missing/invalid/expired key does not shorten the list. The static form is REMOVED, finishing what HF-349 started: a static method has no key or config in scope, so it can only ever answer for the package as a whole - Kuba's own rationale on #1724, applied to the one API it missed. The docs build-time function count moves to an unlicensed instance (measured: both spellings count 423 for enGB). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pxNP45obT2LZfjitaCv9o
marcin-kordas-hoc
force-pushed
the
hf-307-registered-function-names
branch
from
August 21, 2026 02:14
0f210ad to
dcf9354
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## hf-329-token-dialects #1743 +/- ##
=========================================================
- Coverage 97.39% 97.39% -0.01%
=========================================================
Files 204 204
Lines 16253 16252 -1
Branches 3483 3483
=========================================================
- Hits 15829 15828 -1
Misses 424 424
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
9/9 of the HF-307 stack, stacked on #1741. Pairs with
hyperformula-tests#43— merge the tests PR first. Finishes decision D2 on the one API it missed.The problem
getRegisteredFunctionNames()returned the whole catalogue under a restricted key (measured: 422 names on a calculated-fields key, including functions that evaluate to#LIC!). A function picker built on it has exactly the problem #1724 (HF-349) and #1731's metadata filter exist to prevent. Flagged in #1731's "found, not fixed here" section; this closes it.What changed
Instance method — now lists exactly what the instance can evaluate, sharing the one
licenseListsFunctionrule with the interpreter and the metadata API so the three surfaces cannot drift:getListableFunctionIds()instead ofgetRegisteredFunctionIds()— the protected built-ins are included uniformly (OFFSETwas missing before;getAvailableFunctionsalready listed it);config.translationPackage— the instance's own snapshot — instead of a fresh globalgetLanguagelookup, which can report a localized name the instance refuses to evaluate, and which throws once the host unregisters that language code;Static method — deprecated, not removed. See below; this is a change from the first version of this PR.
The static: deprecated rather than removed (changed after review)
The first version of this PR deleted
HyperFormula.getRegisteredFunctionNames(code), citing HF-349 as precedent. That was wrong, and the review caught it:The method is in the released 3.4.0 tag, and HF-349's own commit message says its removal was free precisely because "Both methods are unreleased, which is the only free moment to remove them." So the precedent does not extend here: deleting it would be a breaking change in a minor release, against the Semantic Versioning this project states it follows, and DEV_DOCS's Definition of Done would require a migration-guide section that
docs/guide/has no 3.x home for.So it is now
@deprecatedwith the wording this repo already uses for that situation (arraySizeMethod/arrayFunctionin 3.1.0: "deprecated and will be removed in one of the next major releases"), plus aDeprecatedchangelog entry. Overturnable in one comment if you would rather take the break now — the direction is Kuba's D2 either way; only the timing changed.The deprecation notice is explicit that the two are not interchangeable: the static translates into any registered language without an engine, so migrating means building one (
HyperFormula.buildEmpty({ language: 'plPL' }).getRegisteredFunctionNames()).D2's precondition, discharged
Kuba's D2 answer made the removal conditional: "perhaps we can remove the static methods, I'll check which methods does formula-builder use". That check is done — searched the org, and both consumers call the instance form, not the static one:
formula-builderpackages/core/src/engine/functionCatalog.ts:81—this.engine?.getRegisteredFunctionNames?.(), in try/catch, declared optional inengine/types.ts:66aurasheetsrc/core/FormulaEngine.ts:97—this.hf.getRegisteredFunctionNames()Both use it to build a function picker (
functionCatalog.ts;FormulaAutocompletePlugin.ts) — the surface #1724's rationale was about — so the license filter added here improves both rather than disturbing them. Undergpl-v3or any unrestricted key their lists are unchanged.Spec-to-ship review (2026-08-20): also fixed here
getLanguagethrows for an unregistered code while the snapshot keeps working.getAvailableFunctions: for a function whose translation is the empty string this method returns''while that one falls back to the canonical id. The claim is now scoped to the ids and the licence rule, with the naming difference stated.docs/.vuepress/config.jsis untouched by this PR again (it no longer builds one engine per documentation page).Testing
New suite pins the alignment in both directions (agrees with
getAvailableFunctionsname for name; narrows on a restricted key; never narrows on a bad key; aliases gate with their canonical; answers from the instance's own snapshot). Full private suite: 517 suites / 6462 passing, 3 pre-existing skips;tsc --noEmitand ESLint clean.Note for review
functions-metadata.spec.tsnow skips listed ids with no plugin:OFFSETis listed (it is callable) but parse-time resolved, so it legitimately has no registry metadata.🤖 Generated with Claude Code
https://claude.ai/code/session_019pxNP45obT2LZfjitaCv9o
The codecov/project dip, traced
codecov/projectwas red at −0.02% whilecodecov/patchreported 100% of the diff hit. Rather thanwrite that off as a threshold artifact, I measured coverage on this commit and on its base and
diffed the per-file numbers:
src/HyperFormula.tssrc/interpreter/FunctionRegistry.tsSo the covered count did not move and one previously covered line stopped executing — a real
consequence of this change, not a rounding artifact. The line was the instance
FunctionRegistry.prototype.getRegisteredFunctionIds(), whose only caller in the whole repositorywas the method this PR rewrites. Nothing in
src/, nothing in the private suite, and nothingoutside (the class is not exported from
src/index.ts) calls it any more.Removed, since this change is what orphaned it. The static
FunctionRegistry.getRegisteredFunctionIds()is untouched and still used — by the deprecated static method above and by three specs.
For the record, the single uncovered line left in
HyperFormula.tsis pre-existing and not mine:removeNamedExpression's unreachablereturn [], which already carries acodecov notecommentexplaining why it cannot be hit.
Note
Medium Risk
Public listing API now filters by license and translation snapshot, which can shrink picker lists for restricted keys. Static getRegisteredFunctionNames is deprecated, not removed.
Overview
Makes instance
getRegisteredFunctionNames()match what the engine can actually evaluate, so a function picker no longer offers names that would return#LIC!.It now uses
getListableFunctionIds()(so protected built-ins likeOFFSETappear), filters with the samelicenseListsFunctionrule asgetAvailableFunctions(), and translates via the instance’stranslationPackagesnapshot. A missing, invalid, or expired key still does not shorten the list.Static
HyperFormula.getRegisteredFunctionNames()is deprecated (not removed): it has no engine/key in scope. Docs and changelog cover the three listing methods and the migration path (buildEmpty({ language }).getRegisteredFunctionNames()).FunctionRegistry.getRegisteredFunctionIds()is dropped as unused.Reviewed by Cursor Bugbot for commit dcf9354. Bugbot is set up for automated code reviews on this repo. Configure here.