Commit graph

110 commits

Author SHA1 Message Date
Dunqing
e2c6fe0cb1
feat(transformer): report errors when options have unknown fields (#3322) 2024-05-19 01:19:40 +08:00
Dunqing
9ee962add8 feat(transformer): support from_babel_options in TransformOptions (#3301)
Move `BabelOptions` to Transformer. The `output.json` is a standard babel configuration. We can reuse BabelOptions to read [babel.config.json](https://babeljs.io/docs/configuration#babelconfigjson) or our configuration(maybe oxc.config.json)

The current `from_babel_options` implementation is copied from the `transform_options` in `test_case.rs`, which I'll completely reimplement next
2024-05-16 10:10:39 +00:00
Dunqing
8ff1ffba74
feat(transformer_conformance): skip some tests that are known to fail (#3293)
I don't think we need to be completely consistent with Babel's output.
Because Babel's output doesn't always make sense.
2024-05-15 22:06:00 +08:00
Boshen
530455849b chore(tasks): add commit sha to snapshots to make sure submodules are not outdated (#3267)
If submodules are outdated, it'll panic with the following message

```
Repository is outdated, please run `just submodules` to update it.
```

For us maintainers, we'll need the env `UPDATE_SNAPSHOT` to force an update.
2024-05-14 10:18:00 +00:00
Boshen
dbde5b3a04
refactor(diagnostics): remove export of miette 2024-05-12 11:46:48 +08:00
Dunqing
fd6a1aa1d2 feat(transformer_conformance): correct source type (#3233) 2024-05-11 09:30:43 +00:00
Dunqing
18d853bb2b
feat(transformer/react): support development mode (#3143) 2024-05-10 22:07:33 +08:00
Dunqing
a227050ed0
chore: update babel repo (#3205) 2024-05-08 20:15:15 +08:00
Boshen
a63a45d5b2
refactor(transformer): remove the requirement of Semantic (#3140)
It seems like we need to rebuild the scopes and symbols while
traversing. We can't utilize the scopes and symbols built by semantic
because they are immutable.
2024-04-30 12:48:21 +08:00
Boshen
d76507699d
chore(transform_conformance): skip transform-destructuring (#3136) 2024-04-30 00:09:22 +08:00
Boshen
5a3f8a5811
feat(transform_conformance): handle parse error (#3135) 2024-04-30 00:07:53 +08:00
Dunqing
843318cdbe
refactor(transformer/typescript): reimplementation of Enum conversion based on Babel (#3102)
The remaining test cases will perform better with a scope
implementation, and while we can implement them without the scope, it
still requires us to do what the scope did.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-04-29 16:26:22 +08:00
Dunqing
905ee3fef1
feat(transformer): add arrow-functions plugin (#3083)
close: #2983
2024-04-29 08:04:01 +00:00
Boshen
722d4c2350
fix(transformer): TypeScriptOptions deserialize should fallback to default (#3012) 2024-04-17 16:27:50 +08:00
Dunqing
b72bdcaf96
feat(transformer/react): reports duplicate __self/__source prop error (#3009) 2024-04-17 13:34:31 +08:00
Boshen
df1996157f
chore(transform_conformance): ignore more unsupported plugins (#3008) 2024-04-16 18:59:21 +08:00
Dunqing
cdd3bc5a4e
feat(transformer_conformance): enable typescript when the typescript plugin is present (#3007) 2024-04-16 10:47:06 +00:00
Boshen
ae9d681b4d
feat(transform_conformance): skip windows tests (#3003) 2024-04-16 17:50:43 +08:00
Boshen
85a3653994
feat(transformer): add "_jsxFileName" variable in jsx source plugin (#3000) 2024-04-16 17:40:24 +08:00
Boshen
5f4c1e1d3e
chore(transform_conformance): skip custom presets (#3001) 2024-04-16 17:21:34 +08:00
Boshen
82e00bc951
refactor(transformer): remove boilerplate code around decorators to reduce noise (#2991) 2024-04-15 13:51:09 +08:00
Boshen
b4bfa2f34c
refactor(transform_conformance): correctly handle BABEL_8_BREAKING (#2990) 2024-04-15 13:41:45 +08:00
Boshen
5a286c3d9f
feat(transform_conformance): drop more unsupported plugins (#2984) 2024-04-14 23:04:04 +08:00
Boshen
9643cba4a4
feat(transform_conformance): drop all babel 7 specific tests (#2982)
@Dunqing Is this correct?
2024-04-14 23:02:38 +08:00
Boshen
c753c9fa74
feat(transform_conformance): handle deserialization errors (#2980) 2024-04-14 22:47:28 +08:00
Boshen
7cf0927a38
feat(transform_conformance): skip tests with plugin.js (#2977) 2024-04-14 21:45:27 +08:00
Boshen
ef602af4cc
feat(transform_conformance): skip plugins we don't support yet (#2967) 2024-04-14 21:32:03 +08:00
Boshen
10814d5331
fix(transformer): turn on react preset by default (#2968) 2024-04-14 19:04:59 +08:00
Boshen
bd9fc6d169
feat(transformer): react jsx transform (#2961) 2024-04-14 10:50:17 +08:00
Boshen
6561392202
feat(transform_conformance): add baseline for all TypeScript and jsx plugins 2024-04-13 19:05:39 +08:00
Boshen
e651e50bda
feat(transformer): add the most basic plugin toggles (#2950) 2024-04-12 20:25:34 +08:00
Boshen
60ccbb105c
refactor(transformer): clean up some code (#2949) 2024-04-12 20:23:44 +08:00
Boshen
14754777a4
feat(transformer): implement react-jsx-source (#2948) 2024-04-12 20:21:54 +08:00
Boshen
f903a225a8
feat(transformer): implement react-jsx-self (#2946) 2024-04-12 18:08:36 +08:00
Boshen
f3a28c61b9
chore(transform_conformance): enable typescript plugin snapshot 2024-04-11 20:06:53 +08:00
Boshen
3419306ac0
feat(transformer): add filename (#2941) 2024-04-11 18:43:51 +08:00
Boshen
07bd85e25d
chore(transform_conformance): clear the conformance snapshot 2024-04-11 14:09:59 +08:00
Boshen
d65eab3b8b
feat(transformer): add react preset (#2921) 2024-04-09 12:39:33 +08:00
Boshen
7710d8caf1
feat(transformer): add compiler assumptions (#2872)
closes #2869
2024-03-31 02:04:21 +00:00
Boshen
7034bcc47d
feat(transformer): add proposal-decorators (#2868) 2024-03-30 21:07:36 +08:00
Boshen
ffadcb08d9
feat(transformer): add react plugins (#2867) 2024-03-30 20:56:10 +08:00
Boshen
293b9f482a
feat(transformer): add transform-typescript boilerplate (#2866) 2024-03-30 20:48:35 +08:00
Boshen
c1a2958a5a
chore: remove oxc_transformer for a reimplementation (#2865)
closes #2860
2024-03-30 17:19:46 +08:00
Dunqing
d67100730b
feat(tasks/transforme_conformance): support for testing oxc's test cases (#2835)
Related to:
https://github.com/oxc-project/oxc/pull/2822#issuecomment-2021802212

Although `babel` has a lot of test cases, we still need to add edge
cases that `babel` doesn't have.

This PR will allow us to add out test cases to
`/root/oxc/tasks/transform_conformance/tests`. The directory structure
is consistent with `babel`

For example
```shell
# cd /root/oxc/tasks/transform_conformance/tests
- babel-transform-plugin–optional-catch-binding
   - test
       - fixtures
           - your tests # add test cases here
```
2024-03-27 14:14:15 +08:00
Ali Rezvani
243131d7a4
feat(transformer): numeric separator plugin. (#2795)
[es2021 numeric
separator](https://babeljs.io/docs/babel-plugin-transform-numeric-separator)
2024-03-26 18:15:12 +08:00
Ali Rezvani
56493bd02b
feat(transformer): add transform literal for numeric literals. (#2797)
[es2015 transform
literals](https://babeljs.io/docs/babel-plugin-transform-literals)

---------

Co-authored-by: Dunqing <dengqing0821@gmail.com>
2024-03-26 16:27:32 +08:00
Dunqing
68e011c479
fix(tasks/transform-conformance) when the output file does not exist, the output content should be empty (#2808)
https://github.com/oxc-project/oxc/pull/2795#issuecomment-2018018675
2024-03-25 23:28:00 +08:00
underfin
d9b77d853b
refactor(sourcemap): change sourcemap name to take a reference (#2779) 2024-03-23 21:40:05 +08:00
Boshen
ef932a3c27
refactor(codegen): clean up API around building sourcemaps (#2602)
closes #2564
2024-03-04 16:03:33 +08:00
Dunqing
25e03cb0ef
feat(tasks/transformer): enable typescript when the typescript plugin is provided (#2548)
Babel has many test cases that are js files, but in ts syntax.
2024-03-01 21:04:55 +08:00