Skip to content

Commit

Permalink
Merge pull request #30 from rollup/sync-28c7b7cf
Browse files Browse the repository at this point in the history
docs(en): merge rollup/master into rollup-docs-cn/master @ 28c7b7c
  • Loading branch information
waynzh authored Apr 24, 2023
2 parents d9d2cac + 9ffe379 commit 39315ff
Show file tree
Hide file tree
Showing 105 changed files with 1,353 additions and 501 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/deploy-website.yml

This file was deleted.

18 changes: 9 additions & 9 deletions .github/workflows/repl-artefacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
comment-author: 'github-actions[bot]'
body-includes: 'Thank you for your contribution!'
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
id: createInitialComment
with:
comment-id: ${{ steps.findComment.outputs.comment-id }}
Expand All @@ -74,14 +74,14 @@ jobs:
or load it into the REPL:
https://rollupjs.org/repl/?pr=${{ github.event.number }}
- name: Update comment for Netlify deploy
uses: jakepartusch/wait-for-netlify-action@v1
id: waitForNetlify
- name: Find Vercel preview URL
uses: patrickedqvist/wait-for-vercel-preview@v1.3.1
id: waitForVercel
with:
site_name: "rollupjs"
- name: Update comment for Netlify
uses: peter-evans/create-or-update-comment@v2
if: ${{ steps.waitForNetlify.outputs.url }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update comment with Vercel preview URL
uses: peter-evans/create-or-update-comment@v3
if: ${{ steps.waitForVercel.outputs.url }}
with:
comment-id: ${{ steps.createInitialComment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
Expand All @@ -96,4 +96,4 @@ jobs:
```
or load it into the REPL:
${{ steps.waitForNetlify.outputs.url }}/repl/?pr=${{ github.event.number }}
${{ steps.waitForVercel.outputs.url }}/repl/?pr=${{ github.event.number }}
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
pull_request:
types: [synchronize, opened, reopened]
merge_group:

permissions:
contents: read
Expand Down
Empty file removed .zhlintignore
Empty file.
4 changes: 0 additions & 4 deletions .zhlintrc

This file was deleted.

83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,88 @@
# rollup changelog

## 3.21.0

_2023-04-23_

### Features

- Support tree-shaking of named exports in dynamic imports when using destructuring and similar patterns (#4952)

### Pull Requests

- [#4952](https://github.com/rollup/rollup/pull/4952): feat: tree-shake deterministic dynamic imports (@antfu)

## 3.20.7

_2023-04-21_

### Bug Fixes

- Properly track array element mutations when iterating with a for-of loop (#4949)
- Handle default exporting an anonymous class that extends another class (#4950)

### Pull Requests

- [#4943](https://github.com/rollup/rollup/pull/4943): Add a test for reserved keywords used as import/export specifiers (@Andarist)
- [#4949](https://github.com/rollup/rollup/pull/4949): Deoptimize right side in for-of loops (@lukastaegert)
- [#4950](https://github.com/rollup/rollup/pull/4950): Support default exported classes that extend other classes (@lukastaegert)

## 3.20.6

_2023-04-18_

### Bug Fixes

- Revert handling of non-JS import and export names due to regressions (#4914)

### Pull Requests

- [#4914](https://github.com/rollup/rollup/pull/4914): feat: add locales in vitepress config (@iDestin)
- [#4946](https://github.com/rollup/rollup/pull/4946): Revert #4939 for now (@lukastaegert)

## 3.20.5

_2023-04-18_

### Bug Fixes

- Handle import and export names that are not valid JavaScript identifiers (#4939)

### Pull Requests

- [#4939](https://github.com/rollup/rollup/pull/4939): Fixed imports/exports that are illegal identifiers in the es output (@Andarist)
- [#4941](https://github.com/rollup/rollup/pull/4941): Reinstate global styles (@lukastaegert)

## 3.20.4

_2023-04-17_

### Bug Fixes

- Do not remove breaks statements after switch statements with conditional breaks (#4937)

### Pull Requests

- [#4937](https://github.com/rollup/rollup/pull/4937): fix: handle conditional breaks in nested switch statement cases (@TrickyPi and @lukastaegert)

## 3.20.3

_2023-04-16_

### Bug Fixes

- Reduce memory consumption for function call parameter analysis (#4938)
- Fix types for `shouldTransformCachedModule` (#4932)

### Pull Requests

- [#4925](https://github.com/rollup/rollup/pull/4925): chore: repl style add scoped (@btea)
- [#4926](https://github.com/rollup/rollup/pull/4926): docs: Update the x_google_ignorelist url (@jecfish)
- [#4932](https://github.com/rollup/rollup/pull/4932): Allow shouldTransformCachedModule to return null (@bluwy)
- [#4935](https://github.com/rollup/rollup/pull/4935): Bump peter-evans/create-or-update-comment from 2 to 3 (@dependabot[bot])
- [#4936](https://github.com/rollup/rollup/pull/4936): Disable puppeteer sandbox to fix Vercel deployment (@lukastaegert)
- [#4938](https://github.com/rollup/rollup/pull/4938): Improve memory usage for parameter deoptimizations (@lukastaegert)

## 3.20.2

_2023-03-24_
Expand Down
2 changes: 1 addition & 1 deletion browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/browser",
"version": "3.20.2",
"version": "3.21.0",
"description": "Next-generation ES module bundler browser build",
"main": "dist/rollup.browser.js",
"module": "dist/es/rollup.browser.js",
Expand Down
5 changes: 4 additions & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export default defineConfig({
['meta', { content: 'The JavaScript module bundler', name: 'twitter:description' }],
['meta', { content: 'https://rollupjs.org/twitter-card.jpg', name: 'twitter:image' }]
],
locales: {
root: { label: '简体中文' },
zh: { label: 'English', link: 'https://rollupjs.org' }
},
markdown: {
anchor: {
callback,
Expand Down Expand Up @@ -129,7 +133,6 @@ export default defineConfig({
title: 'Rollup 中文文档',
transformPageData,
vite: {
optimizeDeps: { include: ['moment-mini', '@braintree/sanitize-url'] },
plugins: [
renderMermaidGraphsPlugin(),
{
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ export default {
| --: | :-- |
| 类型: | `boolean \| (relativeSourcePath: string, sourcemapPath: string) => boolean` |

该选项决定是否忽略 sourcemap 中列出的源文件,用于填充 [`x_google_ignoreList` source map 扩展](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension)。`relativeSourcePath` 是生成的 `.map` 文件到相应源文件的相对路径,而 `sourcemapPath` 是生成的 sourcemap 文件的绝对路径。
该选项决定是否忽略 sourcemap 中列出的源文件,用于填充 [`x_google_ignoreList` source map 扩展](https://developer.chrome.com/articles/x-google-ignore-list/)。`relativeSourcePath` 是生成的 `.map` 文件到相应源文件的相对路径,而 `sourcemapPath` 是生成的 sourcemap 文件的绝对路径。

```js
import path from 'node:path';
Expand Down
4 changes: 2 additions & 2 deletions docs/plugin-development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,14 @@ type ShouldTransformCachedModuleHook = (options: {
meta: { [plugin: string]: any };
moduleSideEffects: boolean | 'no-treeshake';
syntheticNamedExports: boolean | string;
}) => boolean;
}) => boolean | NullValue;
```

如果使用 Rollup 缓存(例如在观察模式下或通过 JavaScript API 明确使用),如果在 [`load`](#transform) 钩子之后,加载的 `code` 与缓存副本的代码相同,则 Rollup 将跳过模块的 [`transform`](#transform) 钩子。为了防止这种情况,插件可以实现此钩子并返回 `true`,以丢弃缓存副本并转换模块。

此钩子还可用于查找已缓存的模块并访问其缓存的元信息。

如果插件没有返回 `true`,则 Rollup 将为其他插件触发此钩子,否则所有剩余的插件都将被跳过。
如果插件没有返回布尔值,则 Rollup 将为其他插件触发此钩子,否则所有剩余的插件都将被跳过。

### transform

Expand Down
15 changes: 8 additions & 7 deletions docs/repl/components/BundleOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<a :href="getLinkForOption(option.name)">{{ option.name }}</a>
<button
v-if="option.removable"
class="remove"
class="repl-button remove"
@click="optionsStore.set(option.name, undefined)"
>
<span class="label">移除</span>
<span class="icon-cancel"></span>
<span class="repl-icon-cancel"></span>
</button>
</h3>
<SelectOption
Expand Down Expand Up @@ -66,7 +66,7 @@
{{ option }}
</option>
</select>
<span class="icon-plus"></span>
<span class="repl-icon-plus"></span>
</div>
</div>
</template>
Expand Down Expand Up @@ -102,7 +102,7 @@ const getLinkForOption = (option: string) =>
}
h3 {
padding: 0 0.5rem;
padding: 0 0 0 0.5rem;
margin: 6px 0 2px;
font-size: 14px;
font-weight: 500;
Expand Down Expand Up @@ -167,10 +167,10 @@ select {
appearance: none;
background: var(--vp-c-bg);
padding-right: 20px;
width: 100px;
width: 94px;
}
.icon-plus {
.repl-icon-plus {
font-size: 0.8em;
position: absolute;
right: 0;
Expand All @@ -181,7 +181,7 @@ button.remove {
font-family: inherit;
font-size: 14px;
font-weight: 500;
padding: 0.2em;
padding: 0.2em 0 0.2em 0.2em;
margin: 0;
background-color: transparent;
border: none;
Expand All @@ -195,6 +195,7 @@ button.remove {
button.remove .label {
opacity: 0;
transition: all 0.2s;
padding-right: 0.2em;
}
button.remove:hover,
Expand Down
2 changes: 1 addition & 1 deletion docs/repl/components/InputHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ example.title }}
</option>
</select>
<button class="start-over" @click="startOver">重新开始</button>
<button class="repl-button start-over" @click="startOver">重新开始</button>
</header>
</template>

Expand Down
6 changes: 3 additions & 3 deletions docs/repl/components/OutputStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
:class="waiting ? 'waiting' : error ? 'error' : warnings.length > 0 ? 'warnings' : 'success'"
>
<span v-if="waiting">
<span class="icon icon-attention"></span>
<span class="repl-icon-attention"></span>
加载 Rollup...
</span>
<StatusMessage v-else-if="error" :message="error" isError />
<span v-else-if="warnings.length > 0">
<span class="icon icon-attention" />
<span class="repl-icon-attention" />
Rollup 执行完成但出现警告:
<ul class="warning-list">
<li v-for="(warning, i) in warnings" :key="i" class="warning">
Expand All @@ -18,7 +18,7 @@
</ul>
</span>
<span v-else>
<span class="icon icon-ok"></span>
<span class="repl-icon-ok"></span>
Rollup 执行成功!
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/repl/components/ReplInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
/>
</div>

<button class="new-module" @click="createModule">
<span class="icon icon-plus"></span>
<button class="repl-button new-module" @click="createModule">
<span class="repl-icon-plus"></span>
添加模块
</button>
</template>
Expand Down
Loading

1 comment on commit 39315ff

@vercel
Copy link

@vercel vercel bot commented on 39315ff Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.