Commit Graph

410 Commits

Author SHA1 Message Date
Boshen a55b9708c5 chore(deps): oxc-sourcemap v4.0 (#12347)
This release removes rayon support from oxc-sourcemap.

Parallelizing functions calls locally inside sourcemap generation is not optimal,
they interfere with thread scheduling with the rest of the system
2025-07-17 03:53:23 +00:00
oxc-bot ab68d5c7b4 release(crates): v0.77.1 (#12319) 2025-07-16 19:28:15 +08:00
oxc-bot 95b13e8c00 release(crates): v0.77.0 (#12234) 2025-07-12 10:15:34 +08:00
Dunqing bfd47f89b5 fix(transformer/styled-components): should use source path to generate file hash when the path is absoulte path (#12199)
related: https://github.com/oxc-project/oxc/issues/11876#issuecomment-3058036852
2025-07-11 04:54:35 +00:00
Dunqing 75ee3a17e5 feat(napi/transform): support enabling StyledComponent plugin (#12155) 2025-07-10 01:57:47 +00:00
Dunqing 19b97c06a3 feat(transformer): support styled components plugin (#12066)
close: #11876

This plugin adds comprehensive support for styled-components with server-side rendering, style minification, and enhanced debugging capabilities. The implementation is ported from the [official Babel plugin](https://github.com/styled-components/babel-plugin-styled-components) to ensure compatibility and feature parity.

## Current Limitations

⚠️ **Import Support**: This plugin currently only supports styled-components imported via ES modules (`import` statements). CommonJS imports using `require("styled-components")` are not yet supported.

## Feature Support

### Options:
 **✅ Fully Supported:**
 - `displayName`: Adds display names for debugging
 - `fileName`: Controls filename prefixing in display names
 - `ssr`: Adds unique component IDs for server-side rendering
 - `transpileTemplateLiterals`: Converts template literals to function calls
 - `minify`: Minifies CSS content in template literals
 - `namespace`: Adds namespace prefixes to component IDs
 - `meaninglessFileNames`: Controls which filenames are considered meaningless

 **⚠️ Partially Supported:**
 - `pure`: Only supports call expressions, not tagged template expressions (bundler limitation)

 **❌ Not Yet Implemented:**
 - `cssProp`: JSX css prop transformation
 - `topLevelImportPaths`: Custom import path handling

## Testing

The test suite is adapted from the [official Babel plugin tests](https://github.com/styled-components/babel-plugin-styled-components) with modifications to integrate with our testing infrastructure.

**Note**: Some test outputs differ from the original due to our different hashing algorithm for component IDs. This is intentional and follows the same approach used by SWC's implementation.
2025-07-10 00:39:52 +00:00
Boshen 407429a09c feat(napi/parser,napi/transform): accept lang=dts (#12154) 2025-07-09 09:13:18 +00:00
camc314 baa372641e refactor(tests/napi): add build-test script for tests (#12132) 2025-07-08 17:08:14 +00:00
oxc-bot 671b596ab1 release(crates): v0.76.0 (#12125) 2025-07-08 17:33:59 +08:00
Boshen 8b30a5bbd6 feat(codegen)!: introduce CommentOptions (#12114)
Control printing of comments more precisely via more options:

The logic change here is that jsdoc is no longer part of annotation
comments.

```rust
pub struct CommentOptions {
    /// Print normal comments that do not have special meanings.
    ///
    /// At present only statement level comments are printed.
    ///
    /// Default is `true`.
    pub normal: bool,

    /// Print jsdoc comments.
    ///
    /// * jsdoc: `/** jsdoc */`
    ///
    /// Default is `true`.
    pub jsdoc: bool,

    /// Print annotation comments.
    ///
    /// * pure: `/* #__PURE__ */` and `/* #__NO_SIDE_EFFECTS__ */`
    /// * webpack: `/* webpackChunkName */`
    /// * vite: `/* @vite-ignore */`
    /// * coverage: `v8 ignore`, `c8 ignore`, `node:coverage`, `istanbul ignore`
    ///
    /// Default is `true`.
    pub annotation: bool,

    /// Print legal comments.
    ///
    /// * starts with `//!` or `/*!`.
    /// * contains `/* @license */` or `/* @preserve */`
    ///
    /// Default is [LegalComment::Inline].
    pub legal: LegalComment,
}
```

closes #12030
related https://github.com/rolldown/tsdown/issues/357
2025-07-07 08:57:59 +00:00
oxc-bot a257d9732c release(crates): v0.75.1 (#12057) 2025-07-03 21:51:31 +08:00
oxc-bot d25dc35b19 release(crates): v0.75.0 (#11897) 2025-06-25 19:49:12 +08:00
oxc-bot 94a418d201 release(crates): v0.74.0 (#11853) 2025-06-23 13:27:08 +08:00
oxc-bot 3de6b99990 release(crates): v0.73.2 (#11785) 2025-06-18 13:23:17 +08:00
oxc-bot 14f7033f66 release(crates): v0.73.1 (#11774) 2025-06-17 21:17:38 +08:00
LongYinan 81ef44329f feat(napi): add aarch64-linux-android target (#11769)
- Close https://github.com/oxc-project/oxc/issues/11566
2025-06-17 15:46:41 +08:00
oxc-bot e7af8c470c release(crates): v0.73.0 (#11669) 2025-06-13 18:33:56 +08:00
Boshen b5a6a6e78f docs(napi): add stackblitz examples 2025-06-06 20:27:35 +08:00
oxc-bot 958849ca05 release(crates): v0.72.3 (#11504) 2025-06-06 15:40:07 +08:00
LongYinan ab0dd29a2b fix(napi): napi build cache problem (#11479) 2025-06-05 12:16:08 +08:00
Boshen 1401839036 feat(napi): add webcontainer fallback to transform and minify packages (#11471) 2025-06-04 08:11:01 +00:00
Boshen 0c2d1c1e80 Revert "chore(napi): upgrade to napi@3.0.0-beta.4" (#11474)
Reverts oxc-project/oxc#11466
2025-06-04 16:03:12 +08:00
LongYinan 81af6b3988 chore(napi): upgrade to napi@3.0.0-beta.4 (#11466)
Regenerate the binding files
2025-06-04 11:49:19 +08:00
oxc-bot 972c76572b release(crates): v0.72.2 (#11411) 2025-05-31 13:45:07 +08:00
oxc-bot 01a4647a18 release(crates): v0.72.1 (#11345) 2025-05-28 16:54:01 +08:00
oxc-bot 3efc25fdeb release(crates): v0.72.0 (#11267) 2025-05-24 14:53:50 +08:00
Boshen 9a2a6c6c37 chore(napi): remove --no-dts-cache 2025-05-20 15:20:12 +08:00
oxc-bot 4086e24083 release(crates): v0.71.0 (#11182) 2025-05-20 13:11:01 +08:00
Boshen d67c9e583b feat(napi): bump napi to beta (#11159) 2025-05-19 15:05:34 +00:00
Boshen 963167dc76 fix(napi): fix cfg feature on global_allocator 2025-05-15 22:20:42 +08:00
oxc-bot 58d2e6effe release(crates): v0.70.0 (#11061) 2025-05-15 21:55:38 +08:00
Boshen 635aa96219 fix(napi): computed final source type from lang then sourceType (#11060)
closes #10980

Previously final source type was only computed when `lang` is not set.

It is changed to:

* compute source type from `lang`, use filename extension if `lang` is
not set
* reset the computed source type with 'script` or `module` if provided
2025-05-15 21:41:42 +08:00
Boshen 584d8b93b7 fix(napi): enable mimalloc no_opt_arch feature on linux aarch64 (#11053)
fixes #11045

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-15 17:09:43 +08:00
Boshen 2787193e7f chore(napi): adjust test commands (#11021)
so we can run `pnpm run test -u`
2025-05-14 04:04:52 +00:00
Bernd Storath 647b6f3177 feat(napi): add arm musl (#10958)
closes #10954

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2025-05-12 20:13:58 +08:00
oxc-bot 2b890aba8f release(crates): v0.69.0 (#10925) 2025-05-10 00:06:12 +08:00
Dunqing 6de0bc29bd feat(transformer/typescript): support transforming class fields into this assignment (#10854)
Close https://github.com/oxc-project/oxc/issues/10649
2025-05-09 08:43:13 +00:00
Boshen 22ba60b6c4 feat(napi): add s390x-unknown-linux-gnu build (#10892) 2025-05-08 20:13:41 +08:00
Boshen 308fe732d9 feat(napi): add x86_64-unknown-freebsd and riscv64gc-unknown-linux-gnu builds (#10886)
closes #10822
2025-05-08 18:26:22 +08:00
oxc-bot e6074275ae release(crates): v0.68.1 (#10796) 2025-05-05 00:53:44 +08:00
oxc-bot 61dfcfdfd8 release(crates): v0.68.0 (#10777) 2025-05-04 09:06:24 +08:00
overlookmotel 88249f77f0 perf(napi/transform): do not create temp String (#10752)
Avoid an allocation. `to_string` here clones a `String` and then immediately converts it back to a `&str`. Avoid that intermediate allocation.
2025-05-01 13:38:01 +00:00
Boshen 315143ae42 refactor(codegen)!: remove useless CodeGenerator type alias (#10702) 2025-04-29 17:01:07 +00:00
Boshen 4795059eed fix(transformer_plugins): provide reference data when identifiers are replaced (#10620)
closes #10577
fixes https://github.com/rolldown/rolldown/issues/4261
2025-04-29 04:52:29 +00:00
oxc-bot 7cf80ef7fd release(crates): v0.67.0 (#10637) 2025-04-27 22:30:07 +08:00
Boshen 1962bc67d4 feat(transformer_plugins): split out oxc_transformer_plugins crate (#10617) 2025-04-25 08:39:56 +00:00
Dunqing 42ca96a81d feat(transformer, napi/transform): deprecate allowDeclareFields option (#10584)
After the `removeClassFieldsWithoutInitializer` option is supported, `allowDeclareFields` is no longer needed. More detail see https://github.com/oxc-project/oxc/pull/10491#issuecomment-2826008849
2025-04-25 01:30:22 +00:00
Dunqing 73cd730651 docs(transformer): add documentation for CompilerAssumptions::set_public_class_fields (#10582)
The documentation copy from [Babel](https://babeljs.io/docs/assumptions#setpublicclassfields), and added some documentation about `useDefineForClassFields: false` support
2025-04-25 01:30:22 +00:00
Dunqing b8414dbfb9 feat(napi/transform): support enabling removeClassFieldsWithoutInitializer (#10581)
Support passing `removeClassFieldsWithoutInitializer` by `oxc-transform` usage
2025-04-25 01:30:21 +00:00
Dunqing 6bff64ee77 feat(transformer/typescript): support removeClassFieldsWithoutInitializer option (#10576)
* close #9192
* close #10491

We've discussed adding `removeClassFieldsWithoutInitializer` option to support removing class fields without an initializer in https://github.com/oxc-project/oxc/pull/10491#issuecomment-2823195571. This is used to align the`TypeScript`'s `useDefineForClassFields: false` option.
2025-04-25 01:30:21 +00:00