Commit graph

155 commits

Author SHA1 Message Date
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
ec05a41525
chore: update transformer snapshots (#2838) 2024-03-27 15:02:09 +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
220f722f19
chore: update snapshots (#2817)
Babel repo is updated in #2813 and #2814
2024-03-26 11:53:26 +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
Dunqing
7a12514151
fix(transformer/decorators): missing check private function (#2607) 2024-03-05 11:37:00 +08:00
Boshen
ef932a3c27
refactor(codegen): clean up API around building sourcemaps (#2602)
closes #2564
2024-03-04 16:03:33 +08:00
Dunqing
6d43e851e8
feat(transformer/typescript): support transform constructor method (#2551) 2024-03-01 21:12:30 +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
Dunqing
f760108094
feat(transformer): call build module record (#2529) 2024-02-28 14:35:35 +08:00
Dunqing
cd75c1ca59
feat(transformer/decorators): insert only one private in expression (#2486) 2024-02-26 15:48:47 +08:00
Dunqing
3d008abacb
feat(transformer/decorators): insert instanceBrand function (#2480) 2024-02-23 23:04:27 +08:00
Dunqing
2628c97eda
feat(transformer/decorators): transform getter function (#2473) 2024-02-23 10:11:45 +08:00
Andrew McClenaghan
e6d536cb9b
feat(codegen): configurable typescript codegen (#2443)
- Adds option to `CodegenOptions` - `enable_typescript` to enable output
of TS.
- Stops skipping output that is TS when `enable_typescript` is enabled
- Adds TS support to 
    - Function
    - FormalParameter
    - BindingPattern
 - Adds basic tests for TS generation

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-02-20 12:09:28 +08:00
Dunqing
27b2c212c4
refactor(transformer/decorators): if it is a private method definition, transform it (#2427) 2024-02-19 19:17:11 +08:00
Boshen
70a0076eed
refactor: remove global allocator from non-user facing apps (#2401)
The runtime performance gains does not out weight the compilation speed from
building the custom allocators, which takes about a minute to build on
slower machines.
2024-02-12 14:09:05 +08:00
Dunqing
8e221cb26e
fix(transformer): update snapshot (#2268) 2024-02-02 17:00:44 +08:00
Boshen
650f6c942f
refactor: use our forked version of miette::Reporter for tests (#2266) 2024-02-02 16:15:31 +08:00
Dunqing
02c18d8506
feat(transformer/decorators): support for static and private member decorators (#2246) 2024-02-01 15:19:14 +08:00
Dunqing
ba85b097e0
feat(transformer/decorators): support method decorator and is not static (#2238) 2024-02-01 11:36:22 +08:00
Dunqing
a79988d5e2
feat(transformer/decorators): support static member (#2235) 2024-01-31 19:11:27 +08:00
Dunqing
3b85e1813b
feat(transformer/decorators): ensure property key consistency (#2233) 2024-01-31 19:05:52 +08:00
Dunqing
e5719e9b4d
feat(transformer/decorators): support transform member decorators (#2171) 2024-01-26 10:14:19 +08:00
Boshen
889837704c
feat(semantic): cfg prototype (#2019)
Co-authored-by: U9G <git@u9g.dev>
2024-01-25 20:19:35 +08:00
underfin
2794064eef
feat(transfrom): transform-json-strings (#2168)
The pr intends to implement the plugin
`babel-plugin-transform-json-strings`. But here is only mutate
`Directive`, the `StringLiteral` is not implement. It need to changed
the `StringLiteral` printer.

I'm intend to add the raw of `StringLiteral`, it will be mutate at
plugin, and using the `raw` to print `StringLiteral`. If you other
ideas, please let me know.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-01-25 10:39:02 +00:00
underfin
989ab88bc6
fix(codegen): print Directive original string (#2157)
> A Use Strict Directive may not contain an EscapeSequence or
LineContinuation.

It is `Use Strict Directive` spec, but the `expression` of `Directive`
isn't original string value, it has error if using it to codegen, so
here using `directive` of `Directive` to codegen and not to escape it.
Here is crashed test cases.

``` js
'use str\
ict';
```
The babel will print the original string, I follow it and avoid using
`print_str` because it will escape string.

I also changed some code using the `expression` of `Directive` to check
`Use Strict Directive` .
2024-01-25 15:24:05 +08:00
Dunqing
51cecbb3ea
refactor(transformer/decorators): align the implementation of all versions (#2159) 2024-01-25 13:11:24 +08:00
Dunqing
7f89bfea0d
feat(transformer/decorators): support version 2023-05 (#2152) 2024-01-24 11:19:29 +08:00
Dunqing
04b401cbfd
feat(transformer/decorators): support transform the class decorators in export declaration (#2145) 2024-01-24 11:13:29 +08:00
Dunqing
9e598ff650
feat(transformer): add decorators plugin (#2139) 2024-01-24 11:09:19 +08:00
Dunqing
b5b2ef34af
feat(transformer/typescript): improve function parameters name (#2079) 2024-01-19 13:50:10 +08:00
Dunqing
7711f7abaf
feat(transformer/typescript): support only_remove_type_imports option (#2077) 2024-01-18 23:25:31 +08:00
Dunqing
f5bf5dece1
feat(transformer/typescript): support transform exported TSModuleBlock (#2076) 2024-01-18 23:20:26 +08:00
Dunqing
56ca8b6dfe
feat(transformer/typescript): support transform namespace (#2075) 2024-01-18 23:15:28 +08:00
Wenzhe Wang
32349af691
chore(tasks): remove redundant directory after exec (#2069) 2024-01-17 17:35:15 +08:00
Dunqing
b89e84cc2d
feat(transformer/typescript): keep imports if import specifiers is empty (#2058) 2024-01-17 16:14:31 +08:00
Dunqing
24ac957660
fix(semantic): incorrect reference flag (#2057) 2024-01-17 16:08:31 +08:00
Dunqing
3413bb3884
feat(transformer/typescript): remove type-related exports (#2056) 2024-01-17 16:04:30 +08:00
Dunqing
95d741abd6
feat(transformer/typescript): remove type only imports/exports correctly (#2055) 2024-01-17 15:58:04 +08:00
Boshen
a69b76ab77
chore: update snapshots 2024-01-15 21:13:05 +08:00
Dunqing
6c7f983de5
feat(transformer/typescript): remove export specifier that import_kind is type (#2015) 2024-01-13 21:25:59 +08:00