Next.js Fast Refresh doesn't work properly with jotai - next.js

So I'm using Next.js with jotai a few months now. The problem is that with every change (and when the fast-refresh occurs due to the change), the atoms are reset and I have to refresh the page manually.
Do you know if there is any configuration that I need to make in order for it to not reset the atoms when the fast refresh occurs?
Here is a codesandbox link, but there is no fast refresh there (I am using the same code)
https://codesandbox.io/s/nextjs-with-jotai-forked-eori6o?file=/pages/_app.js
Thank you!

Related

Different layout before and after refreshing

I am working on this website. I used firebug along with DreamWeaver to create it. The website does not load fine when the page is opened(the layout is not as I wanted and I created it.) but when I refresh the page, it becomes exactly as I wanted it to be. Now I am stuck with it. I have never been into such a situation before. Please help me out how can I make the website load properly at the first instant. Thanks
It could be that the connection was slow the first time you loaded it. So the layout took longer. Next time you loaded it, everything was in the cache and the layout was quick!
So your low bandwidth (HTML) version of the site loads a 7.46 MB animated gif? Wow... I would get rid of that animated gif! Makes your site look choppy and unprofessional! That is surely a big part of your problem.
It looks exactly the same to me both before and after refresh. Hard-reset your cache, make sure you're not on a destructive proxy, and try using your browser in private mode.

Refreshing dojo datagrid not always working in FF9

I have a Dojo EnhancedGrid connected to a JsonRestStore. clearOnClose is set to true on the store. Usually I refresh it by doing
grid.store.close();
grid.setStore(window.store.tester);
Or
grid._refresh();
This works fine in every browser, but not in the newest version of FF9 (in version 4,5 it worked well).
In FF9, nothing happens at all and the store is not cleared or refreshed. Oddly, it does work after trying a few times and debugging it. But when I clear the browser history and cache and then try to refresh, it never works.
Does anyone have a clue what happens? What could be different in FF9 and is there another way to definately refresh the grid?
Are You using Firebug. If yes, then try switching it off and reloading the page. Dojo grids don't get along very well with Firebug.
Thanks for the suggestion. I found the reason now, it was some screwed hashtag logic which caused the grid to be refreshed twice at a time in Firefox. I corrected it and now it works.

My Flex app sometimes take a time navigating away to another tab and back to load in browser

In my Flex app I give the user the ability to open up a new item form ( s:Panel ) and create multiple items on the page.
Sometimes for some odd reason bringing up the panel (simple task) seems to take a really long time to load (like 30 seconds or so) However, the weird thing is that if right after I click to open I navigate away from the Tab and back again to the Flex app tab it shows up right away.
I'm not sure if this has to do with refresh rate or some setting or is it general performance/memory issue with my app that I have to consider. When the application work it works fairly fast which is making me think it's not memory/performance issue.
It's hard to be sure without more details, but are you following the component life cycle? Just to be sure we're talking about the same thing, here's a nice presentation about it: http://www.slideshare.net/rjowen/adobe-flex-component-lifecycle-presentation

Delay in production environment to show ajax progress?

Is it OK to use threading.sleep in an intranet web application to display AJAX loading (in production environment)? Off course, the application works fine without it but all works too quick for the end user or even a developer to notice any difference.
What is the recommended approach ?
Just read this thread: I am amazed: you want an application to fetch data slower? That sounds really strange to me.
You should try to make it clear to the user that the new data is loaded. You can use an animation or something like a highlight color for new items. Maybe a 'new' icon?
Imagine that the servers are running slow deu to some errors. Than the user still has to wait an extra second to see the data. Just something to think about.

browser, navigation issues

This is basically a continuation of a question of mine from yesterday,
"Foregoing intialization on a page"
(And btw, kudos to all who give selflessly in this forum to help others - need to do more of that myself.)
So anyway, I was told about HistoryManager, BrowserManager and SharedObject, and so quickly ascertained that its no problem to store a few data items in a shared object so a flex page restores the previous configuration when the browser navigates back to it.
But my real concern would be speed of loading. Its a 15mb page and it only takes 2 seconds to load, but that's still not instantaneous. If it were in a tabbed browser and I just clicked on another tab containing my page, my page would then appear instantaneously. Is there any way to achieve that behavior when my page is navigated back to (via the browser back button for example.) Would that mean that the entire 15mb flex web page would have to be stored in memory.
Thanks.
Here's what I'm thinking, you're going the wrong way about this,(unless I missed the boad on what you want to acheive) what you need to do is work with javascript to interact with the browsers url. Thjis is assuming that you want to be able to go back on a page without reloading content.
Basicaly a java script would override the reloading, and when you hit back, the page doesn't reload, but the javascript notifies the flash what change in has occurred.
Have a look at the gaya framework for how they do it
or lookat http://www.robertpenner.com/experiments/backbutton/backbutton.html

Resources