MCPcopy
hub / github.com/alibaba-fusion/next

github.com/alibaba-fusion/next @1.27.34 sqlite

repository ↗ · DeepWiki ↗ · release 1.27.34 ↗
5,188 symbols 12,869 edges 1,514 files 139 documented · 3%
README

English | 简体中文

Fusion

一套企业级中后台UI的解决方案,致力于解决设计师与前端在工作协同、产品体验一致性、开发效率方面的问题


你可以通过一站式协作平台灵活地定制自己的 DesignSystem,生成设计物料与代码分片到设计师的工具端 FusionCool 及开发者的工具端 Iceworks,同时保证代码和视觉稿之间的一致性

howtouse

🤔 为什么用

@alifd/next 配合 Fusion Design 解决在页面开发时设计师和前端协同的问题。通过这套体系设计师可以自由的定制组件的 UI 并产出一个 npm 主题包,前端可以直接使用这个主题包不需要关注组件的还原度问题。省去了和设计师反复的去做还原度 Review 的工作量,大幅度的提高了开发效率。

💻 浏览器支持

Chrome Firefox Edge IE Safari Opera UC
9+ ✔

🚀 快速开始

🛠 安装

1.使用 npm 安装(推荐)

npm install @alifd/next --save

2.浏览器直接引用

在浏览器中使用 script 和 link 标签直接引入文件,并使用全局变量 Next。我们在 npm 包中提供了 @alifd/next/dist 目录下的 next.js/next.min.js 和 next.css/next.min.css 等文件,也可以通过 unpkg 进行下载。

<link rel="stylesheet" href="https://unpkg.com/@alifd/next/dist/next.css" />

<script src="https://unpkg.com/@alifd/next/dist/next.js"></script>

// 以上引入都是引入的最新版本 @alifd/next
,但我们推荐引入固定版本的next组件,以保证代码稳定
<script src="https://unpkg.com/@alifd/next@1.8.6/dist/next.min.js"></script>

// 或作为自己的静态资源引入
<script src="https://github.com/alibaba-fusion/next/raw/1.27.34/build/public/@alifd/next.js"></script>

☔️ 依赖

  • @alifd/next 基于 react@16 开发,目前并不兼容 react@16 以下的版本,且将 react/react-dom 作为 peerDependencies,需要用户手动提前安装或引入。
  • @alifd/next 在处理日期时间相关组件逻辑时,使用了 moment 库,且将 moment 作为 peerDependencies,需要用户手动提前安装或引入。

🎯 引入

全量引入

// 全量引入压缩后的next基础样式
import '@alifd/next/dist/next.min.css';

import { Button, Input } from '@alifd/next';
  • 优点:使用简单, 样式无需编译直接使用
  • 缺点:当前页面未使用的组件也会被打包

Note: 如果引入 scss 版本的样式,import '@alifd/next/index.scss';,在 webpack 打包时请使用fast-sass-loader,否则编译出来的样式文件可能会很大。 原因是@alifd/next内部,组件之间存在依赖关系,例如 Icon 组件被 Menu 组件依赖。对于 webpack 来讲,在分析依赖阶段,Menu 的 index.scss 和 Icon 的 index.scss 是两个不同的模块,两个文件会独立的在 sass-loader 阶段编译。因此 Icon 的 sass 会被重复编译。使用fast-sass-loader可以避免样式重复打包的问题。

按需引入

1.手动引入

import Button from '@alifd/next/lib/button';
import '@alifd/next/lib/button/style';
  • 优点:按需引入 js 代码、样式代码,不会加载不必要的组件
  • 缺点:使用起来过于繁琐,需要手动添加每一个用到的组件 js 代码及样式

2.使用 babel-plugin-import (推荐)

通过 babel-plugin-import 插件,可以将下面的代码

import { Button } from '@alifd/next';

转化为类似下面的代码:

import Button from '@alifd/next/lib/button';
import '@alifd/next/lib/button/style';

babel 配置:

// webpack babel loader option or .babelrc
{
    // ...
    plugins: [
        [
            'import',
            {
                libraryName: '@alifd/next',
                style: true,
            },
        ],
    ];
}

🔗 高级用法

🌈 贡献代码

推荐在线编辑:使用 Gitpod, 一个源自 GitHub 的免费在线代码编辑工具:

Open in Gitpod

具体步骤可参考: - 贡献代码

📣 加入社区

扫码钉钉群 加入即刻交流与反馈:

Join the chat at dingtalk

Extension points exported contracts — how you extend this code

ConfiguredComponent (Interface)
(no doc) [2 implementers]
components/config-provider/types.ts
TSDocPropertyParamMeta (Interface)
(no doc)
tools/api.ts
Task (Interface)
(no doc)
tools/utils/task.ts
Window (Interface)
(no doc)
tools/serve/demo.tsx
ProgressProps (Interface)
(no doc)
components/progress/types.ts
DateInputProps (Interface)
(no doc)
components/time-picker2/types.ts
DemoItem (Interface)
(no doc)
components/demo-helper/index.tsx
NotificationConfig (Interface)
(no doc)
components/notification/types.ts

Core symbols most depended-on inside this repo

get
called by 3936
components/config-provider/cache.ts
deprecated
called by 107
components/util/log.ts
getValue
called by 95
components/rating/rating.tsx
clear
called by 93
components/config-provider/cache.ts
add
called by 87
components/config-provider/cache.ts
rerender
called by 75
cypress/support/component.ts
validate
called by 72
components/field/index.ts
focus
called by 60
components/input/base.tsx

Shape

Method 2,043
Function 1,429
Class 1,203
Interface 512
Enum 1

Languages

TypeScript100%

Modules by API surface

components/tree/__tests__/index-spec.tsx56 symbols
components/tree/view/tree.tsx51 symbols
components/config-provider/__tests__/index-spec.tsx44 symbols
components/cascader/cascader.tsx38 symbols
components/cascader-select/cascader-select.tsx38 symbols
components/tree-select/tree-select.tsx36 symbols
components/overlay/overlay.tsx36 symbols
components/tree/view/tree-node.tsx35 symbols
components/select/select.tsx35 symbols
components/select/base.tsx34 symbols
components/demo-helper/index.tsx34 symbols
components/table/lock.jsx33 symbols

Dependencies from manifests, versioned

@alifd/adaptor-generate0.2.3 · 1×
@alifd/adaptor-helper0.1.3 · 1×
@alifd/api-extractor3.7.1 · 1×
@alifd/babel-preset-next2.0.0 · 1×
@alifd/doc-parser2.0.0 · 1×
@alifd/dts-generator1.0.3 · 1×
@alifd/eslint-config-next2.0.0 · 1×
@alifd/field2.0.4 · 1×
@alifd/meet-react2.9.8 · 1×
@alifd/overlay0.3.7 · 1×
@alifd/sass-mapper3.0.1 · 1×
@alifd/sass-tracker0.1.0 · 1×

For agents

$ claude mcp add next \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact