oxc/tasks
Dunqing f1fcdde593 feat(transformer): support react fast refresh (#4587)
close: #3943

## Further improvements

There is a double visit here. We need to collect all react hooks calling in `Function` and `ArrowFunctionExpression`. If we want to remove this implementation, we may wait for #4188.

d797e595d2/crates/oxc_transformer/src/react/refresh.rs (L744-L947)

## Tests

All tests copy from https://github.com/facebook/react/blob/main/packages/react-refresh/src/__tests__/ReactFresh-test.js

There are still 4 tests that have not been passed

**1. refresh/can-handle-implicit-arrow-returns/input.jsx**

Related to #4767. transform correct, just output doesn't match the expected output

**2. refresh/registers-identifiers-used-in-jsx-at-definition-site/input.jsx**
**3. refresh/registers-identifiers-used-in-react-create-element-at-definition-site/input.jsx**

Blocked by #4746

**4. refresh/supports-typescript-namespace-syntax/input.tsx**

oxc transforms ts to js first, so probably we can ignore this case. If we really want to pass this test, we also need to turn off `TypeScript` plugin.

## What's next?

### Options:

1. Support transform `refresh_reg` and `refresh_sig` options to `MemberExpression`. Currently `import.meta.xxxx` still is an `Identifier`
2. Support `emit_full_signatures` option

### Other
NAPI, testing in `monitor-oxc`, etc..
2024-08-15 16:41:30 +00:00
..
ast_tools docs(ast, ast_macros, ast_tools): better documentation for Ast helper attributes. (#4856) 2024-08-15 11:32:36 +00:00
benchmark chore(deps): update pnpm to v9.7.0 (#4836) 2024-08-12 03:22:28 +00:00
common refactor(tasks): clean up test files and remove libs.txt (#4172) 2024-07-10 17:38:06 +00:00
coverage feat(coverage): add checker for correctness of semantic data (#4908) 2024-08-15 04:46:07 +00:00
javascript_globals chore: turn off doctest for all [[bin]] 2024-07-14 16:55:19 +08:00
lint_rules feat(docs): add tracking for plugins "promise" and "vitest" (#4668) 2024-08-05 19:01:44 -04:00
minsize fix(minifier): avoid removing function declaration from KeepVar (#4722) 2024-08-07 05:09:32 +00:00
prettier_conformance perf: replace some CompactStr usages with Cows (#4377) 2024-07-20 19:19:55 +00:00
rulegen feat(rulegen): improve examples in documentation (#4815) 2024-08-10 18:48:59 -04:00
transform_conformance feat(transformer): support react fast refresh (#4587) 2024-08-15 16:41:30 +00:00
website chore(tasks/website): do not run textlint nor prettier 2024-08-15 14:28:57 +08:00