@guardian/source-react-components-development-kitchen

中文文档
21.0.0发布于 2024/05/16TypeScriptESM + CJS零依赖近 30 天下载 6390

npm

此软件包已被标记为弃用

Use @guardian/source-development-kitchen instead

原始使用文档
文档目录6 节
  1. Install
  2. Example
  3. Ownership
  4. Evolution
  5. Motivation
  6. Publishing

@guardian/source-react-components-development-kitchen

npm

The Development Kitchen is where new components and patterns can be cooked up, tested and shared. There are minimal acceptance criteria. It’s okay to duplicate and break things. If a Kitchen component proves valuable, it may be promoted to @guardian/source-react-components.

This package is part of the Source design system.

Install

$ yarn add @guardian/source-react-components-development-kitchen

or

$ npm install @guardian/source-react-components-development-kitchen

Example

import { Lines } from '@guardian/source-react-components-development-kitchen';

const Section = () => (
    <>
        <Lines count={8} />
        <Lines effect="squiggly" />
    </>
);

Ownership

Kitchen components are unsupported by CSTI. They are owned by the team or teams consuming them.

Owners are defined in CODEOWNERS.

If you wish to start consuming a Kitchen component, add your team as CODEOWNERS. This ensures you are notified of changes to the component.

Evolution

Changes to Kitchen components are to be expected. Components in the Kitchen should be considered experimental and likely to change in ways that break things.

Components that prove valuable may be promoted to @guardian/source-react-components. In order to achieve this, the component must meet Source’s acceptance criteria. The best way to meet these is for developers to work in close collaboration with design and UX when building and evolving a component. Components should express some pattern, rule or aspect of design that is governed by Source.

Motivation

Source is a library where teams can expect to find high quality shared components. Adding new components to Source requires deep work and collaboration across disciplines – design, UX and engineering. It takes a long time and substantial effort for components to land in Source.

Potential contributors are put off contributing directly to Source, as they find it hard to balance the time investment against their team's priorities. The cost of this is two-fold:

  • The number of high quality components available in Source is lower than it could be.
  • Potentially shareable components are built directly into applications, leading to fragmentation, inconsistency and duplication.

We believe there is value in moving quickly, experimenting with new ideas and sharing those ideas for wider input. The Development Kitchen helps teams achieve this by lowering the barrier to entry. It allows teams to get fast feedback on new components, both from users and from other developers.

By providing an agile mechanism for iterating and improving, components can be brought up to the level of quality expected of Source, and everyone can benefit from the work put into them.

Publishing

The Development Kitchen is published as its own package, independent of the stable components in the @guardian/source-react-components. This:

  • Allows the Kitchen to move fast.
  • Allows us to make frequent breaking changes to the Kitchen whilst preserving semver. The stable library changes at a slower pace, in order to set expectations and preserve developer confidence.

版本与发布记录

@guardian/source-react-components-development-kitchen 共发布 108 个版本,首次发布于 2021/09/17;过去 12 个月发布了 0 个版本。

版本发布日期距今
21.0.0latest2024/05/162 年前
21.0.0-canary-20240513154404canary2024/05/132 年前
20.0.32024/05/082 年前
0.0.0-canary-202405071603322024/05/082 年前
0.0.0-canary-202405071559112024/05/082 年前
20.0.22024/05/072 年前

其他发布通道:next → 0.0.25-rc.2,canary → 21.0.0-canary-20240513154404。

关于 @guardian/source-react-components-development-kitchen 的常见问题

如何安装 @guardian/source-react-components-development-kitchen?

在项目目录运行 npm install @guardian/source-react-components-development-kitchen,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0)、tslib(^2.6.2)、@emotion/react(^11.11.1)、@guardian/libs(^16.0.0)、@guardian/source-foundations(^16.0.0)、@guardian/source-react-components(^25.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@guardian/source-react-components-development-kitchen 支持 TypeScript 吗?

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

@guardian/source-react-components-development-kitchen 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@guardian/source-react-components-development-kitchen 可以商用吗?

@guardian/source-react-components-development-kitchen 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@guardian/source-react-components-development-kitchen 的下载量有多少?

根据 npm 官方下载统计,@guardian/source-react-components-development-kitchen 在 2026/10/17 – 2026/11/15 这 30 天内被下载 6,390 次,日均约 213 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@guardian/source-react-components-development-kitchen 还在维护吗?

最新版本 21.0.0 发布于 2024/05/16(2 年前);至今共发布 108 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/09/17。作者已将其标记为弃用,新项目建议寻找替代方案。