Skip to content

Conversation

@SoonIter
Copy link
Member

@SoonIter SoonIter commented Feb 24, 2025

Summary

web-infra-dev/rsbuild#2862

  1. @theme is for customizing the theme, but it causes circular dependencies which breaks the ssg rendering
image
  1. remove some barrel files to govern esm exports, logic/index.ts and components/index.ts

THIS IS A BREAKING CHANGE

if you want to customize HomeLayout, please use below:

before

import Theme from 'rspress/theme';

const Layout = () => <Theme.Layout beforeNavTitle={<div>some content</div>} />;

export default {
  ...Theme,
  Layout,
};

export * from 'rspress/theme';

after

import { Layout as BasicLayout } from 'rspress/theme';

const Layout = () => <BasicLayout beforeNavTitle={<div>some content</div>} />;

// use named export, no need to `export default`
export { Layout };

export * from 'rspress/theme';

Related Issue

Pages render error: ReferenceError: Cannot access 'src_rslib_entry ' before initialization

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Feb 24, 2025

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
🔨 Latest commit 1b7142f
🔍 Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/67c6f7222d62900008929d09
😎 Deploy Preview https://deploy-preview-1873--aquamarine-blini-95325f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 67 (🔴 down 25 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@SoonIter SoonIter marked this pull request as draft February 24, 2025 06:52
@SoonIter SoonIter force-pushed the syt/theme/circular-dep branch from 275b4e6 to 7b42345 Compare February 24, 2025 07:09
@SoonIter SoonIter changed the title fix(theme): circular dependencies fix(theme)!: circular dependencies Feb 24, 2025
@SoonIter SoonIter changed the title fix(theme)!: circular dependencies fix(theme)!: use named export, no import Theme from 'rspress/theme', circular dependencies Feb 24, 2025
@SoonIter SoonIter changed the title fix(theme)!: use named export, no import Theme from 'rspress/theme', circular dependencies fix(theme)!: circular dependencies, use named export instead of default export Feb 24, 2025
@SoonIter SoonIter changed the title fix(theme)!: circular dependencies, use named export instead of default export feat(theme)!: circular dependencies, use named export instead of default export Feb 24, 2025
@SoonIter SoonIter changed the title feat(theme)!: circular dependencies, use named export instead of default export feat(theme)!: use named export instead of default export, for circular dependencies Feb 24, 2025
@SoonIter SoonIter changed the title feat(theme)!: use named export instead of default export, for circular dependencies feat(theme)!: use named export instead of default export, for circular imports Feb 24, 2025
@SoonIter SoonIter marked this pull request as ready for review February 24, 2025 08:01
@SoonIter SoonIter mentioned this pull request Feb 27, 2025
10 tasks
@SoonIter SoonIter force-pushed the syt/theme/circular-dep branch from b11f016 to 8eb5325 Compare March 2, 2025 05:39
@netlify
Copy link

netlify bot commented Mar 2, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 1b7142f
🔍 Latest deploy log https://app.netlify.com/sites/rspress-v2/deploys/67c6f7222d62900008929d0b
😎 Deploy Preview https://deploy-preview-1873--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@SoonIter SoonIter force-pushed the syt/theme/circular-dep branch from 1bff745 to 1b7142f Compare March 4, 2025 12:50
@SoonIter SoonIter merged commit d6612a3 into main Mar 5, 2025
11 checks passed
@SoonIter SoonIter deleted the syt/theme/circular-dep branch March 5, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants