Skip to content

chore(docs): update in-depth/directives for output.strict option#8535

Merged
shulaoda merged 3 commits intorolldown:mainfrom
hamsurang:issue-8532-docs-output-strict
Mar 8, 2026
Merged

chore(docs): update in-depth/directives for output.strict option#8535
shulaoda merged 3 commits intorolldown:mainfrom
hamsurang:issue-8532-docs-output-strict

Conversation

@minsoo-web
Copy link
Contributor

Summary

  • Update docs/in-depth/directives.md to document output.strict options (true, false, 'auto') with a concrete config example.
  • Clarify that non-ES "use strict" emission conditions in this section apply when output.strict is 'auto'.
  • Fix wording for readability/grammar (e.g. an entry module) while preserving existing REPL references and behavior-focused explanation.

Closes #8532

Test plan

  • Docs-only change
  • Verify markdown renders correctly in docs/in-depth/directives.md
  • Confirm no unrelated file changes in commit

Document output.strict modes and make the non-ES "use strict" conditions explicit for strict: 'auto' to reduce ambiguity.
@minsoo-web minsoo-web changed the title Issue 8532 docs output strict chore(docs): update in-depth/directives for output.strict option Mar 3, 2026
@minsoo-web minsoo-web marked this pull request as ready for review March 3, 2026 22:14
Copilot AI review requested due to automatic review settings March 3, 2026 22:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the in-depth directives documentation to explain how Rolldown controls "use strict" emission via output.strict, and clarifies when the existing non-ES emission rules apply.

Changes:

  • Document output.strict values (true, false, 'auto') and their behavior.
  • Clarify that the listed non-ES "use strict" emission cases apply specifically when output.strict is 'auto'.
  • Update the example configuration to use output.strict (instead of using output.intro to inject the directive).

You can also share your feedback on Copilot code review. Take the survey.

import { defineConfig } from 'rolldown';

export default defineConfig({
output: {
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The config example sets output.strict: true but doesn’t set output.format. Since output.format defaults to 'es', this example won’t actually emit a "use strict" directive (ESM is always strict and Rolldown doesn’t output the directive). Consider setting a non-ES format (e.g. 'cjs') in the example, or explicitly stating that the example assumes a non-ES output format.

Suggested change
output: {
output: {
format: 'cjs',

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

I can't control and modify the PR, so I will resolve it in next PR.

@shulaoda
Copy link
Member

shulaoda commented Mar 8, 2026

Thank you!

@shulaoda shulaoda merged commit 41d6df1 into rolldown:main Mar 8, 2026
32 of 33 checks passed
shulaoda added a commit that referenced this pull request Mar 9, 2026
> The config example sets `output.strict: true` but doesn’t set `output.format`. Since `output.format` defaults to `'es'`, this example won’t actually emit a `"use strict"` directive (ESM is always strict and Rolldown doesn’t output the directive). Consider setting a non-ES format (e.g. `'cjs'`) in the example, or explicitly stating that the example assumes a non-ES output format.
> ```suggestion
>   output: {
>     format: 'cjs',
> ``` 

 _Originally posted by @Copilot in [#8535](https://github.com/rolldown/rolldown/pull/8535/changes#r2880787295)_
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
shulaoda added a commit that referenced this pull request Mar 9, 2026
## [1.0.0-rc.8] - 2026-03-09

### 🚀 Features

- watch: enable full functional fs watcher in wasm (#8575) by @hyf0
- watch: expose debounce related options (#8572) by @hyf0

### 🐛 Bug Fixes

- detect new URL(…, import.meta.url) with no-sub template literal (#8565) by @char
- devtools: trace dynamic imports in devtools (#8581) by @cal-gooo
- watch: rebuild when a previously missing file is created (#8562) by @hyf0-agent
- watch: filter out Access events to prevent infinite rebuild loop on Linux (#8557) by @hyf0-agent

### 🚜 Refactor

- watch: remove auto watch for fail imports (#8585) by @hyf0
- fs_watcher: unify the way of constructing watcher (#8571) by @hyf0
- cli: migrate CLI to CAC (#8551) by @h-a-n-a
- switch asset module support from hard-code to builtin plugin (#8546) by @hyf0

### 📚 Documentation

- fix subject-verb agreement in why-bundlers.md (#8591) by @brandonzylstra
- maintenance: align release and canary workflow guide (#8538) by @minsoo-web
- add `format` option to directives example config (#8590) by @shulaoda
- fix: change twitter to x logo in team (#8552) by @mdong1909
- correct composable filter support explanation (#8550) by @sapphi-red

### ⚡ Performance

- testing: share tokio runtime across fixture tests (#8567) by @Boshen

### 🧪 Testing

- hmr: fix infinite loop in dev server test retry logic (#8576) by @hyf0-agent
- cli: add more cli-e2e test cases (#8548) by @h-a-n-a

### ⚙️ Miscellaneous Tasks

- docs: update in-depth/directives for `output.strict` option (#8535) by @minsoo-web
- add PNPM_HOME Dev Drive mapping to Windows CI workflows (#8589) by @Boshen
- deps: update github-actions (#8588) by @renovate[bot]
- move Windows cargo target dir to Dev Drive (#8586) by @Boshen
- optimize cache keys to fix race conditions and reduce usage (#8578) by @Boshen
- remove WASI build & test pipeline (#8580) by @Boshen
- remove unnecessary submodule checkouts (#8577) by @Boshen
- use Dev Drive for Windows CI jobs (#8574) by @Boshen
- skip redundant native binding build for browser and remove standalone job (#8573) by @Boshen
- parallelize Node tests on ubuntu, single Node 24 on macOS/windows (#8570) by @Boshen
- docs: bump @voidzero-dev/vitepress-theme to 4.8.0 (#8558) by @crusty-voidzero
- dedupe type-check from dev server workflow (#8554) by @Boshen

### ❤️ New Contributors

* @brandonzylstra made their first contribution in [#8591](#8591)
* @char made their first contribution in [#8565](#8565)
* @cal-gooo made their first contribution in [#8581](#8581)
* @hyf0-agent made their first contribution in [#8562](#8562)
* @h-a-n-a made their first contribution in [#8551](#8551)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update in-depth/directives for output.strict option

3 participants