最后更新于 2026年11月13日。

更新日志

引擎、CLI 及其插件每个版本的变更,以及云端服务和控制台的每次更新,最新的在前。

接下来的计划见路线图。发现了 Bug?在 GitHub 上报告。

版本说明以英文发布。

1.0.3

最新

A smaller WebAssembly engine and a super fix

变更

  • 引擎

    @afterpack/wasm is smaller: 1.23 MiB gzipped, down from 1.29 MiB.

修复

  • 引擎

    An object literal getter or setter that uses super, such as get x() { return super.x }, is now protected. Before, the file failed the build.

1.0.2

Classic-script scoping and direct eval fixes

修复

  • 引擎

    A function declared inside a block at the top of a classic script, such as { function g() {} } or a labelled one, is a global again after protection, so other scripts on the page can call it.

  • 引擎

    Code that calls eval directly keeps seeing the page's globals: a name AfterPack adds can no longer stand in for a global the evaluated code reads or writes, and a variable the evaluated code declares stays in its function's scope.

    Files that build their eval code at runtime, or use with, come out larger, because AfterPack gives its own names a form no page global can share.

  • 引擎

    if (x) function f() {} in a script that is not a module is accepted, as browsers accept it. Declarations browsers reject there, such as if (x) async function f() {}, now fail the build with a parse error instead of passing through.

  • 引擎

    A parenthesized string statement such as ('use strict'); no longer makes its function strict.

  • 引擎

    A var inside a class static {} block stays local to that block.

1.0.1

One receipt for several builds, and release notes in every package

新增

  • CLI

    afterpack verify also counts the JavaScript files in the directory that the receipt doesn't list, such as scripts your pipeline copies in. The count is information only and never changes the exit code.

    Files the receipt doesn't list

  • CLI

    Every --diagnostics.format=json document starts with schemaVersion: 1.

  • 插件

    Every package ships a CHANGELOG.md, and each GitHub release carries its release notes.

变更

  • 文档

    The presets page explains why output size changes between builds and how to set a size budget.

    Size budget

修复

  • 插件

    Several AfterPack builds into one output directory now share one protection receipt, so afterpack verify checks the files of every build. Before, each build replaced the receipt and verify checked only the last one.

    If you merged receipts yourself to work around this, you can remove that step.

    Several builds into one directory

  • 插件

    require("@afterpack/vite/package.json") and the same for every other package now resolve.

1.0.0

AfterPack 1.0, Vite 6 or newer and engine 1.0.0

新增

  • CLI

    The build log names the engine version that ran: your installed @afterpack/core for a local build, or the cloud engine for a Pro build. The CLI's "Protected" summary ends with it too.

  • 云端

    status.afterpack.dev shows whether the API and the website are up, with 90 days of daily uptime. GET /v1/status returns the same data.

    Status API

变更

  • 引擎

    The engine, the CLI and all 13 plugins are now 1.0.0. Across 1.x, your configuration, CLI commands, exit codes and plugin options keep working as they do today.

    Output bytes may change between releases, but the protected program behaves the same.

  • 插件

    Upgrade every AfterPack package together: the 1.0 CLI and plugins refuse an @afterpack/core older than 1.0.

  • 云端

    Pro cloud builds need AfterPack 1.0: the CLI, the plugins, @afterpack/core or @afterpack/wasm. The cloud refuses a 0.x client and names the command to upgrade.

    From 1.0 on, the cloud keeps serving every released 1.x client.

    Pro

  • 插件

    The Protection Map lists each readable string once, with a count, and Show in code steps through every place it appears. Property names, which usually have to stay readable, no longer count as weak spots.

  • 云端

    Pro builds now run engine 1.0.0.

  • 文档

    Every package README checks a build with npx afterpack@latest verify and says when a Protection Map is written.

    Protection Map

修复

  • 引擎

    React Router 7 framework-mode apps now hydrate: a function declared inside a block in strict-mode code no longer breaks a reference to the same name elsewhere in its function.

  • 引擎

    A function that declares a nested function named like one of its parameters no longer fails to load with "Identifier has already been declared".

  • 引擎

    A 'use strict' that comes after other code in a function, or is written with escapes, no longer turns on strict mode.

  • 插件

    Every plugin's protection receipt now records the bundler that built the output instead of unknown.

  • 插件

    The Protection Map's directive legend lists only the directives that exist today. A map saved by an older version still opens.

移除

  • 插件

    Vite 5 support: @afterpack/vite, @afterpack/vue, @afterpack/svelte, @afterpack/sveltekit and @afterpack/electron now need Vite 6, 7 or 8.

  • 插件

    Svelte 4 and SvelteKit 1 support, since they run only on older Vite: @afterpack/svelte needs Svelte 5 and @afterpack/sveltekit needs SvelteKit 2.

云端更新

Pro from your own Cloudflare Worker

变更

  • 文档

    The Cloudflare Workers guide shows Pro from your own Worker: pass your key to @afterpack/wasm, and files too big for a Worker move to containers. It also shows how to cache each result for a rotation window.

    Cloudflare Workers

移除

  • 文档

    The Workers for Platforms roadmap item, because @afterpack/wasm with a Pro key already covers it.

0.2.7

Stricter region directives on Free, key in core and engine 0.2.8

新增

  • 引擎

    A tool that wraps @afterpack/core or @afterpack/wasm can name itself in cloud calls through the client option.

变更

  • 文档

    The directive docs now say plainly that per-region directives are a Pro feature; Free controls whole files through paths.exclude.

修复

  • 引擎

    A Free build now stops when a region directive raises inflation.max above the build's budget, like every other directive that adds protection.

  • 引擎

    The secrets report no longer flags constant names such as MAX_RETRIES as keys, and now flags licence keys and UUIDs.

  • 引擎

    @afterpack/core accepts key in the config, as its readme and types say.

0.2.6

More strings encoded, corrected Protection Map classes and engine 0.2.7

变更

  • 引擎

    The Protection Map now labels control-flow flattening, mixed boolean arithmetic, opaque predicates, cross-dependency entanglement and integer-expression bytecode as renamed & encoded (polynomial-injective), not flattened & fused.

    A static attacker can recover the original structure from each of them, so no transform that ships today is labelled flattened & fused. The transforms themselves are unchanged.

    Reversal classes

  • 引擎

    obfuscate and obfuscateAll in @afterpack/core, and @afterpack/wasm, now send their package name and version with each cloud build, as the CLI and plugins already do.

  • 云端

    Large Pro builds finish sooner: the cloud builds several of their files in parallel.

  • 云端

    Pro builds now run engine 0.2.7.

  • 文档

    The threat model and performance pages now give measured results, including how well AI models reverse protected code and what each preset costs at runtime. The package READMEs now say what self-integrity checks.

    Threat modelPerformance

  • 文档

    The CLI page covers content-hashed renames, per-directory backups, interrupted runs and locks.

    CLI

修复

  • 引擎

    Strings inside the object of a member assignment, such as (r = class { … }).p = v in minified libraries, are now encoded. They used to stay readable at every preset.

    Bundles that include such libraries now ship far fewer readable strings. Large bundles take a few percent longer to build.

  • 引擎

    With a Pro key, a region set to medium or above in a light build now gets medium's string encoding, keyed to a shared runtime value, and so does the rest of that file. Its strings used to keep light's encoding.

    Directives

  • 插件

    @afterpack/next no longer warns that the build id is pinned when Next.js generated it. About half of default builds got that warning.

  • 云端

    Security scanner: a site no longer gets the "Protected by AfterPack" badge when a script it loads with fetch() or XHR could not be read.

  • 云端

    Protection Maps opened from a cloud build now show coverage and reversal-class labels, like the local report, with no resistance percentage.

0.2.5

CLI renames content-hashed files, safer restore and engine 0.2.6

新增

  • CLI

    On Next.js, Angular, Vite and webpack output, the CLI now renames each content-hashed file to match its obfuscated bytes and rewrites every reference to it, as the plugins do. Other output keeps its names and prints a notice.

    Content-hashed file names

变更

  • CLI

    afterpack restore returns the original tree byte for byte, renames included, and finishes a run that was stopped partway. A new run refuses until an interrupted one is restored.

    Output files are written through a temporary file, so a killed run never leaves a half-written file. Restore refuses a file that was rebuilt since the run and says how to recover.

    A run that stopped partway

  • CLI

    Backups are kept per build directory in .afterpack/backups/, each with a lock, so parallel runs over one directory are refused and separate apps in one repository keep separate backups. A backup in the old .afterpack/backup/ still restores.

    Parallel runs and locks

  • 插件

    @afterpack/angular tells the engine which files are ES modules and which are classic scripts, so a build that mixes them no longer falls back to auto for every file.

    sourceType

  • 引擎

    When @afterpack/wasm runs out of memory, it now fails with DIAG_OUT_OF_MEMORY and says how to fix it, instead of a generic internal-limit error.

  • 云端

    Pro files that need more memory than a regular cloud build has now run on a larger build machine instead of failing.

  • 云端

    Pro builds now run engine 0.2.6.

  • 文档

    Performance lists what the missing-global check costs at each preset.

    Performance

修复

  • 云端

    Absolute local paths that earlier CLI and plugin versions sent with cloud builds are removed from stored diagnostics and Protection Maps.

0.2.4

Hashed names follow obfuscated bytes, no source maps in production and engine 0.2.5

新增

  • 插件

    @afterpack/next warns when a fixed build id keeps _buildManifest.js and _ssgManifest.js on the same cached URL across releases.

  • CLI

    afterpack verify checks a framework's deploy copy of its output, such as SvelteKit's build/, Nuxt's .output/public/ or a Next.js static out/.

  • 引擎

    obfuscate, obfuscateAll and processBatch accept a sourceType for each file, for builds that mix ES modules and classic scripts. @afterpack/angular now says when its whole output is ES modules.

    sourceType

  • 云端

    A Pro build with protectionMap.enabled now prints a link to its Protection Map in the dashboard, or says that none was stored.

    Protection Map

变更

  • 插件

    Precompressed .gz and .br copies now hold the obfuscated code, and Angular's integrity attributes and service-worker hashes are recomputed from it. The Vite and webpack plugins refuse a build that also runs a subresource-integrity plugin, whose hashes would pin the unobfuscated bytes.

  • 引擎

    At medium and above, the integer-expression interpreter runs faster in hot loops, and its code is smaller.

  • 云端

    Pro builds now run engine 0.2.5.

  • 控制台

    Billing activity shows what each payment charged, tax included, and long payment references no longer overflow its details card.

  • 文档

    Builds gains File names and caching, and the CLI and framework pages cover the new naming, source-map, receipt and integrity behavior.

修复

  • 插件

    In the Vite, Rollup, webpack, esbuild, Next.js and Angular plugins, content-hashed file names now follow the obfuscated bytes, so a name never points at different code from one build to the next.

    Obfuscated files used to ship under the plain build's names, so immutable caches and service workers could keep serving the previous file. A fresh seed now renames every obfuscated file, and a constant seed keeps unchanged files cached.

    File names and caching

  • CLI

    Every build is now production unless it says development, and production builds delete the bundler's source maps, CSS maps included. A local npx afterpack dist/ used to leave maps that contained your original source.

    A build is development only with build.mode set to development or NODE_ENV=development. A map that cannot be removed fails the build. The CLI and every plugin behave the same way.

    build.mode

  • CLI

    The protection receipt is now written to .afterpack/receipts/ instead of the build output, so it no longer ships with your site. A leftover .afterpack-protection.json is removed.

    .afterpack/ sits next to the nearest lockfile, afterpack.json or .git above the build directory, so every working directory and plugin finds the same one, and a second run over protected output is refused from anywhere.

    Files

  • CLI

    Cloud builds now name files by their path inside the build directory, never by an absolute path with your home directory or username. Local output is unchanged.

  • CLI

    afterpack audit refuses a local path such as ./dist instead of sending it to the scanner as a URL.

  • 云端

    The cloud no longer stores or logs the absolute local paths that earlier CLI and plugin versions send.

0.2.3

Fail-closed builds, new exit codes and engine 0.2.4

变更

  • 插件

    Update afterpack and your @afterpack/* plugins to 0.2.3 together with the engine. Versions 0.2.2 and earlier fail every file with engine 0.2.4, which a fresh install or a lockfile update can pull in.

    With an older CLI or plugin, each file fails with "the engine result does not say whether the file was obfuscated". Upgrading the CLI and plugins fixes it.

  • 引擎

    In @afterpack/core, a file whose output fails to re-parse now fails with DIAG_OUTPUT_UNPARSEABLE and no code, instead of returning the original source. The unobfuscated result field is removed.

    Diagnostics

  • CLI

    The CLI exits 4 when a regions entry needs a Pro key and 5 when a runtime-reflection pattern is not acknowledged. Both exited 1 before.

    Exit codes

  • 引擎

    An unacknowledged runtime-reflection pattern now fails with DIAG_REFLECTION_NOT_ACKNOWLEDGED, and the message names the reflection.allow value to add. The code used to be the pattern's name.

    reflection.allow

  • 引擎

    At medium and above, 32-bit constants from 0x80000000 to 0xFFFFFFFF, such as hash seeds, are now encoded like other integers instead of appearing as written.

  • 引擎

    At medium and above, more bitwise & and | expressions are transformed, including BigInt ones such as (n >> i) & 1n.

  • 引擎

    At light, encoded strings no longer come out looking like words.

  • 引擎

    The string decoder's setup code now varies from build to build instead of being spelled the same in every output.

  • 云端

    Pro builds now run engine 0.2.4.

  • 文档

    Diagnostics, CLI and Directives cover exit codes 4 and 5, and say when DIAG_INFLATION_BUDGET_HIT fires.

修复

  • 引擎

    Free builds no longer refuse a region that turns on strings.encode when string encoding is already on, as it is at light and above.

    Free builds

  • 引擎

    With identifiers.methods.rename: false, a class method that uses an outer variable with the same name as the method now reads that variable, not the method itself.

    identifiers.methods.rename

移除

  • CLI

    allowUnobfuscated is removed: a file the engine cannot protect always fails the build and never ships as the original source.

    The CLI, the plugins and afterpack.json now reject it as an unknown option, so remove it if you set it. The CLI no longer exits 2.

    Fail closed

0.2.2

Correctness fixes and engine 0.2.3

新增

  • 插件

    The plugins and the CLI tell the engine when your build output is ES modules, from the bundler's output format or, in the CLI, from .mjs files and <script type="module"> in your built HTML. The new sourceType option overrides it.

    sourceType

  • 文档

    A new Semantic contract page lists what obfuscated output keeps the same and the few deliberate differences. Diagnostics, Presets and Directives cover engine 0.2.3 behavior.

变更

  • 引擎

    A build that cannot reach its complexity target because a transform is turned off or a region directive limits it now fails with DIAG_TARGET_NOT_REACHED, naming the file and lines. Before, it shipped weaker output.

  • 引擎

    Pro: transforms.selfIntegrity on a build with no code at medium or above now fails with DIAG_SELF_INTEGRITY_INERT instead of shipping without the check.

  • 引擎

    minify now only renames identifiers and compresses the code. It no longer rewrites syntax.

    Presets

  • 引擎

    Loops are no longer rewritten into callback helpers at minify and light, which removes the 2-5x slowdown those helpers caused in hot loops.

    At light, property and global names still go through encoded constants, which has some cost in very hot code.

  • 引擎

    light output is smaller: about 30% less gzipped on real bundles, most of all on string-heavy files such as translation tables.

  • 引擎

    The engine is smaller: @afterpack/wasm downloads about 17% fewer gzipped bytes.

  • CLI

    The Protection Map shows coverage: each region lists the transforms applied to it and why any code stays readable. It no longer shows a resistance percentage.

    Protection Map

  • 云端

    Pro builds now run engine 0.2.3.

修复

  • 引擎

    Fixed cases where obfuscated code could behave differently from the original, at every preset. Most date back to 0.1, so rebuild with this release.

    Each engine release is now checked against real libraries and multi-script pages before it ships. The items below list the fixes; the new Semantic contract page lists what output keeps the same and the few deliberate differences.

    Semantic contract

  • 引擎

    Classic scripts keep their top-level functions and variables on the global object, so other scripts on the page can still use them, and references to globals declared elsewhere behave as in the original.

  • 引擎

    An ES module with no import or export is no longer read as a classic script when a plugin, the CLI or the sourceType option says the output is ES modules, so its top-level names stay off window.

    With none of those, the engine still tells the kind from the syntax, and a file without import or export is read as a classic script.

  • 引擎

    Values inside template literals are converted to text the way the original does, so objects such as dates format correctly.

  • 引擎

    Functions your code later constructs, through extends, a Proxy, a stored reference or an export, stay constructible.

  • 引擎

    Class fields are defined the way native fields are, so a field over an inherited accessor works, as in custom elements, and a class called without new throws.

  • 引擎

    A function that refers to itself keeps one identity, so an event listener that removes itself is removed.

  • 引擎

    BigInt arithmetic no longer throws or returns wrong values at medium and above, a regression in 0.2.

  • 引擎

    At medium and above, arithmetic converts each object operand once, as the original does, and output no longer breaks when another script changes valueOf or toString on shared objects.

  • 引擎

    Direct eval and with keep their scope: the code around them stays as written, and the build reports it with DIAG_DYNAMIC_SCOPE_NATIVE.

    Diagnostics

  • 引擎

    Classes and constructors keep their original name when your code reads this.constructor.name or new.target.name, so custom error classes report their own name.

    Semantic contract

  • 引擎

    Also fixed: async ordering, a catch (e) block that declares var e, optional calls in parentheses such as (o?.m)(), delete in strict code, nested loops that multiplied output size at medium and above, and constant ** results that could differ from the browser in the last digit.

  • 引擎

    An explicit inflation.max now checks the finished file and fails the build with DIAG_SIZE_CAP_REACHED when output reaches it. String encoding always completes first.

    In earlier versions, a tight inflation.max could stop string encoding early and leave some strings readable, reported only as an Info diagnostic. If you set inflation.max, rebuild with this release.

    inflation.max

  • 引擎

    Free builds no longer refuse a directive that only lowers protection, such as a transform mask or a lower preset. Like other directives on Free, it is ignored.

    Free builds

云端更新

Security scanner

修复

  • 云端

    Security scanner and afterpack audit: scans now read scripts that load late or that redirect the page. A scan that could not read a site's own code, or found none, is now "Not graded" instead of scored.

    Before this fix, such a scan could give a site a perfect score. The README badge now shows the host's latest graded scan.

0.2.1

CSS source maps, Parcel receipts and engine 0.2.2

新增

  • 插件

    Parcel builds now get a protection receipt, so afterpack verify works for them. Add --reporter @afterpack/parcel-optimizer/reporter to your parcel build command.

变更

  • 引擎

    Engine 0.2.2 is a build-only release: its output is the same as 0.2.1. Pro builds run it too.

修复

  • 插件

    @afterpack/next now deletes CSS source maps from .next/static along with the JavaScript ones, and strips the comments that point to them.

    Earlier versions removed only JavaScript maps, so with productionBrowserSourceMaps on, your original stylesheets could be served with the site. The webpack, Rollup and Vite plugins now also drop CSS maps when your build ships no source maps.

    Next.js guide

0.2.0

Per-token presets and engine 0.2.1 (breaking)

变更

  • 引擎

    Presets are recalibrated for per-token protection: medium, hard and extreme now apply their complexity target (7, 12 and 25) to every token, where 0.1 targeted an average across the file.

    Output at these presets is considerably larger than in 0.1, and presets no longer cap output size. If you set complexity yourself, review the value, because it is now a per-token target. light, the default, adds no structural layers: it encodes strings, renames identifiers and rewrites syntax, and its output is about the same size as in 0.1.

    Presets

  • 插件

    The Protection Map now shades each token by how much transformation it received and lists the declarations the engine rewrote, in local reports and in the dashboard.

    Protection Map

  • 插件

    The CLI and plugins now require engine 0.2 or newer and refuse an older one. preset= directives resolve on the new scale.

  • 插件

    The CLI and plugins no longer edit your project's .gitignore, because .afterpack/ now carries its own. In CI, the Protection Map is off by default unless you set protectionMap.enabled.

  • 云端

    Pro builds now run engine 0.2.1, and builds from 0.2 packages get up to 4 minutes in the cloud (was 90 seconds).

    If you use a Pro key, update the CLI or plugin too. A 0.1 package with no preset set, or with preset= directives, sends values on the old scale, so its cloud builds come out heavier than intended.

    Pro

  • 文档

    Docs and package READMEs are updated for 0.2, including the preset scale, the Protection Map, and where each integration runs in your build.

修复

  • 引擎

    Fixed a miscompile in which code inside a rewritten switch, a ?. or ?? expression, or a class with private fields could read the wrong variable.

    It depended on the build seed and on a variable's name, original or renamed, matching one the engine uses internally. Affected code could throw or return wrong values.

  • 引擎

    Functions stored on objects now stay constructible. 0.1 could turn them into arrow functions, which broke feature detection in polyfill libraries such as core-js.

  • 引擎

    obfuscate() and obfuscateAll() in @afterpack/core and @afterpack/wasm now draw a fresh seed for each build when you don't pass one. In 0.1, every build of the same source came out identical. The CLI and plugins were not affected.

    seed

  • 引擎

    Input nested too deeply to process safely now fails with a clear diagnostic instead of crashing @afterpack/wasm. A long-running @afterpack/wasm instance also no longer grows its memory with every file.

    Workers

云端更新

Cloud and dashboard

新增

  • 云端

    A Pro build that fails because of a problem on our side is credited back automatically, and the dashboard shows the file it stopped on.

变更

  • 云端

    Security scanner: scoring now measures how much readable first-party code a site ships.

    Reports list findings for each file, show evidence from exposed source maps, and preview a sample of the site's code protected by AfterPack. A site whose scripts are verified as protected can show a "Protected by AfterPack" badge.

修复

  • 云端

    Pro builds now honor paths.exclude and glob patterns in identifiers.reserved, which the cloud previously ignored.

    paths.exclude

  • 云端

    If the engine cannot produce valid output for a file in a Pro build, that file now fails the build. Before, it came back unprotected.

0.1.0

CLI, framework plugins and engine

新增

  • CLI

    npx afterpack protects a build directory or a single file in place. verify checks a build against its protection receipt before deploy, restore undoes the last run, and audit scans a live site.

    CLI

  • 插件

    Plugins for Vite, Next.js, webpack, Rollup, esbuild, Astro, Svelte, SvelteKit, Vue, Nuxt, Angular, Electron and Parcel.

    Framework guides

  • 引擎

    @afterpack/core runs locally on macOS, Linux (x64 and arm64, glibc and musl) and Windows x64. @afterpack/wasm runs the same engine in Cloudflare Workers and Node.

    Workers

  • 插件

    The Protection Map is a local HTML report that shows what each part of your code went through. It is written to .afterpack/ when your build has source maps.

    Protection Map

  • 文档

    The CLI and plugins are open source under Apache-2.0. The engine is free to use under the AfterPack Engine License.

    License

云端更新

Cloud, dashboard and docs

新增

  • 文档

    The docs are now available in Chinese, Spanish, Hindi and Ukrainian.

    Docs

变更

  • 云端

    Pro builds with an invalid configuration are refused before they start and no longer count toward usage.

  • 控制台

    Billed amounts under 1 MB now show in KB, based on exact byte counts.

云端更新

Cloud, dashboard and Ask AfterPack

变更

  • 控制台

    When you invite someone who already has an account, they are added to the workspace right away.

  • 文档

    Ask AfterPack keeps your conversation across page reloads. It points you to GitHub for bug reports and feature requests, and to email support for account questions.

修复

  • 云端

    Pro builds run an updated engine. Among its fixes: a minified function whose parameter shares the function's name (function e(e){…}) could throw at runtime.

  • 云端

    A file that crashed the engine during a Pro build no longer makes later Pro builds fail.

云端更新

Accounts, dashboard and Pro

新增

  • 控制台

    Accounts and the dashboard: workspaces and projects, team invites, API keys, cloud builds with their Protection Maps, usage and billing.

  • 云端

    AfterPack Pro: builds with a Pro key run in AfterPack's cloud, with per-region directives and Protection Maps kept in the dashboard.

    Pro

  • 文档

    Ask AfterPack, an assistant that answers questions from the docs.