docs: add descriptions to plugin READMEs#596
Conversation
Add descriptive introductions to 12 plugin READMEs that were missing explanations of what the plugins do: - jest: SWC implementation of babel-jest for fast test transforms - noop: no-op plugin for debugging/template purposes - loadable-components: transforms @loadable/component dynamic imports - relay: compiles Relay GraphQL tagged template literals - react-remove-properties: removes data-testid and similar props - remove-console: strips console.* calls from production builds - styled-components: adds display names and SSR support - styled-jsx: transforms <style jsx> scoped CSS in JSX - swc-confidential: encrypts string literals at build time - swc-magic: processes markAsPure and other magic annotations - swc-sdk: provides markAsPure and dynamic import transformations - transform-imports: transforms named imports to file-level imports Fixes #200 Co-authored-by: Donny/강동윤 <kdy1@users.noreply.github.com>
|
|
|
Code ReviewThanks for improving the plugin documentation! The descriptions are clear and well-written. Here are a few issues to address: Bugs: Duplicate headingsThree README files end up with duplicate H1 headings after this PR. The new description adds a heading at the top, but the old heading still exists in the changelog section:
The duplicate headings in the changelog section should be removed (or the changelog section heading should be demoted to H2). Inconsistent heading hierarchyIn two files, a new H1 (
The old H3 headings that duplicate the plugin name should be removed. Potential content inaccuracy in jest/README.mdThe description says this plugin "replaces Positive changes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32f6fd671a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ```js | ||
| module.exports = { | ||
| transform: { | ||
| "^.+\\.(t|j)sx?$": "@swc/jest", |
There was a problem hiding this comment.
Document how to enable the Jest wasm plugin
This example swaps Jest over to @swc/jest, but it never enables @swc/plugin-jest itself. The package only publishes a wasm artifact (packages/jest/package.json:9), and the in-repo test coverage loads it via jsc.experimental.plugins (packages/jest/__tests__/wasm.test.ts:12-23). If a user copies this snippet as-is, they install @swc/plugin-jest but still won't get the hoisting transform, so tests that depend on jest.mock() being hoisted will continue to fail.
Useful? React with 👍 / 👎.
| ```sh | ||
| npm install --save-dev @swc/plugin-styled-jsx @swc/core |
There was a problem hiding this comment.
Add the styled-jsx runtime to the install example
The new usage block only installs @swc/plugin-styled-jsx and @swc/core, but the transform's own snapshots show that the output imports styled-jsx/style (packages/styled-jsx/__tests__/__snapshots__/wasm.test.ts.snap:3-5). In a project that does not already depend on styled-jsx, following these docs leads to a module-resolution failure at build/runtime, so the install command needs to mention the runtime package too.
Useful? React with 👍 / 👎.
| @@ -1,5 +1,25 @@ | |||
| # @swc/plugin-jest | |||
|
|
|||
| The SWC implementation of `babel-jest`. This plugin transforms test files using SWC, enabling fast Jest-based testing without Babel. It replaces `babel-jest` as the transformer in Jest configurations and supports TypeScript, JSX, and modern JavaScript features. | |||
There was a problem hiding this comment.
Move these README edits into the template files
I checked scripts/bump-npm.sh:7-8, and every release regenerates each package README.md from its README.tmpl.md. Because this patch only updates the generated README files and leaves the templates untouched (for example packages/jest/README.tmpl.md:1-3 is still just the changelog placeholder), the new descriptions will be overwritten the next time maintainers run the bump script. The same problem applies to the other README.md-only edits in this commit.
Useful? React with 👍 / 👎.
Add descriptive introductions to 12 plugin READMEs that were missing explanations of what the plugins do.
Fixes #200
Generated with Claude Code