PixiJS 更新 - v8.12.0
PixiJS v8.12.0 已发布,它带来了我们首次“错误狩猎月”的成果。
🌐 PixiJS v8.12.0 is out, and it brings with it the results of our first-ever Bug Hunt Month.
整个七月,我们将注意力完全集中在漏洞上,修复它们,对它们进行分类处理,关闭陈旧的漏洞,并为关键漏洞添加赏金。结果呢?这是我们迄今为止最富有成效的维护月份之一:
🌐 Throughout July, we put our focus entirely on bugs, fixing them, triaging them, closing stale ones, and adding bounties for critical ones. The result? One of our most productive maintenance months to date:
- 修复了45个错误
- 已关闭 250+ 个问题
- 几十个已分级和澄清的问题
- 已分配并支付的若干赏金
衷心感谢在本月帮助报告、调试、测试或修复问题的每一位朋友。我们有几位新的贡献者加入,并对引擎做出了有意义的改进。
🌐 A big thank-you to everyone who helped report, debug, test, or fix problems during the month. We had several new contributors jump in and make meaningful improvements to the engine.
让我们来看一下这个版本中发生了哪些变化。
🌐 Let's take a look at what's changed in this release.
一些有用的补充
🌐 A Few Helpful Additions
虽然这主要是一个修复错误的版本,但我们确实加入了一些有用的新增功能:
🌐 While this was mostly a bug-fix release, we did sneak in a few useful additions:
-
使用
cacheAsTexture时,你现在可以控制scaleModecontainer.cacheAsTexture({
scaleMode: 'nearest',
}); -
我们在
TextureSource上暴露了一个maxAnisotropy属性,以与其他传递的TextureStyle属性保持一致。texture.source.maxAnisotropy = 16; -
新的
DomAdapter.createImage()函数用于创建图片元素。这允许诸如 Node 之类的环境创建像 SVG 这样的东西。const image = DomAdapter.get().createImage();
image.src = 'path/to/image.svg'; -
你现在可以在 PixiJS 和其他渲染引擎之间共享 WebGPU 适配器/设备
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();
const app = new Application();
await app.init({ gpu: { adapter, device } }); -
资源
loadParser已被弃用,并被parser替代,解析器的名称也已被弃用并简化// Old way
await Assets.load({ src: 'path/to/asset', data: { loadParser: 'loadJson' } });
// New way
await Assets.load({ src: 'path/to/asset', data: { parser: 'json' } });
// Name changes
// 'loadJson' -> 'json'
// 'loadSvg' -> 'svg'
// 'loadTxt' -> 'text'
// 'loadVideo' -> 'video'
// 'loadWebFont' -> 'web-font'
// 'loadBitmapFont' -> 'bitmap-font'
// 'spritesheetLoader' -> 'spritesheet'
// 'loadTextures' -> 'texture'
// 'loadBasis' -> 'basis'
// 'loadDds' -> 'dds'
// 'loadKtx2' -> 'ktx2'
// 'loadKtx' -> 'ktx' -
一个新的
WorkerManager.reset()方法有助于释放内存并重置工作池,对于需要清理旧工作线程的长期运行应用非常有用。app.destroy(true, true); // Destroy the app
WorkerManager.reset(); // Reset the worker pool
超过35个错误修复
🌐 Over 35 Bug Fixes
此版本包含针对各个字段的定向修复:
🌐 This release includes targeted fixes across a wide range of areas:
- 遮罩现在在视口外也能正确显示
AnimatedSprite.destroy()现在行为正常- HTML文本标签和样式的处理更可靠
- Pattern 和 gradient 填充在已安装的
BitmapText中按预期呈现 BitmapFont获得了多个布局和渲染修复- 几个与遮罩、变换原点和剔除相关的问题已解决
- 已解决可访问性和缩放问题
如果你对详细信息感兴趣,可以在 GitHub 查看完整的更新日志。
🌐 You can view the full changelog on GitHub if you're interested in the details.
内部工具和开发体验
🌐 Internal Tools and Dev Experience
除了修复和功能之外,我们还进行了一些内部改进:
🌐 Beyond the fixes and features, we also made a number of internal improvements:
- 添加了 StackBlitz 集成,使共享和测试更加方便。你可以在这里查看:StackBlitz 示例
- 改进了我们的 GitHub 问题模板和关于复现步骤的自动化。我们现在要求新问题必须提供复现步骤,以帮助我们更有效地处理它们。如果没有提供复现步骤,问题将在 7 天后自动关闭。
- 更新了 Node 兼容性,以在构建项目时支持 Node 24。
这些更改不会面向用户,但它们应该会让贡献和调试的体验更加顺畅。
🌐 These changes aren't user-facing, but they should make contributing and debugging a smoother experience.
漏洞赏金计划
🌐 Bug Bounty Program
作为漏洞猎月的一部分,我们正式推出了我们的漏洞赏金计划。如果你是贡献者,这意味着修复某些问题可能会获得小额奖励,尤其是那些难以重现或对用户至关重要的漏洞。
🌐 As part of Bug Hunt Month, we officially launched our bug bounty program. If you're a contributor, this means some issues may come with a small reward for fixing them, especially bugs that are tough to reproduce or critical to users.
如果你想为 PixiJS 做出贡献,这是一个很好的起点。你可以在这里找到所有当前带有赏金标签的问题。
🌐 If you're looking to contribute to PixiJS, this is a great way to get started. You can find all current bounty-tagged issues here.
我们为什么要这样做
🌐 Why We're Doing This
我们相信开源和社区协作的力量。我们的漏洞赏金计划旨在:
🌐 We believe in the power of open source and community collaboration. Our bug bounty program is designed to:
- 鼓励贡献者处理重要且有影响力的问题。
- 认可在调试和修复复杂问题中所付出的辛勤努力。
- 请理解 PixiJS 核心团队规模较小,且经常专注于其他关键任务,你的贡献有助于更快地解决问题。
- 让 PixiJS 对每个人都更好。
赞助赏金
🌐 Sponsoring Bounties
如果你是开发者或公司,正在进行某个项目并希望赞助一次性赏金,请联系 Matt Karl @bigtimebuddy 或发送邮件至 hello@mattkarl.com 商议具体事宜。
🌐 If you are a developer or company working on a project and would like to sponsor a one-off bounty, please contact Matt Karl @bigtimebuddy at hello@mattkarl.com to arrange the details.
赞助商可以直接向我们的 Open Collective 进行一次性捐款来资助赏金。
🌐 Sponsors can make one-time donations directly to our Open Collective to fund the bounty.
PixiJS 布局 v3.1.0
🌐 PixiJS Layout v3.1.0
除了主要引擎更新之外,我们还发布了 PixiJS Layout 的新版本。
🌐 Alongside the main engine update, we also shipped a new version of PixiJS Layout.
此更新包含一些关键的生活质量改进:
🌐 This update includes a few key quality-of-life improvements:
-
你现在可以定义自定义的默认 Yoga 配置
const config = getYoga().Config.create();
config.setExperimentalFeatureEnabled(ExperimentalFeature.WebFlexBasis, true);
setYogaConfig(config); -
新的选项使拖动缓动更加可控
const container = new LayoutContainer({
layout: {
overflow: 'scroll',
},
trackpad: {
// Constrain scrolling within bounds
constrain: true,
// Percentage of overflow allowed when dragging beyond x-axis limit
xConstrainPercent: 0.2,
// Percentage of overflow allowed when dragging beyond y-axis limit
yConstrainPercent: 0.2
},
});
我们还修复了与布局更新、重新设置父级、可见性和容器大小相关的几个错误。这些修复使布局行为更加可预测,并且更符合开发者对 Flexbox 风格布局的预期。
🌐 We also fixed several bugs related to layout updates, reparenting, visibility, and container sizing. These fixes make layout behavior more predictable and align better with how developers expect Flexbox-style layouts to behave.
我们也改进了 StackBlitz 集成以及这里的错误报告流程。
🌐 We've also improved StackBlitz integration and our bug reporting flow here as well.
文档可在 layout.pixijs.io 获取
🌐 Documentation is available at layout.pixijs.io
安装方式:
🌐 Install with:
npm install @pixi/layout@3.1.0
获取最新的 PixiJS
🌐 Get the Latest PixiJS
通过 npm 安装:
🌐 Install via npm:
npm install pixi.js@8.12.0
或者通过 CDN 使用:
🌐 Or use via CDN:
开发版本:
- https://cdn.jsdelivr.net/npm/pixi.js@8.12.0/dist/pixi.js
- https://cdn.jsdelivr.net/npm/pixi.js@8.12.0/dist/pixi.mjs
生产构建:
- https://cdn.jsdelivr.net/npm/pixi.js@8.12.0/dist/pixi.min.js
- https://cdn.jsdelivr.net/npm/pixi.js@8.12.0/dist/pixi.min.mjs
文档: https://pixijs.download/v8.12.0/docs/index.html
结论
🌐 Conclusion
这就总结了我们的七月更新。如果你有兴趣参与,我们一直在寻找帮助处理未解决的问题,无论是否标有悬赏标签。
🌐 That wraps up our July update. If you're interested in contributing, we're always looking for help on open issues, bounty-tagged or otherwise.
再次感谢所有让错误狩猎月取得成功的人。我们很期待看到你们接下来会创造什么!
🌐 Thanks again to everyone who made Bug Hunt Month a success. We're excited to see what you build next!
创作愉快!
🌐 Happy creating!
PixiJS 团队
