fix: make excludeRouters configurable instead of hardcoded#220
fix: make excludeRouters configurable instead of hardcoded#220happy-edge wants to merge 1 commit into
Conversation
Previously, when excludeDexes was specified, the plugin would always add a hardcoded list of excludeRouters. This was undocumented and couldn't be overridden. Changes: - Add excludeRouters to FormProps interface with documentation - Only apply default excludeRouters if user doesn't specify their own - Extract default routers to named constant for clarity - Fix typo and remove unused import (from PR jup-ag#217) Users can now: 1. Use excludeDexes alone (gets default router exclusions) 2. Use excludeRouters alone (explicit control) 3. Use both for full control 4. Pass empty excludeRouters=[] to opt out of default behavior
|
Someone is attempting to deploy a commit to the wowcats Team on Vercel. A member of the Team first needs to authorize it. |
thejesh23
left a comment
There was a problem hiding this comment.
Clean change. Two small things:
-
Opt-out semantics are subtle.
excludeRouters: undefined→ defaults applied;excludeRouters: []→ no defaults. That's a defensible convention but not obvious from the type signature. Worth calling out in the JSDoc explicitly, e.g. "Pass[]to disable the default router exclusions." Otherwise integrators will guess. -
keepPreviousDataimport was removed along with the unrelated typo fix. Worth double-checking it isn't referenced elsewhere inuseQuoteQuery.tsoutside the diff window — if it was passed touseQuery'splaceholderDataoption below the visible range, the build will break. (Unrelated to the main change either way; consider splitting cosmetic cleanups out, especially since the description already notes this overlaps with #217.)
Summary
When
excludeDexesis specified, the plugin previously added a hardcoded list ofexcludeRouterswithout any way to override or opt out. This PR makes the behavior configurable.Problem
Solution
Changes
excludeRouterstoFormPropswith JSDocexcludeRoutersto quote queryDEFAULT_EXCLUDED_ROUTERSconstantBackwards Compatible
Existing integrations work identically - the default behavior is preserved when
excludeRoutersis not specified.