Commit graph

147 commits

Author SHA1 Message Date
Jon Surrell
cb804d3cd2
Add base to AST BigintLiteral (#1416) 2023-11-19 11:11:19 +08:00
Boshen
ba603cebb9
Release Oxc v0.3.0 2023-11-06 19:11:16 +08:00
Boshen
06efb77d57
chore(minifier): add --whitespace option to example 2023-10-20 11:33:53 +08:00
Boshen
678db1d955
feat(transformer): ES2020 Nullish Coalescing Operator (#1004)
The test runner needs an update for reading options.jon, which I'll work
on in the up coming PR.
2023-10-16 21:45:58 +08:00
Wenzhe Wang
0e9104477f
feat: adjust the order of print semicolon (#1003)
Add a number of semicolons to our minifier test cases.
2023-10-16 21:33:15 +08:00
Boshen
db5417f9a9
refactor(clippy): allow clippy::too_many_lines 2023-10-16 15:18:11 +08:00
Boshen
eaeb63072f
refactor(clippy): allow struct_excessive_bools 2023-10-16 15:18:07 +08:00
Boshen
110059ffb7
refactor(rust): change RefCell.clone().into_inner() to RefCell.get() 2023-10-16 11:26:38 +08:00
Boshen
0f72066f2e
feat(transformer): finish 2016 exponentiation operator (#996) 2023-10-16 09:30:04 +08:00
Boshen
47872200e5
refactor(ast): clean up some methods 2023-10-15 10:49:35 +08:00
Boshen
2e2b7587ac
feat(playground): add transform and minify (#993) 2023-10-14 19:49:58 +08:00
Boshen
801d78a3c6
refactor(minifier): make the minifier api only accept an ast (#990) 2023-10-14 00:51:29 +08:00
Boshen
e0ca09b1c9
feat(codegen): implement the basics of non-minifying codegen (#987) 2023-10-13 13:34:21 +08:00
Boshen
efad0fce2d
deps(rust): bump deps 2023-10-12 21:03:17 +08:00
Boshen
ce79bc12ab
feat(transform_conformance): move Formatter to codegen (#986) 2023-10-12 15:13:14 +08:00
Boshen
809f050a5f
feat(codegen): move minifying printer to codegen crate (#985) 2023-10-12 14:56:30 +08:00
Boshen
903854dac0
refactor(ast): fix the lifetime annotations around Vist and VisitMut (#973) 2023-10-10 17:05:48 +08:00
Boshen
ef8aaa7bf1
feat(minifier): re-enable mangler (#972) 2023-10-10 14:32:58 +08:00
Boshen
14e1dacd0a
feat(minifier): reenable minifier tests (#969) 2023-10-09 11:25:29 +08:00
Boshen
f0029d5310 feat(minifier): reenable mangler
closes #952
closes #955
2023-10-09 09:59:14 +08:00
Boshen
55b2f031df
feat(minifier): partially re-enable minifier (#963)
closes #949
closes #950
closes #951

All minifier tests are disable from this PR.

We are going to fix the compilation errors first, then the behavioral
errors.
2023-10-08 11:06:42 +08:00
Boshen
817f8c295e
ci: turn off doc tests because they are slow to compile and run (#961) 2023-10-07 17:01:23 +08:00
Cameron
5b1e1e5408
feat(parser): TypeScript 5.2 (#811)
- adds support for [Using
Declarations](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management)

Closes #786
2023-10-05 12:52:14 +13:00
Boshen
38bbc96fb0
Release oxc v0.2.0 2023-09-14 23:41:44 +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
93adc9b9c2
Release oxc v0.1.3 2023-09-03 12:22:05 +08:00
Boshen
37bf4c4421
Release oxc v0.1.2 2023-09-03 11:30:44 +08:00
Boshen
1f27426570
Release crates as v0.1.1 2023-08-26 17:53:11 +08:00
Boshen
5152b39b17
chore: clean up Cargo.toml with cargo machete (#767) 2023-08-20 15:29:09 +08:00
Yunfei He
35167599bc
refactor(ast): use atom for Directive and Hashbang (#701)
The main reason is using Atom to remove the lifetime for convenience.

And after removing the lifetime of these nodes, the `Program<'a>`
doesn't rely on `&'a source` anymore, which allows us to [specify more
accurate
lifetimes](https://github.com/web-infra-dev/oxc/discussions/700).
2023-08-09 13:52:56 +08:00
Makoto Tateno
c5ff534b08
feat(semantic): add node_id to Reference (#689)
Closes #685 

Intend to use this in the following ways in #672.
```rs
let node = ctx.nodes().get_node(reference.node_id());
if !self.type_of && has_typeof_operator(node, ctx) {
    return;
}
```
2023-08-05 12:45:22 +08:00
阿良仔
e090b560be
feat(minifier): initialize conditions folding (#658)
related: #401
2023-07-30 01:02:32 +08:00
Boshen
1012d8300c
chore: release crates as v0.1.0 2023-07-27 13:54:17 +08:00
Boshen
d587065436
chore(rust): update crate info, add minimal rust-version, add categories 2023-07-27 13:33:18 +08:00
Boshen
fa82f940f0 chore: stable Rust
closes #626
2023-07-27 13:11:46 +08:00
Boshen
b34ef4f07a chore: reformat 2023-07-27 13:11:46 +08:00
Boshen
f2df32d1c0
fix(taplo): adjust the include glob so it doesn't time out searching for files 2023-07-27 12:30:34 +08:00
Matthew "strager" Glazar
318d55806f refactor: format code
Removing uses of let_chains now allows rustfmt to format some files.
Run 'cargo fmt' to reformat these files.
2023-07-27 09:44:57 +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
Sg
fbb8aa3338
refactor: remove unstable feature const_trait_impl & const_slice_index & slice_group_by (#629) 2023-07-26 17:37:09 +08:00
Don Isaac
87e65ac0f7
refactor(semantic): symbol declarations and references (#594) 2023-07-24 10:55:56 +08:00
阿良仔
3c76cef11c
feat(minifier): fold NaN comparison (#580) 2023-07-21 11:00:21 +08:00
阿良仔
3cbec3459a
test: add tests for boolean related comparison (#563) 2023-07-17 20:55:42 +08:00
Don Isaac
2591194dba
feat(minifier): drop console statements and exprs (#552) 2023-07-16 14:41:51 +08:00
阿良仔
c09678a48f
test: add tests for null comparison (#548) 2023-07-14 23:25:25 +08:00
Boshen
38e11956be
chore(rust): rust version 1.71.0 nightly 2023-07-13 23:10:10 +08:00
阿良仔
db3ef449fc
test(minifier): add tests for bigint string comparison (#541) 2023-07-13 11:44:03 +08:00
阿良仔
f0495ef924
feat(minifier): fold string number comparison (#538) 2023-07-11 21:50:51 +08:00
阿良仔
2d984f0401
feat(minifier): fold bigint number comparison (#536) 2023-07-10 23:11:28 +08:00
Don Isaac
fd899be4a9
feat(minifier): compress undefined variable declarations (#532) 2023-07-10 10:33:42 +08:00