-
Notifications
You must be signed in to change notification settings - Fork 10
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
How to silent the console warning upon reload #39
Comments
Glad to hear you like my library! What kind of warning messages are you getting? Can you paste those messages here? Figwheel tends to log a lots of stuff into the console upon reload but I believe there should not be any warning messages if everything is setup correctly. If those warnings come directly from stylefy, then they should be taken into account when using the library. It should be possible to get rid of them by fixing the problem which is causing them to appear. Personally, I would not want to silence any console warnings since usually there is a good reason for a warning message to appear there. By the way, I'm currently on vocation and I might be a little bit inactive here on GitHub for the next two weeks. |
Hi @Jarzka , thanks for the quick revert. Here's the screenshot for the error I understand your advice regarding the warnings, however, I'm just getting started with the |
The first warning message seems to be related to antd. I'm not familiar with that so I cannot really say anything about it. The second warnings comes from stylefy. As it says, you call I took a look at the source code of your project and did see only one call to What I recommend to do is to attach the root component of your application and initialise stylefy at the same time using the HTML: ClojureScript:
This makes sure the root component and stylefy are always initialised only once. However, if many people prefer to use "root level initialisation", then I'm not sure if we should remove the warning of duplicate initialisation, and simply not execute the initialisation code more than once. Final note: It seems that you are using rum instead of Reagent. stylefy does not officially support rum and I haven't tested what happens with these two libraries being used together. stylefy depends on Reagent because stylefy stores all its styles in Reagent atoms. This makes sure that every time this atom is changed, components are re-rendered, because they depend on this Reagent atom. If this re-rendering functionality is broken, then all styles are returned to components as inline styles. This works for most styles, but for example media queries cannot be used in inline styles. This is one unfortunate limitation in CSS. To bypass it, stylefy converts styles to CSS classes and media queries asynchronously, and then uses Reagent atoms to re-render components using the converted CSS code. Adding official support for rum could be a feature to do in the future. However, since majority of ClojureScript developers seem to prefer Reagent, I haven't introduced official support for rum (yet). I'm not sure if it's possible to support both Reagent and rum in the same library, or if we have to build a separate version of stylefy for that purpose, "stylefy for rum" or something. I want to avoid the need to maintain two versions of the library as much as possible, but remains to be seen. |
Oh, I too was planning on using it with rum. |
Yea, unfortunately stylefy does not support rum at this point. |
Hi @Jarzka , first off thank you for this wonderful library! I was trying to make sense of using
rum
withgarden
but it seems complicated and then I foundstylefy
🌠I just have a question regarding how could I make the console warning silent upon figwheel reload as I'm using
figwheel
and every time it is refreshed, there's a fresh warning.Here's the file in question
https://github.com/abhi18av/rum-tavern/blob/master/src/rum_tavern/core.cljs
The text was updated successfully, but these errors were encountered: