overlookmotel
be4642fc02
feat(semantic): transform checker check child scope IDs ( #5410 )
...
Transform checker check child scope IDs. If we have to track child scope IDs, we should make sure they're correct!
2024-09-03 00:57:13 +00:00
Boshen
e75e0f1465
chore: update test262 / babel / typescript submodules ( #5369 )
...
closes #5215
2024-08-31 12:28:25 +00:00
overlookmotel
af5713e411
refactor(semantic): transform checker continue checks if missing IDs ( #5259 )
...
Transform checker don't bail out if some IDs missing from AST. Continue to check for other problems.
Also simplify iterating over pairs of IDs.
2024-08-27 11:58:20 +00:00
Boshen
c96609151e
fix(coverage): fix cases where source_type is incorrectly set to script
2024-08-24 14:40:05 +08:00
Boshen
e4ca3d3901
chore(coverage): ignore annex-b/disabled tests
2024-08-24 14:20:06 +08:00
Boshen
12c21b2bfd
fix(coverage): do not run generated test cases when filter is applied
2024-08-24 14:03:54 +08:00
Boshen
afe728a73a
feat(parser): parse regular expression with regex parser ( #4998 )
...
Many false positives and incorrect errors. @leaysgur Enjoy 😁
Run `just conformance` to update the snapshot.
2024-08-22 03:09:55 +00:00
overlookmotel
ee7ac8b0b7
refactor(semantic): store all data in PostTransformChecker in transform checker ( #5050 )
...
Pure refactor of transform checker. Store all scope data in `PostTransformChecker` so it doesn't need to be passed around. `SemanticData` contains a full set of all semantic data for semantic pass, so we have 2 instances of it for 1. after transform and 2. rebuilt semantic.
2024-08-21 17:04:48 +00:00
overlookmotel
4e1f4abf89
refactor(semantic): add SemanticIds to transformer checker ( #5048 )
...
Transformer checker use `SemanticIds` to store collected IDs. `SemanticIds` only contains the IDs, without the `Vec` of errors which is only used temporarily.
2024-08-21 15:49:07 +00:00
Boshen
1bd9365bd0
fix(coverage): correctly check semantic data after transform ( #5035 )
...
closes #4999
2024-08-21 09:35:04 +00:00
Boshen
b4407c4e9a
refactor(oxc,mangler): oxc crate add mangler; mangler use options API
2024-08-20 22:58:59 +08:00
Boshen
cd9cf5efd8
refactor(oxc): remove remove_whitespace
2024-08-20 18:27:59 +08:00
Boshen
1f6b107339
chore(coverage): ignore test262 stage3 json-modules ( #5002 )
...
stage 3 https://github.com/tc39/proposal-json-modules
Ignoring due to https://github.com/tc39/proposal-json-modules/issues/27
2024-08-20 08:50:27 +00:00
Boshen
b2ff2df5af
refactor(parser)!: remove builder pattern from Parser struct ( #5000 )
...
part of #4455
use `with_options(ParseOptions { ..ParseOptions::default() })` API instead.
2024-08-20 07:40:25 +00:00
Boshen
3f6014a042
chore(semantic): add PostTransformChecker ( #4967 )
2024-08-19 05:38:27 +00:00
Boshen
6800e694e3
feat(oxc): add Compiler and CompilerInterface ( #4954 )
...
This PR adds a full compiler pipeline to the `oxc` crate, to stop us
from implementing the same pipeline over and over again.
relates #4455
2024-08-19 10:20:05 +08:00
Boshen
c7a86865f3
fix(coverage): handle transformer errors
2024-08-18 22:19:58 +08:00
Boshen
873d502993
refactor(coverage): use the oxc crate
2024-08-17 22:40:08 +08:00
Boshen
bea76f0f24
fix(coverage): fix babel cases
2024-08-17 11:22:00 +08:00
Boshen
81439403fd
chore(coverage): print path relative to snapshot file ( #4938 )
...
Ctrl + click in terminal can open the file with this change.
I don't know about vscode, but maybe a plugin can help?
<img width="1399" alt="image" src="https://github.com/user-attachments/assets/9bb4609b-14e9-4df8-b5ee-cb96b72b2f7d ">
<img width="1131" alt="image" src="https://github.com/user-attachments/assets/e0293693-f755-4b91-8712-bbd2a0e615cc ">
2024-08-17 03:09:25 +00:00
Boshen
7ecf0efd40
chore(coverage): remove arrow functions plugin from semantic check
2024-08-16 19:12:17 +08:00
Boshen
61cdfef5c7
chore(coverage): remove quotes around path from snapshot files
...
to make it easier to triple click and copy the path
2024-08-16 16:03:50 +08:00
Boshen
c220730779
feat(coverage): check symbols and scopes after transformation ( #4917 )
...
closes https://github.com/oxc-project/oxc/issues/4790
@overlookmotel enjoy ... take a look at the snapshots and probably nothing else.
The snapshots are minimal right now, but it's already showing symbols from import specifiers are not being removed. We can iterate on the snapshot representation to aid debugging later.
I'll extend this to `transformer_conformance` and `oxc-monitor` in an up coming PR.
2024-08-16 07:05:11 +00:00
Boshen
34aa93bda3
feat(coverage): add checker for correctness of semantic data ( #4908 )
...
Part of https://github.com/oxc-project/oxc/issues/4790
2024-08-15 04:46:07 +00:00
Boshen
117ae36775
refactor(coverage): add driver struct for adding common checks later ( #4893 )
2024-08-14 11:11:13 +00:00
Boshen
2afccd75fb
refactor(coverage): move tools into src/tools/
2024-08-14 15:44:03 +08:00
Boshen
e78cba6464
refactor(minifier): ast passes infrastructure ( #4625 )
...
After studying google closure compiler, I'm leaning towards a multi-ast-pass infrastructure for the minifier.
This is one of the few places where we are going to trade maintainability over performance, given the goal of the minifier is compression size not performance.
All of the terminologies and separation of concerns are aligned with google closure compiler.
Infrastructure of `terser` and `esbuild` are not suitable for us to study nor pursuit. Their code are so tightly coupled - I failed to comprehend any of them every time I try to walk through a piece of optmization. Google closure compiler despite being written in Java, it's actually the most readable minifier out there.
To improve performance between ast passes, I envision a change detection system over a portion of the code.
The benchmark will demonstrate the performance regression of running 5 ast passes instead of 2.
To complete this PR, I need to figure out "fix-point" and order of these ast passes.
2024-08-04 11:58:39 +00:00
Boshen
107e57019c
feat(coverage): run multi-file typescript tests ( #4256 )
...
The code is really ugly because I didn't anticipate multi-test files from typescript when I started writing the runner :-(
2024-07-16 06:15:04 +00:00
Boshen
ca0b4fa08a
refactor(tasks): clean up test files and remove libs.txt ( #4172 )
2024-07-10 17:38:06 +00:00
Luca Bruno
5731e3957f
refactor(ast)!: store span details inside comment struct ( #4132 )
...
This tweaks `Comment` definition in order to internally store the start
and end position of its span.
Closes: https://github.com/oxc-project/oxc/issues/4069
2024-07-09 23:23:43 +08:00
Boshen
6e5447e5d5
chore(coverage): add test for huge binary expression and nested if statements ( #4084 )
...
relates https://github.com/oxc-project/backlog/issues/58
2024-07-08 00:15:26 +08:00
Dunqing
dc8e2b8dc0
feat(coverage/transpile): compare error message ( #3789 )
2024-06-20 10:13:36 +00:00
Boshen
4e9d8a5585
chore: fix some nightly clippy warnings
2024-06-19 00:53:58 +08:00
Boshen
051ceb6539
chore: improve some format by running cargo +nightly fmt
2024-06-19 00:48:30 +08:00
Boshen
5c38a0fd69
feat(codegen)!: new code gen API ( #3740 )
...
This PR introduces two type alias to avoid the confusing const generic `pub struct Codegen<'a, const MINIFY: bool>`
* CodeGenerator - Code generator without whitespace removal.
* WhitespaceRemover - Code generator with whitespace removal.
Usage is changed to a builder pattern:
```rust
CodeGenerator::new()
.enable_comment(...)
.enable_sourcemap(...)
.build(&program);
```
2024-06-18 15:50:12 +00:00
Boshen
bf9b38a197
feat(codegen): improve codegen formatting ( #3731 )
2024-06-18 04:14:10 +00:00
Boshen
41b3c24f98
feat(coverage): snapshot isolated declarations dts emit ( #3723 )
2024-06-17 18:31:03 +00:00
Dunqing
889198ae60
fix(coverage/transpiler): diff comparison results are reversed ( #3727 )
...
<img width="963" alt="image" src="https://github.com/oxc-project/oxc/assets/29533304/fbec74bc-e06e-42f3-9963-f2fdce3ae784 ">
2024-06-17 16:47:05 +00:00
Boshen
0b8098a442
feat(napi): isolated-declaration ( #3718 )
2024-06-17 13:06:00 +00:00
Boshen
815260ed2f
refactor(isolated-declarations): decouple codegen ( #3715 )
2024-06-17 11:45:29 +00:00
Boshen
87c3282deb
chore(transformer-dts): change crate to oxc_isolated_declarations ( #3713 )
2024-06-17 11:14:13 +00:00
Boshen
982e6f08df
chore: make println and eprintln opt-in ( #3712 )
...
I noticed accidental `println` can be merged, which isn't really nice.
2024-06-17 10:40:34 +00:00
Boshen
da1e2d0e9b
fix(codegen): improve typescript codegen ( #3708 )
...
Remaining issues are tracked in https://github.com/oxc-project/oxc/issues/3692
2024-06-17 09:34:54 +00:00
Boshen
750a534455
feat(coverage): transformer idempotency test ( #3691 )
2024-06-15 13:59:53 +00:00
Boshen
568b6479ae
feat(coverage): use oxc printend text for comparing dts transform ( #3686 )
2024-06-15 11:00:16 +00:00
Boshen
4f166642a0
refactor(transformer_dts): create a Program for codegen ( #3679 )
2024-06-15 05:44:25 +00:00
Boshen
eff9cff048
feat(coverage): add dts transform coverage test ( #3675 )
2024-06-14 14:29:27 +00:00
Boshen
534242a729
feat(codegen)!: remove CodegenOptions::enable_typescript ( #3674 )
...
The typescript transform pass is now required to strip typescript syntax
for codegen to print things properly.
Codegen will now print whatever is in the AST.
2024-06-14 21:56:00 +08:00
renovate
c1b34ff011
chore(deps): update dependency rust to v1.79.0 ( #3661 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [rust](https://togithub.com/rust-lang/rust ) | minor | `1.78.0` -> `1.79.0` |
---
### Release Notes
<details>
<summary>rust-lang/rust (rust)</summary>
### [`v1.79.0`](https://togithub.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1790-2024-06-13 )
[Compare Source](https://togithub.com/rust-lang/rust/compare/1.78.0...1.79.0 )
\==========================
<a id="1.79.0-Language"></a>
## Language
- [Stabilize inline `const {}` expressions.](https://togithub.com/rust-lang/rust/pull/104087/ )
- [Prevent opaque types being instantiated twice with different regions within the same function.](https://togithub.com/rust-lang/rust/pull/116935/ )
- [Stabilize WebAssembly target features that are in phase 4 and 5.](https://togithub.com/rust-lang/rust/pull/117457/ )
- [Add the `redundant_lifetimes` lint to detect lifetimes which are semantically redundant.](https://togithub.com/rust-lang/rust/pull/118391/ )
- [Stabilize the `unnameable_types` lint for public types that can't be named.](https://togithub.com/rust-lang/rust/pull/120144/ )
- [Enable debuginfo in macros, and stabilize `-C collapse-macro-debuginfo` and `#[collapse_debuginfo]`.](https://togithub.com/rust-lang/rust/pull/120845/ )
- [Propagate temporary lifetime extension into `if` and `match` expressions.](https://togithub.com/rust-lang/rust/pull/121346/ )
- [Restrict promotion of `const fn` calls.](https://togithub.com/rust-lang/rust/pull/121557/ )
- [Warn against refining impls of crate-private traits with `refining_impl_trait` lint.](https://togithub.com/rust-lang/rust/pull/121720/ )
- [Stabilize associated type bounds (RFC 2289).](https://togithub.com/rust-lang/rust/pull/122055/ )
- [Stabilize importing `main` from other modules or crates.](https://togithub.com/rust-lang/rust/pull/122060/ )
- [Check return types of function types for well-formedness](https://togithub.com/rust-lang/rust/pull/115538 )
- [Rework `impl Trait` lifetime inference](https://togithub.com/rust-lang/rust/pull/116891/ )
- [Change inductive trait solver cycles to be ambiguous](https://togithub.com/rust-lang/rust/pull/122791 )
<a id="1.79.0-Compiler"></a>
## Compiler
- [Define `-C strip` to only affect binaries, not artifacts like `.pdb`.](https://togithub.com/rust-lang/rust/pull/115120/ )
- [Stabilize `-Crelro-level` for controlling runtime link hardening.](https://togithub.com/rust-lang/rust/pull/121694/ )
- [Stabilize checking of `cfg` names and values at compile-time with `--check-cfg`.](https://togithub.com/rust-lang/rust/pull/123501/ )
*Note that this only stabilizes the compiler part, the Cargo part is still unstable in this release.*
- [Add `aarch64-apple-visionos` and `aarch64-apple-visionos-sim` tier 3 targets.](https://togithub.com/rust-lang/rust/pull/121419/ )
- [Add `riscv32ima-unknown-none-elf` tier 3 target.](https://togithub.com/rust-lang/rust/pull/122696/ )
- [Promote several Windows targets to tier 2](https://togithub.com/rust-lang/rust/pull/121712 ): `aarch64-pc-windows-gnullvm`, `i686-pc-windows-gnullvm`, and `x86_64-pc-windows-gnullvm`.
Refer to Rust's \[platform support page]\[platform-support-doc]
for more information on Rust's tiered platform support.
<a id="1.79.0-Libraries"></a>
## Libraries
- [Implement `FromIterator` for `(impl Default + Extend, impl Default + Extend)`.](https://togithub.com/rust-lang/rust/pull/107462/ )
- [Implement `{Div,Rem}Assign<NonZero<X>>` on `X`.](https://togithub.com/rust-lang/rust/pull/121952/ )
- [Document overrides of `clone_from()` in core/std.](https://togithub.com/rust-lang/rust/pull/122201/ )
- [Link MSVC default lib in core.](https://togithub.com/rust-lang/rust/pull/122268/ )
- [Caution against using `transmute` between pointers and integers.](https://togithub.com/rust-lang/rust/pull/122379/ )
- [Enable frame pointers for the standard library.](https://togithub.com/rust-lang/rust/pull/122646/ )
<a id="1.79.0-Stabilized-APIs"></a>
## Stabilized APIs
- [`{integer}::unchecked_add`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_add )
- [`{integer}::unchecked_mul`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_mul )
- [`{integer}::unchecked_sub`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_sub )
- [`<[T]>::split_at_unchecked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_unchecked )
- [`<[T]>::split_at_mut_unchecked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked )
- [`<[u8]>::utf8_chunks`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.utf8\_chunks )
- [`str::Utf8Chunks`](https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunks.html )
- [`str::Utf8Chunk`](https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunk.html )
- [`<*const T>::is_aligned`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned )
- [`<*mut T>::is_aligned`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned-1 )
- [`NonNull::is_aligned`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_aligned )
- [`<*const [T]>::len`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len )
- [`<*mut [T]>::len`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len-1 )
- [`<*const [T]>::is_empty`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty )
- [`<*mut [T]>::is_empty`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty-1 )
- [`NonNull::<[T]>::is_empty`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_empty )
- [`CStr::count_bytes`](https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes )
- [`io::Error::downcast`](https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.downcast )
- [`num::NonZero<T>`](https://doc.rust-lang.org/stable/core/num/struct.NonZero.html )
- [`path::absolute`](https://doc.rust-lang.org/stable/std/path/fn.absolute.html )
- [`proc_macro::Literal::byte_character`](https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.byte_character )
- [`proc_macro::Literal::c_string`](https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.c_string )
These APIs are now stable in const contexts:
- [`Atomic*::into_inner`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.into_inner )
- [`io::Cursor::new`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.new )
- [`io::Cursor::get_ref`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_ref )
- [`io::Cursor::position`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.position )
- [`io::empty`](https://doc.rust-lang.org/stable/std/io/fn.empty.html )
- [`io::repeat`](https://doc.rust-lang.org/stable/std/io/fn.repeat.html )
- [`io::sink`](https://doc.rust-lang.org/stable/std/io/fn.sink.html )
- [`panic::Location::caller`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.caller )
- [`panic::Location::file`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file )
- [`panic::Location::line`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.line )
- [`panic::Location::column`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.column )
<a id="1.79.0-Cargo"></a>
## Cargo
- [Prevent dashes in `lib.name`, always normalizing to `_`.](https://togithub.com/rust-lang/cargo/pull/12783/ )
- [Stabilize MSRV-aware version requirement selection in `cargo add`.](https://togithub.com/rust-lang/cargo/pull/13608/ )
- [Switch to using `gitoxide` by default for listing files.](https://togithub.com/rust-lang/cargo/pull/13696/ )
- [Error on `[project]` in Edition 2024; `cargo fix --edition` will change it to `[package]`.](https://togithub.com/rust-lang/cargo/pull/13747/ )
<a id="1.79.0-Rustdoc"></a>
## Rustdoc
- [Always display stability version even if it's the same as the containing item.](https://togithub.com/rust-lang/rust/pull/118441/ )
- [Show a single search result for items with multiple paths.](https://togithub.com/rust-lang/rust/pull/119912/ )
- [Support typing `/` in docs to begin a search.](https://togithub.com/rust-lang/rust/pull/123355/ )
<a id="1.79.0-Misc"></a>
## Misc
<a id="1.79.0-Compatibility-Notes"></a>
## Compatibility Notes
- [Update the minimum external LLVM to 17.](https://togithub.com/rust-lang/rust/pull/122649/ )
- [`RustcEncodable` and `RustcDecodable` are soft-destabilized, to be removed
from the prelude in next edition.](https://togithub.com/rust-lang/rust/pull/116016/ )
- [The `wasm_c_abi` future-incompatibility lint will warn about use of the
non-spec-compliant C ABI.](https://togithub.com/rust-lang/rust/pull/117918/ )
Use `wasm-bindgen v0.2.88` to generate forward-compatible bindings.
- [Check return types of function types for well-formedness](https://togithub.com/rust-lang/rust/pull/115538 )
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View repository job log [here](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2024-06-14 02:28:06 +00:00
Boshen
7f8dd24d6a
chore: fix cargo doc
2024-06-14 09:21:14 +08:00