Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: vanilla extract compatibility and better css handling #171

Closed
wants to merge 5 commits into from

Conversation

Aslemammad
Copy link
Contributor

Resolves #59

  • rscHmrPlugin now does not inject to every file
  • importing CSS files did not work properly, this would fix it
  • in waku's plugins, vite.config.ts plugins were not being used, now they're being imported using vite's resolveConfig
    • For now, we only get the plugins, it's better that in the future, we read the whole config and use it using mergeConfig. I tried doing this but it did not work properly.

Copy link

vercel bot commented Nov 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ❌ Failed (Inspect) Nov 20, 2023 4:01pm


import { loadServerFile } from '/Users/alibaba/oss/waku/packages/waku/dist/lib/middleware/rsc/ssr.js';
const { Counter } = await loadServerFile('/Users/alibaba/oss/waku/examples/12_css/src/components/Counter.tsx', 'dev');
export { Counter }
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove .temp-* files.

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
vanillaExtractPlugin
const collectCssUrls = (mods: Set<ModuleNode>, styles: Map<string, string>) => {
for (const mod of mods) {
if (mod.ssrModule && mod.file && mod.id) {
if (mod.file.endsWith('.css') || /\?vue&type=style/.test(mod.id)) {
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

why is there a vue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This whole function is not used, I just copied it for an experiment from vitejs/vite#2282 (comment)

I'll remove it when I get this done!

@dai-shi
Copy link
Owner

dai-shi commented Nov 22, 2023

  • in waku's plugins, vite.config.ts plugins were not being used, now they're being imported using vite's resolveConfig

Let me grab this idea and open a PR separately.

@dai-shi
Copy link
Owner

dai-shi commented Nov 23, 2023

  • in waku's plugins, vite.config.ts plugins were not being used, now they're being imported using vite's resolveConfig

Let me grab this idea and open a PR separately.

After trying it, I don't feel using mergeConfig selectively is a good idea. I'll recover configFileConfig in v0.16.0.

@Aslemammad
Copy link
Contributor Author

After trying it, I don't feel using mergeConfig selectively is a good idea. I'll recover configFileConfig in v0.16.0.

Agreed, It's not the correct approach, but we had to do it, if you have a better idea that brings the whole user's config, that's so much better and feel free to push it so I rebase.

@dai-shi
Copy link
Owner

dai-shi commented Nov 24, 2023

Agreed, It's not the correct approach, but we had to do it, if you have a better idea that brings the whole user's config, that's so much better and feel free to push it so I rebase.

https://github.com/dai-shi/waku/pull/176/files#r1404458905

@Aslemammad Aslemammad mentioned this pull request Nov 26, 2023
@Aslemammad
Copy link
Contributor Author

I'll continue in another PR.

@Aslemammad Aslemammad closed this Dec 9, 2023
@dai-shi
Copy link
Owner

dai-shi commented Dec 9, 2023

btw, this brought #228, so much appreciated.

@Aslemammad Aslemammad mentioned this pull request Dec 9, 2023
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.

not compatible with @vanilla-extract/css
3 participants