Commit graph

88 commits

Author SHA1 Message Date
magic-akari
9ff0ffcc6f
feat(ast): implement new proposal-import-attributes (#1476)
- [Import Attributes](https://tc39.es/proposal-import-attributes)
2023-11-25 15:56:09 +08:00
Boshen
a60b7e5856
feat(tasks): add misc tests to codegen (#1215) 2023-11-10 16:13:31 +00:00
Boshen
eca98cf2ed
s/web-infra-dev/oxc-project 2023-11-10 14:30:18 +08:00
Boshen
a442fad3b7
feat(semantic): bind function expression name (#1049)
closes #1018

We'll eventually recover the mangling tests, which should cover this
change.
2023-10-24 17:25:12 +08:00
Boshen
1b3b100475
feat(transformer_conformance): read plugins options from babel options.json (#1006)
This PR correctly handles babel `options.json` such as
https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-nullish-coalescing-operator/test/fixtures/assumption-noDocumentAll/options.json
2023-10-17 14:52:51 +08:00
Boshen
eaeb63072f
refactor(clippy): allow struct_excessive_bools 2023-10-16 15:18:07 +08:00
Boshen
801d78a3c6
refactor(minifier): make the minifier api only accept an ast (#990) 2023-10-14 00:51:29 +08:00
Boshen
a6ea901254
feat(coverage): add typescript to codegen tests (#988) 2023-10-13 13:42:54 +08:00
Boshen
e0ca09b1c9
feat(codegen): implement the basics of non-minifying codegen (#987) 2023-10-13 13:34:21 +08:00
Boshen
8c12dff8a3
perf: speed tasks run by using a global allocator 2023-10-11 20:30:30 +08:00
Boshen
d5fb3d43ab
chore(coverage): remove regex-v-flag feature from parser tests (#975)
A regex parser is required to implement this.

Relates #385
2023-10-11 06:18:22 +08:00
Boshen
ef8aaa7bf1
feat(minifier): re-enable mangler (#972) 2023-10-10 14:32:58 +08:00
Boshen
7172953fe9
feat(transformer_conformance): snapshot passed and failed tests (#921) 2023-09-16 20:58:31 +08:00
Boshen
ceeee5909b
Remove HIR (#917)
closes #273
closes #814

HIR is removed from this PR, with the minifier being commented out.

HIR is a wonderful idea for compiling to lower languages, but after
sitting on it for a few months I found that it only adds confusion and
uncertainties to both myself and future contributors.

It also adds too much burden to maintainers if we plan to support more
downstream tools.

1 AST is the only way.
2023-09-15 23:48:32 +08:00
Don Isaac
027a67d94c
feat(minifier): constant addition expression folding (#882)
Fold constant addition expressions. Handles string concatenation and
addition, both with implicit casting.

For example,
```ts
let x = 1 + 1
let y = "hello " + "world"
```
now becomes
```ts
let x = 2
let y = "hello world"
```

## Extra Goodies
- test(minifier): add `test_snapshot` helper to perform snapshot tests
with `insta`
- up(hir): implement `std::ops::Add` for `NumericValue`
- up(span): impl `TryFrom<Cow<'_, &str>>` for `Atom`
2023-09-11 10:38:35 +08:00
Boshen
9ff12a9696
feat(linter): eslint-plugin-import/no-self-import (#878)
closes #440 #441
2023-09-10 00:12:26 +08:00
Boshen
ee54575ec1
feat(linter): add runner for import-plugin (#858) 2023-09-06 14:54:19 +08:00
Boshen
75af639d4a
chore(rust): remove unicode support from regex for smaller binary size (#823) 2023-09-01 12:42:58 +08:00
Boshen
00ed939cbc
feat(coverage): init git submodules if they are empty (#808)
closes #805
2023-08-29 13:35:32 +08:00
Yunfei He
e7c2313817
feat(ast): add SymbolId and ReferenceId (#755)
Closes #510
2023-08-19 18:09:47 +08:00
阿良仔
5a73f0e1b5
feat(formatter): add EndOfLine (#747) 2023-08-17 19:04:23 +08:00
Boshen
2f48bdf26f
fix(parser,semantic): make semantic own Trivias (#711)
closes #708

Making the parser return Rc<Trivias> is not a good API, and ideally
`Semantic` should just own `Trivias` so it can process or mutate it.
2023-08-10 15:30:32 +08:00
Matthew "strager" Glazar
ad00720d75 refactor: avoid unstable let_chains
The let_chains Rust feature is unstable, preventing Oxc from using a
stable Rust compiler. Refactor the code to avoid let_chains.
2023-07-27 09:44:57 +08:00
Boshen
38e11956be
chore(rust): rust version 1.71.0 nightly 2023-07-13 23:10:10 +08:00
Boshen
06764f8574
chore(tasks): add swc-7187 test case 2023-06-30 16:41:52 +08:00
Boshen
d30735677b
refactor(semantic): merge semantic2 crate into semantic crate (#460) 2023-06-19 20:20:59 +08:00
Boshen
bad8bfcf16
ci: run conformance tests and bail if there are outdated snapshots (#444) 2023-06-14 21:44:10 +08:00
Carter Snook
c0726e444f
feat(lexer): use linear lexing on WASM (#436)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-06-13 15:18:02 +08:00
Boshen
243e48ac09
fix(coverage): make ignoring "literals/regexp" work on Windows 2023-06-13 14:31:59 +08:00
Boshen
895d26ebf9
chore(coverage): update snapshot 2023-06-01 14:28:00 +08:00
Boshen
b6d9104a52
chore(coverage): remove catch_unwind
There's a stack overflow in one of the files, I think this is one of the cause?
2023-05-25 21:22:00 +08:00
Boshen
ad2835f11b
chore(rustfmt): run cargo fmt 2023-05-21 11:52:26 +08:00
Boshen
fc7a374e7c
feat(coverage): add a directory for tests
closes #363
2023-05-20 23:02:30 +08:00
Boshen
dc768ba8ad
feat(minifier): turn on mangle by default 2023-05-14 18:33:29 +08:00
Boshen
d14329e74e
feat(semantic2): bind identifiers 2023-05-13 22:58:42 +08:00
Boshen
1f5fa8d6cb
feat: reimplement semantic builder (#354) 2023-05-13 15:20:00 +08:00
Boshen
14720e7c69
refactor: move SourceType from oxc_ast to oxc_span (#351)
related #350
2023-05-12 23:16:14 +08:00
Boshen
7f93e58f10
chore: remove all #[must_use] 2023-05-11 21:08:00 +08:00
Boshen
48e524ddcf
feat(ast_lower): scope tree (#344) 2023-05-10 22:38:34 +08:00
Boshen
0a445b4556
chore(coverage): run typescript tests for formatter 2023-05-09 23:19:35 +08:00
Boshen
f4d04c1443
refactor(coverage): use ast.json() method for serialization test 2023-05-07 22:23:31 +08:00
Boshen
e897306f3d
chore(coverage): test serialization on ast and hir (#339) 2023-05-07 22:05:45 +08:00
Boshen
ddf4ac9cc2
refactor(formatter): remove whitespace minification from formatter (#337) 2023-05-07 17:58:57 +08:00
Boshen
c2428d8abd
chore: rename oxc_printer to oxc_formatter (#336) 2023-05-07 17:47:13 +08:00
Boshen
86c01c7fb8
feat(minifier): use hir (#335) 2023-05-07 17:23:00 +08:00
Boshen
72ba29f88b
feat(hir): complete first iteration of ast lowering (#327) 2023-05-06 19:13:44 +08:00
Boshen
7f946fb75d
chore: bump nightly to nightly-2023-04-20 (#304) 2023-04-20 23:35:38 +08:00
Boshen
92ba59443c
feat(tasks): add minifier coverage test (#292) 2023-04-17 21:30:04 +08:00
Boshen
f79f0eb631
refactor(oxc_ast): change SourceType::with_ methods to return Self 2023-04-16 21:32:00 +08:00
Boshen
6d96748e24
fix(coverage): do not run compiler tests in code coverage due to stack overflow 2023-04-15 18:24:38 +08:00