Remove leftover playground constants and bump the SDK - #379
Merged
Conversation
`PLAYGROUND_ORIGIN` and `PLAYGROUND_CONNECT_URL` were left behind when the playground plugin was removed in #350. Nothing has referenced them since, in this package or in plug-react, plug-next and application-ui-js, and the bundler already tree-shakes them out of the CDN bundle. Drop them from the constants, the release configuration, the bundle arguments and the workflow that passes them. Note that `constants` is reachable through the package exports, so this removes two public exports.
commit: |
0.22.4 fixes `MAX_QUERY_LENGTH` being published as `NaN` (croct-tech/sdk-js#528), which disabled the query length guard in `Evaluator.evaluate()` for every consumer. The range is raised to `^0.22.4` rather than left at `^0.22.0` so the fix is guaranteed instead of depending on when the dependency is resolved. This also removes the last `<@maxQueryLength@>` placeholder from the CDN bundle, which inlines the SDK.
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.
Summary
Two related pieces of constants cleanup found while verifying the 0.24.1 release.
1. Remove the leftover playground constants
PLAYGROUND_ORIGINandPLAYGROUND_CONNECT_URLhave been dead since the playground plugin was removed in #350 — the declarations insrc/constants.tswere the only references left. They were absent from the CDN bundle because the bundler tree-shakes them, but were still being resolved and shipped in the npm package.grepforPLAYGROUND_ORIGIN,PLAYGROUND_CONNECT_URLandplug/constantsacrossplug-js,plug-react,plug-nextandapplication-ui-jsreturns only the two declarations being removed here.Removed from the four places that had to stay in sync:
src/constants.ts— the two exportsrelease-config.mjs— the values and their workflow variablesrollup.config.mjs— the required arguments and theirreplaceentries.github/workflows/deploy-release.yaml— the two--config-playground-*bundle argumentsAll four had to change together:
rollup.config.mjsthrows when a--config-*argument is missing, so leaving the workflow untouched would have broken the CDN bundle.2. Bump
@croct/sdkto 0.22.4Every SDK release up to 0.22.3 published
MAX_QUERY_LENGTHasparseInt("<@maxQueryLength@>", 10), which isNaN. Sincelength > NaNis always false, the query length guard inEvaluator.evaluate()never rejected, so over-long queries were sent to the server instead of failing locally. Fixed in croct-tech/sdk-js#528 and released as 0.22.4.The range is raised to
^0.22.4rather than left at^0.22.0, so the fix is guaranteed rather than dependent on when the dependency happens to be resolved. It also removes the last<@maxQueryLength@>placeholder from the CDN bundle, which inlines the SDK:The lockfile diff touches
@croct/sdkonly.Checks
npm run build+node prepare-release.mjsproduce the expected constants, with no placeholders left.CDN_URLand widget URL, and now contains no<@…@>placeholders at all.tsc --noEmit, ESLint, and the test suite (328 tests) all pass.Note
constantsis reachable through the./*exports map, so this drops two public exports. They were build-time placeholders for a feature that no longer exists rather than documented API, but it warrants a minor bump rather than a patch.