Skip to content

Commit 0176528

Browse files
authored
Merge branch 'main' into doc/release-upgrade
2 parents 26b5055 + 87a348e commit 0176528

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+293
-191
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,30 @@ jobs:
4242
run: make test
4343
continue-on-error: ${{ matrix.experimental }}
4444

45-
# linkcheck:
46-
# name: Build site and check links
47-
# runs-on: ubuntu-latest
48-
# if: ${{ github.ref != 'refs/heads/main' }}
49-
# steps:
50-
# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
51-
# with:
52-
# submodules: recursive
53-
# - name: Build site and check links
54-
# run: make build BUILD_CONFIGS=_config.yml,_config_stage.yml
55-
# - name: Install Node for Firebase install
56-
# uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
57-
# with:
58-
# node-version: ${{ env.NODE_VERSION }}
59-
# - name: Install Firebase CLI
60-
# run: npm install -g [email protected]
61-
# - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
62-
# with:
63-
# sdk: stable
64-
# - run: tool/check-links.sh
45+
linkcheck:
46+
name: Build site and check links
47+
runs-on: ubuntu-latest
48+
if: ${{ github.ref != 'refs/heads/main' }}
49+
steps:
50+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
51+
with:
52+
submodules: recursive
53+
- name: Build site and check links
54+
run: make build BUILD_CONFIGS=_config.yml,_config_stage.yml
55+
# - name: Install Node for Firebase install
56+
# uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
57+
# with:
58+
# node-version: ${{ env.NODE_VERSION }}
59+
# - name: Install Firebase CLI
60+
# run: npm install -g [email protected]
61+
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
62+
with:
63+
sdk: stable
64+
- run: tool/check-links.sh
6565

6666
deploy:
6767
name: Deploy to production
68-
needs: test
68+
needs: [test, linkcheck]
6969
runs-on: ubuntu-latest
7070
if: |
7171
github.event_name == 'push'
@@ -82,12 +82,13 @@ jobs:
8282
# with:
8383
# node-version: ${{ env.NODE_VERSION }}
8484
# - name: Install Firebase CLI
85-
# run: npm install -g [email protected]
85+
# run: npm install -g [email protected]
86+
# - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
87+
# with:
88+
# sdk: stable
89+
# - run: tool/check-links.sh
8690
# - name: Deploy to Firebase hosting
87-
# run: make deploy
88-
# env:
89-
# FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
90-
# FIREBASE_ALIAS: default
91+
# run: make deploy # TODO(drewroengoogle) Run deploy on Cloud Build.
9192
- name: Deploy CN
9293
run: make deploy
9394
env:

.github/workflows/link-check.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/no-response.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/stage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check links and stage
1+
name: Stage site on Firebase
22

33
on:
44
pull_request:
@@ -20,9 +20,9 @@ jobs:
2020
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
2121
with:
2222
submodules: recursive
23-
- name: Build site and check links
23+
- name: Build site
2424
run: make stage-local
25-
- name: Stage site on Firebase
25+
- name: Stage
2626
if: ${{
2727
github.repository == 'cfug/flutter.cn' &&
2828
github.event.pull_request.user.login != 'dependabot[bot]' }}

Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ RUN mkdir -p /etc/apt/keyrings \
6868
&& apt-get install nodejs -yq \
6969
&& npm install -g npm # Ensure latest npm
7070

71-
# Install global Firebase CLI
72-
# RUN npm install -g [email protected]
7371

7472
# ============== FLUTTER CODE TESTS ==============
7573
FROM flutter AS tests
@@ -136,7 +134,3 @@ ENV BUILD_CONFIGS=$BUILD_CONFIGS
136134
# RUN bundle exec jekyll build --config $BUILD_CONFIGS
137135

138136
RUN tool/move_docs.sh; tool/translator/build.sh
139-
140-
FROM build AS checklinks
141-
142-
CMD ["tool/check-links.sh"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ serve:
7979

8080
# Test hosting locally with FB emulator
8181
emulate:
82-
make clean
82+
firebase emulators:start --only hosting --project ${FIREBASE_ALIAS}
8383

8484

8585
# =================== Build / Test / Deploy Commands ==================

src/_includes/docs/run-profile.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
Do _not_ test the performance of your app with debug and
88
hot reload enabled.
9-
9+
1010
**请勿** 在调试模式和热重载功能开启的情况下做性能测试。
11-
11+
1212
{{site.alert.end}}
1313

1414
So far you've been running your app in *debug* mode. Debug
@@ -27,12 +27,12 @@ build modes. For more details, see [Flutter's build modes][].
2727
[Flutter 的构建模式选择]({{site.url}}/testing/build-modes)
2828

2929
{{site.alert.important}}
30-
30+
3131
If you're concerned about the package size of your app,
3232
see [Measuring your app's size][].
33-
33+
3434
如果你关心应用大小,请参考 [这篇文档][Measuring your app's size]
35-
35+
3636
{{site.alert.end}}
3737

3838
[Flutter's build modes]: {{site.url}}/testing/build-modes

src/add-to-app/android/add-flutter-screen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ is discussed next.
282282
那么你的 Flutter 应用会像是运行在一个大小为零的窗口中,
283283
直至 `FlutterEngine` 附属到一个 `FlutterActivity``FlutterFragment``FlutterView`
284284
请确保你的应用在开始预热到你展示 Flutter 内容中间的这段时间里表现正常。
285-
285+
286286
{{site.alert.end}}
287287

288288
With a pre-warmed, cached `FlutterEngine`, you now need

src/add-to-app/ios/add-flutter-screen.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ To launch a Flutter screen from an existing iOS, you start a
3333
`FlutterEngine` 充当 Dart VM 和 Flutter 运行时的主机;
3434
`FlutterViewController` 依附于 `FlutterEngine`
3535
给 Flutter 传递 UIKit 的输入事件,并展示被 `FlutterEngine` 渲染的每一帧画面。
36+
3637
{{site.alert.end}}
3738

3839
The `FlutterEngine` might have the same lifespan as your
@@ -59,13 +60,14 @@ The `FlutterEngine` might have the same lifespan as your
5960
logic before showing the UI.
6061

6162
在展示 UI 前,你的应用和 plugins 可以与 Flutter 和 Dart 逻辑交互。
63+
6264
{{site.alert.end}}
6365

6466
See [Loading sequence and performance][]
6567
for more analysis on the latency and memory
6668
trade-offs of pre-warming an engine.
6769

68-
[加载顺序和性能]({{site.url}}/development/add-to-app/performance)
70+
[加载顺序和性能][Loading sequence and performance]
6971
里有更多关于预热 engine 的延迟和内存取舍的分析。
7072

7173
### Create a FlutterEngine
@@ -339,6 +341,7 @@ Now, you have a Flutter screen embedded in your iOS app.
339341
340342
在上一个例子中,你的默认 Dart 库的默认入口函数 `main()`,
341343
将会在 `AppDelegate` 创建 `FlutterEngine` 并调用 `run` 方法时调用。
344+
342345
{{site.alert.end}}
343346
344347
### _Alternatively_ - Create a FlutterViewController with an implicit FlutterEngine
@@ -792,6 +795,7 @@ a different Dart function.
792795
@pragma('vm:entry-point')
793796
void myOtherEntrypoint() { ... };
794797
```
798+
795799
{{site.alert.end}}
796800

797801
### Dart library
@@ -884,10 +888,11 @@ FlutterViewController* flutterViewController =
884888
如果在 `FlutterEngine` 启动后,迫切得需要在平台侧改变你当前的 Flutter 路由,
885889
可以使用 `FlutterViewController` 里的 [`pushRoute()`][] 或者 [`popRoute()`][]
886890

887-
To pop the iOS route from the Flutter side,
891+
To pop the iOS route from the Flutter side,
888892
call [`SystemNavigator.pop()`][].
889-
890-
在 Flutter 侧推出 iOS 路由,调用 [`SystemNavigator.pop()`][]
893+
894+
在 Flutter 侧推出 iOS 路由,调用 [`SystemNavigator.pop()`][]
895+
891896
{{site.alert.end}}
892897

893898
See [Navigation and routing][] for more about Flutter's routes.

src/androidx-migration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ keywords: AndoridX, Android Studio, Flutter 里使用 AndroidX
1313
doesn't use AndroidX.
1414

1515
如果 Flutter 监测到你的项目中未使用到 AndroidX,那么你会跳转到此页面。
16+
1617
{{site.alert.end}}
1718

1819
[AndroidX]({{site.android-dev}}/jetpack/androidx) is a major improvement

src/codelabs/layout-basics-old.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ toc: false
2828
work in some browsers and not others. If you encounter any, please
2929
[create a DartPad issue](https://goo.gle/flutter_web_issue),
3030
labeling the issue with `platform-web`.
31-
31+
3232
目前 codelab 是基于 Chrome 开发测试的。可能会有一些功能(短期内)在某些浏览器上可用,而在另一些浏览器上不可用。
33-
如果您遇到任何问题,请 [create a DartPad issue](https://goo.gle/flutter_web_issue) ,并为这个 issue 加上
34-
`platform-web` 标签。
33+
如果您遇到任何问题,请 [create a DartPad issue](https://goo.gle/flutter_web_issue)
34+
并为这个 issue 加上 `platform-web` 标签。
35+
3536
{{site.alert.end}}
3637

3738
`Row` and `Column` are two very important widgets in the Flutter universe.

src/codelabs/layout-basics.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ and `Column` lays out its widgets vertically.
6969

7070
{{site.alert.secondary}}
7171
{:.no_toc}
72+
7273
The following example displays the differences between
7374
a `Row` and `Column`.
7475

@@ -1167,7 +1168,7 @@ wrap a widget and force the widget to fill extra space.
11671168
`Flexible` 非常相似。
11681169

11691170
{{site.alert.tip}}
1170-
1171+
11711172
**What's the difference between Flexible and Expanded?**
11721173
Use `Flexible` to resize widgets in a `Row` or `Column`.
11731174
That way, you can adjust a child widget's spacing
@@ -1193,7 +1194,7 @@ wrap a widget and force the widget to fill extra space.
11931194
The following example demonstrates how the
11941195
`Expanded` widget forces its child widget to
11951196
fill extra space.
1196-
1197+
11971198
下面的例子演示了 `Expanded` widget 是如何
11981199
强制其子 widget 填满空间的。
11991200

@@ -1214,6 +1215,7 @@ wrap a widget and force the widget to fill extra space.
12141215
and run again.
12151216

12161217
选择 **Format** 按钮格式化代码,然后再次运行。
1218+
12171219
{{site.alert.end}}
12181220

12191221
```run-dartpad:theme-dark:mode-flutter:width-100%:height-400px:split-60
@@ -1674,6 +1676,7 @@ can create space between widgets.
16741676
Use `Spacer` when you want to create space using a `flex` property.
16751677
Use `SizedBox` when you want to create space
16761678
using a specific number of logical pixels.
1679+
16771680
**SizedBox 和 Spacer 有何不同?**
16781681
如果你想用 `flex` 属性创建一段空间,请使用 `Spacer`
16791682
如果你想创建一个拥有特定逻辑像素值的空间,请使用 `SizedBox`
@@ -1840,7 +1843,7 @@ for different fonts, sizes, and colors.
18401843
{:.no_toc}
18411844

18421845
{{site.alert.secondary}}
1843-
1846+
18441847
The following example displays "Hey!" three times,
18451848
but at different font sizes and in different colors.
18461849
`Row` specifies the `crossAxisAlignment`
@@ -2528,6 +2531,7 @@ Future<void> main() async {
25282531
],
25292532
);
25302533
```
2534+
25312535
{{site.alert.end}}
25322536

25332537
```run-dartpad:theme-dark:mode-flutter:width-100%:height-400px:split-60

src/community/tutorials/memory-leak-monitoring-on-flutter.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,12 @@ Flutter 中的 Dart 是不支持反射的(为了优化打包体积,关闭了
187187

188188
{{site.alert.note}}
189189

190-
简单说明下 Library 是什么东西,
191-
Dart 中的分包管理是根据 Library 来的,
192-
同一个 Library 内的类名不能重复,
193-
一般情况下一个 `.dart` 文件就是一个 Library,
194-
当然也有例外,比如:part of 和 export。
190+
简单说明下 Library 是什么东西,
191+
Dart 中的分包管理是根据 Library 来的,
192+
同一个 Library 内的类名不能重复,
193+
一般情况下一个 `.dart` 文件就是一个 Library,
194+
当然也有例外,比如:part of 和 export。
195+
195196
{{site.alert.end}}
196197

197198
`vm_service` 有个 [invoke(isolateId, targetId, selector, argumentIds)](https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#invoke) API,
@@ -344,7 +345,8 @@ Dev Tools 是调用了 `vm_service` 的
344345

345346
{{site.alert.note}}
346347

347-
通过 dev_tools dump 出来的对象来看,的确泄漏了!
348+
通过 dev_tools dump 出来的对象来看,的确泄漏了!
349+
348350
{{site.alert.end}}
349351

350352
也就是 1.9.1 Framework 里面存在着泄漏,
@@ -441,7 +443,8 @@ Flutter 的 widget tree 的层次是非常深的。
441443

442444
{{site.alert.note}}
443445

444-
好消息是以上泄漏都在 1.12 版本之后修复了。
446+
好消息是以上泄漏都在 1.12 版本之后修复了。
447+
445448
{{site.alert.end}}
446449

447450
修复完上述两个泄漏之后,

0 commit comments

Comments
 (0)