(Go: >> BACK << -|- >> HOME <<)

Skip to content

Commit

Permalink
docs: performance enhance (#43705)
Browse files Browse the repository at this point in the history
* docs: performance enhance

* chore: update snapshot
  • Loading branch information
MadCcc committed Jul 21, 2023
1 parent ab8e10d commit cbf2703
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 14 deletions.
16 changes: 15 additions & 1 deletion .dumi/theme/slots/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ const Footer: React.FC = () => {
icon: (
<img
src="https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg"
width={16}
height={16}
alt="yuque"
/>
),
Expand All @@ -222,6 +224,8 @@ const Footer: React.FC = () => {
icon: (
<img
src="https://gw.alipayobjects.com/zos/rmsportal/mZBWtboYbnMkTBaRIuWQ.png"
width={16}
height={16}
alt="seeconf"
/>
),
Expand Down Expand Up @@ -303,6 +307,8 @@ const Footer: React.FC = () => {
icon: (
<img
src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg"
width={22}
height={22}
alt="Ant XTech"
/>
),
Expand All @@ -312,6 +318,8 @@ const Footer: React.FC = () => {
icon: (
<img
src="https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg"
width={16}
height={16}
alt="yuque"
/>
),
Expand All @@ -324,6 +332,8 @@ const Footer: React.FC = () => {
icon: (
<img
src="https://gw.alipayobjects.com/zos/antfincdn/nc7Fc0XBg5/8a6844f5-a6ed-4630-9177-4fa5d0b7dd47.png"
width={16}
height={16}
alt="AntV"
/>
),
Expand All @@ -333,7 +343,7 @@ const Footer: React.FC = () => {
openExternal: true,
},
{
icon: <img src="https://www.eggjs.org/logo.svg" alt="Egg" />,
icon: <img src="https://www.eggjs.org/logo.svg" alt="Egg" width={16} height={16} />,
title: 'Egg',
url: 'https://eggjs.org',
description: <FormattedMessage id="app.footer.egg.slogan" />,
Expand All @@ -343,6 +353,8 @@ const Footer: React.FC = () => {
icon: (
<img
src="https://gw.alipayobjects.com/zos/rmsportal/DMDOlAUhmktLyEODCMBR.ico"
width={16}
height={16}
alt="kitchen"
/>
),
Expand All @@ -355,6 +367,8 @@ const Footer: React.FC = () => {
icon: (
<img
src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg"
width={16}
height={16}
alt="xtech"
/>
),
Expand Down
7 changes: 6 additions & 1 deletion .dumi/theme/slots/Header/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ const Logo: React.FC<LogoProps> = ({ isZhCN }) => {
return (
<h1>
<Link to={utils.getLocalizedPathname('/', isZhCN, search)} className={styles.logo}>
<img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" alt="logo" />
<img
src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
height={32}
width={32}
alt="logo"
/>
<span className={styles.title}>Ant Design</span>
</Link>
</h1>
Expand Down
58 changes: 58 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,64 @@ export default defineConfig({
analytics: {
ga_v2: 'UA-72788897-1',
},
links: [
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/t/webfont_6e11e43nfj.woff2',
type: 'font/woff2',
crossorigin: true,
},
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/t/webfont_6e11e43nfj.woff',
type: 'font/woff',
crossorigin: true,
},
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/t/webfont_6e11e43nfj.ttf',
type: 'font/ttf',
crossorigin: true,
},
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/t/webfont_exesdog9toj.woff2',
type: 'font/woff2',
crossorigin: true,
},
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/t/webfont_exesdog9toj.woff',
type: 'font/woff',
crossorigin: true,
},
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/t/webfont_exesdog9toj.ttf',
type: 'font/ttf',
crossorigin: true,
},
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/wf/webfont/exMpJIukiCms/Gsw2PSKrftc1yNWMNlXgw.woff2',
type: 'font/woff2',
crossorigin: true,
},
{
rel: 'preload',
as: 'font',
href: '//at.alicdn.com/wf/webfont/exMpJIukiCms/vtu73by4O2gEBcvBuLgeu.woff',
type: 'font/woff2',
crossorigin: true,
},
],
headScripts: [
`
(function () {
Expand Down
2 changes: 1 addition & 1 deletion components/button/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ It accepts all props which native buttons support.

Following the Ant Design specification, we will add one space between if Button (exclude Text button and Link button) contains two Chinese characters only. If you don't need that, you can use [ConfigProvider](/components/config-provider/#api) to set `autoInsertSpaceInButton` as `false`.

<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" style="box-shadow: none; margin: 0; width: 100px" alt="Button with two Chinese characters" />
<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" width="100px" height="64px" style="box-shadow: none; margin: 0;" alt="Button with two Chinese characters" />

<style>
.site-button-ghost-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion components/button/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ group:

根据 Ant Design 设计规范要求,我们会在按钮内(文本按钮和链接按钮除外)只有两个汉字时自动添加空格,如果你不需要这个特性,可以设置 [ConfigProvider](/components/config-provider-cn#api)`autoInsertSpaceInButton``false`

<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" style="box-shadow: none; margin: 0; width: 100px" alt="移除两个汉字之间的空格" />
<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" style="box-shadow: none; margin: 0" width="100px" height="64px" alt="移除两个汉字之间的空格" />

<style>
.site-button-ghost-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ exports[`renders components/tabs/demo/card.tsx extend context correctly 1`] = `

exports[`renders components/tabs/demo/card-top.tsx extend context correctly 1`] = `
<div
class="css-1g7foe3"
class="acss-1g7foe3"
>
<div
class="ant-tabs ant-tabs-top ant-tabs-card"
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ exports[`renders components/tabs/demo/card.tsx correctly 1`] = `

exports[`renders components/tabs/demo/card-top.tsx correctly 1`] = `
<div
class="css-1g7foe3"
class="acss-1g7foe3"
>
<div
class="ant-tabs ant-tabs-top ant-tabs-card"
Expand Down
13 changes: 6 additions & 7 deletions components/tabs/demo/card-top.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import { Tabs, theme } from 'antd';
import { css } from '@emotion/css';
import { Tabs } from 'antd';
import { createStyles } from 'antd-style';

const useStyle = () => {
const { token } = theme.useToken();
const useStyle = createStyles(({ token, css }) => {
const antdTabsCls = '.ant-tabs';

return css`
Expand Down Expand Up @@ -32,7 +31,7 @@ const useStyle = () => {
}
}
`;
};
});

const items = new Array(3).fill(null).map((_, i) => {
const id = String(i + 1);
Expand All @@ -50,10 +49,10 @@ const items = new Array(3).fill(null).map((_, i) => {
});

const App = () => {
const style = useStyle();
const { styles } = useStyle();

return (
<div className={style}>
<div className={styles}>
<Tabs type="card" items={items} />
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/imageTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function imageTest(component: React.ReactElement) {
page.on('request', onRequestHandle);
await page.goto(`file://${process.cwd()}/tests/index.html`);
await page.addStyleTag({ path: `${process.cwd()}/dist/reset.css` });
await page.addStyleTag({content: '*{animation: none!important;}'})
await page.addStyleTag({ content: '*{animation: none!important;}' });

const cache = createCache();

Expand Down

0 comments on commit cbf2703

Please sign in to comment.