@devcycle/bucketing-assembly-script

中文文档
1.43.1发布于 2026/10/13MITTypeScriptCommonJS构建来源已验证近 30 天下载 43.1万

This package contains the shared logic used by DevCycle products to evaluate a user's information against a set of segmentation filters and determine eligibility for a given feature. It also makes decisions about which variation to serve a user in a multi

原始使用文档
文档目录5 节
  1. Usage
  2. Building WebAssembly
  3. Compile Protobuf Files
  4. Testing
  5. Benchmarking

DevCycle Bucketing - Assembly Script Lib

This package contains the shared logic used by DevCycle products to evaluate a user's information against a set of segmentation filters and determine eligibility for a given feature. It also makes decisions about which variation to serve a user in a multi-variate feature.

This Assembly Script version of the Bucketing library is designed to be used in a cross-platform manner as it builds a WebAssembly output that can be executed in various JavaScript Web / NodeJS environments and other server-side SDK environments. WebAssembly is a binary format that can be executed in a Web browser, NodeJS, or any other environment that supports it.

See the AssemblyScript Documentation for further details: https://www.assemblyscript.org/introduction.html

Usage

Building WebAssembly

yarn nx build shared-bucketing-as

See WebAssembly output in /build folder.

Compile Protobuf Files

When working on the Protobuf types you will need to compile those types into JS and AssemblyScript files. To do this:

yarn nx run shared-bucketing-as:compile-pb

Testing

yarn nx test shared-bucketing-as

Benchmarking

yarn nx run shared-bucketing-as:benchmark

Current benchmark results on M1 Pro Macbook Pro:

Benchmarks:
  variableForUser
    variableForUser                   0.043 ms ±  0.84 %  (81 runs sampled)
    variableForUser_PB                0.020 ms ±  2.56 %  (93 runs sampled)
    variableForUser - large user      0.106 ms ±  0.21 %  (90 runs sampled)
    variableForUser_PB - large user   0.045 ms ±  1.07 %  (95 runs sampled)
    variableForUser - defaulted       0.011 ms ±  0.36 %  (98 runs sampled)
    variableForUser_PB - defaulted    0.008 ms ±  0.65 %  (95 runs sampled)
    variableForUser - unknown key     0.010 ms ±  0.45 %  (95 runs sampled)
    variableForUser_PB - unknown key  0.008 ms ±  1.92 %  (94 runs sampled)
  variableForUser - Large Config
    variableForUser     0.037 ms ±  0.79 %  (79 runs sampled)
    variableForUser_PB  0.017 ms ±  0.48 %  (91 runs sampled)
  generateBucketedConfigForUser
    generateBucketedConfigForUser               0.643 ms ±  0.73 %  (70 runs sampled)
    generateBucketedConfigForUser - large user  0.323 ms ±  0.18 %  (99 runs sampled)
  generateBucketedConfigForUser - Large Config
    generateBucketedConfigForUser               7.37 ms ±  0.79 %  (61 runs sampled)
    generateBucketedConfigForUser - large user  7.36 ms ±  0.36 %  (88 runs sampled)
  initEventQueue
    initEventQueue  0.009 ms ±  40.90 %  (46 runs sampled)
  setPlatformData
    setPlatformData  0.020 ms ±  0.79 %  (82 runs sampled)
  setConfigData
    setConfigData - small   2.15 ms ±  21.54 %  (61 runs sampled)
    setConfigData - large  25.16 ms ±  38.69 %  (42 runs sampled)
  setClientCustomData
    setClientCustomData - small  0.019 ms ±  0.96 %  (87 runs sampled)
Test Suites: 1 passed, 1 total
Tests:       19 passed, 19 total
Snapshots:   0 total
Time:        114.611 s, estimated 115 s

版本与发布记录

@devcycle/bucketing-assembly-script 共发布 171 个版本,首次发布于 2022/04/19;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.43.1latest2026/10/1330 天前
1.43.02026/10/081 个月前
1.42.102026/10/071 个月前
1.42.92026/10/011 个月前
1.42.82026/08/083 个月前
1.42.62026/03/167 个月前

关于 @devcycle/bucketing-assembly-script 的常见问题

@devcycle/bucketing-assembly-script 是什么?

This package contains the shared logic used by DevCycle products to evaluate a user's information against a set of segmentation filters and determine eligibility for a given feature. It also makes decisions about which variation to serve a user in a multi

如何安装 @devcycle/bucketing-assembly-script?

在项目目录运行 npm install @devcycle/bucketing-assembly-script,或使用 pnpm add / yarn add / bun add。

@devcycle/bucketing-assembly-script 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@devcycle/bucketing-assembly-script 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@devcycle/bucketing-assembly-script 可以商用吗?

@devcycle/bucketing-assembly-script 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@devcycle/bucketing-assembly-script 的下载量有多少?

根据 npm 官方下载统计,@devcycle/bucketing-assembly-script 在 2026/10/12 – 2026/11/10 这 30 天内被下载 431,238 次,日均约 14,375 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@devcycle/bucketing-assembly-script 还在维护吗?

最新版本 1.43.1 发布于 2026/10/13(30 天前);至今共发布 171 个版本,其中过去 12 个月发布了 7 个;首次发布于 2022/04/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。