JetBrains / react-buddy-ide-toolbox

@react-buddy/ide-toolbox and palette packages
Apache License 2.0
60 stars 5 forks source link

Lazy loading of previews and palette #7

Closed karandashovrz closed 1 year ago

karandashovrz commented 2 years ago

Motivation: DevSupport component is wrapper for root component like App. It's mean that code with Previews and Palettes will be get to main bundle. It's very unwantend side effect, because bundle must not include third-party code. To resolve this issue, need to work with ComponentPreviews as component, which is imported by react lazy import. This will provide code storage in separate chunk and its loading only in devmode.