Skip to content

Remove leftover playground constants and bump the SDK - #379

Merged
marcospassos merged 2 commits into
masterfrom
remove-playground-constants
Aug 26, 2026
Merged

Remove leftover playground constants and bump the SDK#379
marcospassos merged 2 commits into
masterfrom
remove-playground-constants

Conversation

@marcospassos

@marcospassos marcospassos commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Two related pieces of constants cleanup found while verifying the 0.24.1 release.

1. Remove the leftover playground constants

PLAYGROUND_ORIGIN and PLAYGROUND_CONNECT_URL have been dead since the playground plugin was removed in #350 — the declarations in src/constants.ts were 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.

grep for PLAYGROUND_ORIGIN, PLAYGROUND_CONNECT_URL and plug/constants across plug-js, plug-react, plug-next and application-ui-js returns only the two declarations being removed here.

Removed from the four places that had to stay in sync:

  • src/constants.ts — the two exports
  • release-config.mjs — the values and their workflow variables
  • rollup.config.mjs — the required arguments and their replace entries
  • .github/workflows/deploy-release.yaml — the two --config-playground-* bundle arguments

All four had to change together: rollup.config.mjs throws when a --config-* argument is missing, so leaving the workflow untouched would have broken the CDN bundle.

2. Bump @croct/sdk to 0.22.4

Every SDK release up to 0.22.3 published MAX_QUERY_LENGTH as parseInt("<@maxQueryLength@>", 10), which is NaN. Since length > NaN is always false, the query length guard in Evaluator.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.4 rather 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:

before: parseInt("<@maxQueryLength@>",10)   // NaN
after:  parseInt("500",10)

The lockfile diff touches @croct/sdk only.

Checks

  • npm run build + node prepare-release.mjs produce the expected constants, with no placeholders left.
  • The CDN bundle builds with the reduced argument set, inlines the correct CDN_URL and widget URL, and now contains no <@…@> placeholders at all.
  • tsc --noEmit, ESLint, and the test suite (328 tests) all pass.

Note

constants is 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.

`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.
@marcospassos marcospassos added the maintenance Housekeeping label Aug 26, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@croct/plug@379

commit: 640b449

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.
@marcospassos marcospassos changed the title Remove leftover playground constants Remove leftover playground constants and bump the SDK Aug 26, 2026
@marcospassos
marcospassos merged commit 3fea8d3 into master Aug 26, 2026
11 checks passed
@marcospassos
marcospassos deleted the remove-playground-constants branch August 26, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant