Skip to content

Releases: web-infra-dev/rslib

v0.6.0

27 Mar 06:57
73d3bd1
Compare
Choose a tag to compare

Highlights ✨

This release brings exciting new features and improvements to Rslib:

  • New default library type for CJS: Rslib changes the default value of output.library.type for CJS from commonjs to commonjs-static. Now, individual exports will be set as properties on module.exports and the output can be statically analyzable, thus named exports are importable into ESM via Node.js. This is useful when source code is written in ESM and the output should be compatible with both CJS and ESM. (#819)

    Named exports are importable into ESM via Node.js

    • Input:
    export function doSomething() {}
    • Output:
    function doSomething() {}
    // …
    exports.doSomething = __webpack_exports__.doSomething;
    • Consumption (CJS):
    const { doSomething } = require('./output.cjs'); // doSomething => [Function: doSomething]
    • Consumption (ESM):
    import { doSomething } from './output.cjs'; // doSomething => [Function: doSomething]
  • Show code frame for type errors: Rslib now shows full context and code frame of tsc diagnostics in the terminal when generating declaration files. This makes it easier to understand and fix issues in the source code. (#847)

    image

What's Changed

New Features 🎉

  • feat!: change to commonjs-static library type of commonjs format by @fi3ework in #819

Bug Fixes 🐞

Document 📖

Other Changes

New Contributors

Full Changelog: v0.5.5...v0.6.0

v0.5.5

20 Mar 07:11
0a04981
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

Document 📖

Other Changes

  • test: refactor some style tests by @Timeless0911 in #837
  • chore(deps): update @rsbuild/core to v1.2.18 and fix snapshots by @chenjiahan in #839
  • chore(deps): update all patch dependencies by @renovate in #834
  • chore(deps): update Rsbuild to v1.2.19 by @chenjiahan in #845
  • chore(deps): update dependency @microsoft/api-extractor to ^7.52.1 by @renovate in #850
  • chore(deps): update dependency @module-federation/enhanced to ^0.11.0 by @renovate in #851
  • chore(deps): update dependency @module-federation/rsbuild-plugin to ^0.11.0 by @renovate in #852
  • chore(workflow): let renovate pin GitHub Action digests by @chenjiahan in #853
  • test: add cssModules namedExport test case by @SoonIter in #854
  • chore(deps): pin dependencies by @renovate in #855
  • test: fix unstable build --watch test by @Timeless0911 in #858
  • refactor: optimize dts logs and show codeblocks of tsc diagnostics by @Timeless0911 in #847
  • chore(deps): update all patch dependencies by @renovate in #849
  • chore(deps): update dependency nx to ^20.6.2 by @renovate in #863
  • chore(deps): update dependency babel-plugin-polyfill-corejs3 to ^0.12.0 by @renovate in #862
  • Release v0.5.5 by @Timeless0911 in #864

New Contributors

Full Changelog: v0.5.4...v0.5.5

v0.5.4

10 Mar 12:12
bbca050
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

Other Changes

  • chore(deps): update all patch dependencies by @renovate in #811
  • chore(deps): update dependency @module-federation/enhanced to ^0.10.0 by @renovate in #815
  • chore(deps): update dependency @module-federation/rsbuild-plugin to ^0.10.0 by @renovate in #816
  • refactor: optimize dts logs/docs with declaration files keyword by @Timeless0911 in #817
  • chore(deps): update all patch dependencies by @renovate in #822
  • chore(deps): update dependency @ast-grep/napi to ^0.36.0 by @renovate in #824
  • chore(deps): update dependency @playwright/test to v1.51.0 by @renovate in #825
  • chore(deps): update Rspress to v2.0.0-alpha.1 by @Timeless0911 in #826
  • chore(deps): update dependency nx to ^20.5.0 by @renovate in #827
  • chore(deps): update dependency zx to ^8.4.0 - autoclosed by @renovate in #828
  • Release v0.5.4 by @Timeless0911 in #832

Full Changelog: v0.5.3...v0.5.4

v0.5.3

03 Mar 08:28
3c59f9e
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

  • fix(svgr): ?url query should work in bundle mode by @SoonIter in #804
  • fix(bundleless, css): in target: 'node', empty js files(css transform) should be deleted by @SoonIter in #809

Document 📖

Other Changes

Full Changelog: v0.5.2...v0.5.3

v0.5.2

25 Feb 11:22
035f855
Compare
Choose a tag to compare

What's Changed

New Features 🎉

Bug Fixes 🐞

  • fix(shims): CJS shims should only affect chunk assets by @fi3ework in #787
  • fix: revert dtsEmitPath generate logic to respect output.distPath.root by @Timeless0911 in #788

Document 📖

Other Changes

  • chore(deps): update dependency @module-federation/enhanced to ^0.9.0 by @renovate in #790
  • chore(deps): update dependency create-rstack to v1.3.0 by @renovate in #792
  • chore(deps): update dependency @module-federation/rsbuild-plugin to ^0.9.0 by @renovate in #791
  • chore(deps): update all patch dependencies by @renovate in #782
  • chore(deps): update dependency storybook-addon-rslib to v1 by @renovate in #798
  • chore(deps): update dependency storybook-react-rsbuild to v1 by @renovate in #799
  • chore: modify README.zh-CN.md and update storybook monorepo to ^8.6.0 by @renovate in #800
  • Release v0.5.2 by @Timeless0911 in #801

Full Changelog: v0.5.1...v0.5.2

v0.5.1

21 Feb 08:24
2820e28
Compare
Choose a tag to compare

What's Changed

New Features 🎉

  • feat: warn if declarationDir or outDir is resolved outside project root by @Timeless0911 in #780

Bug Fixes 🐞

  • fix: redirect index file when redirect.dts.extension is enabled by @Timeless0911 in #778

Document 📖

Other Changes

Full Changelog: v0.5.0...v0.5.1

v0.5.0

19 Feb 09:52
b3cf9ea
Compare
Choose a tag to compare

Highlights ✨

This release brings exciting new features and improvements to Rslib:

  • Support DTS Redirect: Rslib now supports to control the redirect of the import paths in output TypeScript declaration files. (#742)

    • redirect.dts.path: Redirect the import path in the DTS output file to the corresponding relative path based on the compilerOptions.paths configured in tsconfig.json.
    // For `compilerOptions.paths` set to `{ "@/*": ["src/*"] }` in `tsconfig.json`
    import { foo } from '@/foo'; // source code of './src/bar.ts' ↓
    import { foo } from './foo'; // expected output of './dist/bar.d.ts'
    
    import { foo } from '@/foo'; // source code of './src/utils/index.ts' ↓
    import { foo } from '../foo'; // expected output './dist/utils/index.d.ts'
    • redirect.dts.extension: Redirect the import path in the DTS output file to the corresponding JavaScript extension which can be resolved to corresponding DTS file.
    // For `.d.mts` TypeScript Declaration files
    import { foo } from './foo'; // source code of './src/bar.ts' ↓
    import { foo } from './foo.mjs'; // expected output of './dist/bar.d.mts'
    
    import { foo } from './foo.ts'; // source code of './src/bar.ts' ↓
    import { foo } from './foo.mjs'; // expected output of './dist/bar.d.mts'
  • Support outBase in Bundleless Mode: When building a project where source files exist across multiple directories with bundleless mode, the output directory structure will be replicated relative to the outBase directory in the output directory, see lib.outBase for more details. (#745)

  • Add Documents about Assets: Documents related to asset module have been added for common scenarios in component library development, see Import static assets, Import SVGR and Import JSON files for more details. (#741)

  • Support pkg.pr.new: With pkg.pr.new, each of commits in main branch will trigger an instant preview release without publishing anything to NPM. This enables users to access features and bug-fixes without the need to wait for release cycles. (#766)

What's Changed

New Features 🎉

Bug Fixes 🐞

Document 📖

Other Changes

Full Changelog: v0.4.1...v0.5.0

v0.4.1

07 Feb 11:37
36dea47
Compare
Choose a tag to compare

What's Changed

New Features 🎉

  • feat(core): reexport "@rslib/core/types" from "@rsbuild/core/types" by @SoonIter in #739

Bug Fixes 🐞

  • fix(dts): correct tsconfig path not found error message by @fi3ework in #740

Document 📖

Other Changes

  • chore(deps): update dependency @rstack-dev/doc-ui to v1.6.0 by @renovate in #717
  • chore(deps): update dependency rslib to v0.4.0 by @renovate in #718
  • chore(deps): update dependency @rsbuild/plugin-node-polyfill to ^1.3.0 by @renovate in #719
  • chore(deps): update dependency create-rstack to v1.2.0 by @renovate in #722
  • chore(deps): update dependency nx to ^20.4.0 by @renovate in #723
  • chore(deps): update dependency rsbuild-plugin-publint to ^0.3.0 by @renovate in #724
  • ci(corepack): fix corepack key id mismatch by @Timeless0911 in #728
  • chore(deps): update all patch dependencies by @renovate in #726
  • chore(deps): update dependency ora to v8.2.0 by @renovate in #727
  • chore(deps): update dependency vitest to v3.0.5 [security] by @renovate in #731
  • chore(deps): update pnpm 10.2.0 by @Timeless0911 in #733
  • chore: update Node.js to v23.7.0 in .nvmrc for development by @Timeless0911 in #734
  • chore(deps): update all patch dependencies by @renovate in #736
  • Release v0.4.1 by @Timeless0911 in #743

New Contributors

Full Changelog: v0.4.0...v0.4.1

v0.4.0

27 Jan 08:27
14a0e06
Compare
Choose a tag to compare

Highlights ✨

This release brings exciting new features and improvements to Rslib:

  • Import Static Assets: Rslib now supports importing static assets like images (including SVG to React component conversion), fonts, audio, and video directly into your library code. This feature ensures correct outputs in both bundle and bundleless modes, making it easier than ever to develop libraries with static assets. (#684 #705)
  • Enhanced Bundleless Mode:
    • Supports emitting CSS source maps in bundleless mode. (#698)
    • Supports using Stylus within your bundleless libraries, expanding your styling options. (#707)
    • Supports adding banners and footers to CSS files in bundleless mode. (#712)

What's Changed

New Features 🎉

Bug Fixes 🐞

Document 📖

  • docs(QA): add how to external module in DTS by @fi3ework in #706

Other Changes

New Contributors

Full Changelog: v0.3.2...v0.4.0

v0.3.2

17 Jan 09:57
97c29aa
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

Document 📖

Other Changes

Full Changelog: v0.3.1...v0.3.2