Skip to content

fix: Vite build cache issues around ESM modules and style leakage#1156

Open
rkaraivanov wants to merge 1 commit intocopilot/create-vite-samples-browserfrom
rkaraivanov/fix-vite-build-cache-issues
Open

fix: Vite build cache issues around ESM modules and style leakage#1156
rkaraivanov wants to merge 1 commit intocopilot/create-vite-samples-browserfrom
rkaraivanov/fix-vite-build-cache-issues

Conversation

@rkaraivanov
Copy link
Member

  • Modifed all samples to export a function that creates the sample, instead of exporting the sample directly. This allows us to create a new instance of the sample for each run, which is necessary to avoid caching issues with Vite.

  • Tag default styles and remove additional style tags from the document head to prevent style leakage between samples.

- Modifed all samples to export a function that creates the sample,
instead of exporting the sample directly. This allows us to create a new
instance of the sample for each run, which is necessary to avoid caching
issues with Vite.

- Tag default styles and remove additional style tags
from the document head to prevent style leakage between samples.
}

new Sample();
export function initialize() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The separate samples still have to be "initialized" in some way, otherwise the business logic is not executed. They are used for Codesandbox and this will make them unusable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g.

cd ./samples/grids/advanced-filtering-options/
npm install
npm run start

should bring up a working sample and it's doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants