Code Monkey home page Code Monkey logo

Comments (8)

rixo avatar rixo commented on June 14, 2024

No, it should work the same. Looks like a bug, I'll try to see if I can reproduce. Any chance you can share your webpack config?

Have you tried with svelte-loader-hot, but the hot option set to false? Same result?

from svelte-loader-hot.

wighawag avatar wighawag commented on June 14, 2024

Here is the commit that I use to test svelte-loader-hot : wighawag/eip-2585@22f6281

for hot option you means the hotReload option ?

If so it still has the same issue

from svelte-loader-hot.

rixo avatar rixo commented on June 14, 2024

Hmm, I tried to add svelte-preprocess to my sapper template example and it seems to work.

In your project, you're missing the preprocess option in the client part of the config (here). It's probably needed there too.

If this doesn't help, can you share the error you're getting?

from svelte-loader-hot.

rixo avatar rixo commented on June 14, 2024

And yes, I meant the hotReload option sorry. Got confused with the Rollup plugin...

from svelte-loader-hot.

wighawag avatar wighawag commented on June 14, 2024

Yes, you right, it works : wighawag/eip-2585@1d95abd

Thanks!

I guess the client preprocess option was not needed in non-hot-reload mode because the css get generated once by the server and it never need to be generated again client side.
But with hot-reload it now need to be handled by client side for hot reload to work

The only issue I have now is that when I remove some css class definition, the css does not get updated, but if I change the value in the class definition, it get applied.

Not sure if this is solvable ?

from svelte-loader-hot.

rixo avatar rixo commented on June 14, 2024

I'm somewhat surprised that it works without the preprocess in the client, even with the official plugin. I don't know enough about tailwind and postcss to speculate as to why... But glad to hear you could make it work!

And yes, CSS is still badly supported. Simply put, Svelte adds some stylesheets to the document, and they are never removed. So when you change something, the change is visible (same CSS specificity, last appended stylesheet wins). But when you remove a CSS rule, it stays there forever...

Said like that it makes me realize that it is probably a sizable memory leak too (until you reload the page).

I have added a fix for this. Can you try with svelte-loader-hot@next (you should get 0.3.1-0), and see if it works better for you?

from svelte-loader-hot.

wighawag avatar wighawag commented on June 14, 2024

Yes seems like it works better. Could not test all the thing but I saw css update going through even when pre processed

from svelte-loader-hot.

rixo avatar rixo commented on June 14, 2024

I think we're done here. Feel free to reopen if needed.

from svelte-loader-hot.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.