npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@proteus-vue/compiler-backend

v0.1.0

Published

G-29 编译器可插拔后端:CompilerIR 契约 + conformance(CMP002/CMP004 + G-31.1 语义链接)+ NodeBackend 参考实现(真实模板编译 → C-IR 语义树)——编译、逻辑、UI、能力四维可插拔(原则 #10 终极形态)

Readme

@proteus-vue/compiler-backend

G-29 编译器可插拔后端docs/proteus-compiler-backend-1-plan/)· B1

一句话

编译器从"固定 Node 工具链"升级为"可插拔后端"——Node / Rust(SWC-ecosystem) / WASM 三端后端对同一份 SFC 产出语义等价的 CompilerIR,业务零感知一个 flag 切换。与 G-27 ProteusRenderBackend、G-28 ProteusNativeBackend 同构(语义契约 + 后端实现 + conformance)。

内容

| 模块 | 说明 | |------|------| | spi.ts | ProteusCompilerBackend 接口 + CompilerIR 契约(version/render/semantic/bindings)+ CompilerCapabilities(对齐 plan 02-compiler-backend-spi.md) | | conformance.ts | runCompilerConformance(backend) 自检——CMP004 版本协商 + CMP002 IR 合规(render/semantic 计数交叉核对)+ ★G-31.1 语义链接(p-* 标签 → TAG_SEMANTIC_MAP) | | node.ts | NodeBackend 参考实现:真实模板编译(@vue/compiler-sfc + @vue/compiler-dom)→ CompilerIR,semantic = toComponentIR 产物——「源码 → C-IR」生产端雏形 |

用法

import { createNodeCompilerBackend, runCompilerConformance } from '@proteus-vue/compiler-backend'

const backend = createNodeCompilerBackend()
const result = runCompilerConformance(backend) // { ok: true, checks: [...] } —— CMP002/CMP004

const ir = backend.compile({ filename: 'grid.vue', source: `<template><p-grid :min-col-width="160" :max-cols="4"><p-box /></p-grid></template>` })
ir.semantic.tree    // { tag: 'p-grid', semantic: 'layout.grid', props: { minColWidth: { expr: '160' }, maxCols: { expr: '4' } }, children: [...] }
ir.render.root      // 渲染树(含 semantic 字段——G-27 nodeOps 消费)
ir.bindings         // capability 入口 + v-model + 事件(G-28 消费)

与 G-31 衔接

CompilerIR.semantic = C-IR 树(toComponentIR 产物)——真实模板编译接语义层: Renderer 树兼含语义组件(Layer 0)与兼容层标签(Layer 1);语义计数交叉核对(render semantic 节点数 == semanticCount == C-IR 树节点数)保证两棵树同源不漂移。

严格规则

  • G-29.1:三端 Backend 对同一份 SFC 必须产出语义等价的 CompilerIR(IR Golden Test 强制)
  • G-29.2:新 Compiler Backend 必须通过 conformance test
  • G-29.3:HMR 语义三端一致
  • CMP001-004:依赖私有 API / IR 不合规 / HMR 不一致 / 版本不兼容

路线

B1 CompilerIR 契约 + NodeBackend ✅ → B2 RustBackend(SWC-ecosystem)→ B3 WASM Backend(Playground)→ B4 HMR 三端一致 + Source Map + Tree-shaking