How can I reconfigure this store.js file from Redux to #Redux/toolkit? - redux

I am following a tutorial video.
I am at the stage of developing UI for an exchange.
I am at the stage where I producing a store.js file.
I have the completed code (image 1), however my text editor tells me the format is depracated.
I need to reformat it for redux/toolkit.
Please advise how I can do this.
I will also need to ass redux/toolkit to package.json.
Please include any other possible adjustments I will need to make to other files.
Thanks
I have tried to adjust the code by removing Middleware, devTools and enhancer, but I am still receiving errors when launching on localhost.

If that tutorial shows you createStore, run and never look back!
createStore has that deprecation warning to stop people following outdated tutorials immediately at the beginning and not waste their time with outdated knowledge.
Modern Redux with Redux Toolkit is fundamentally different from legacy Redux and if your tutorial starts with createStore, it will continue to teach you a style of Redux that is four times the code, much more confusing and error-prone.
Redux Toolkit is the official recommendation since 2019 and if that tutorial shows you legacy Redux, it will probably also teach you all kinds of other outdated knowledge (like React class components or the React-Redux connect function).
Please follow the Official Redux Tutorial instead, as that teaches Redux Toolkit from the start.
And if that tutorial was teaching other things, please look for other sources for that as well.

Related

How do i handle state management while working with next js

Í am A newbie working with the MERN stacks, I just managed to build an ecommerce website from scratch,but then I hear nextjs is good for server side rendering which make our web app load faster and also seo friendly, I looked into the documentàtion, but I am yet to understand how I mange state in next js...càn I use redux,and how?
Thanks
It's easy to integrate redux into Next.js
These examples come from the official Next.js repo
with redux
with redux-toolkit
with redux-thunk
if you want to manage state with redux on server-side, you can follow this example with next-redux-wrappper

react-router-redux vs connected-react-router for react v4

official github page of react-router-redux says that the project is no longer maintained and is now deprecated. They recommend to use connected-react-router instead.
react-router-redux has:
31k stars
884 watch
6k forks
while connected-react-router has only:
1053 stars
28 watch
108 forks
I am starting developing a complete Q/A social networking website using react v4, will it be worthy or smart idea to use connected-react-router here?
while posting the question I just noticed that the stackoverflow doesn't even have connected-react-router tag.
If you are going to use Redux to manage your application state, use react router for routing, and want to synchronize your route history with your app state and manage routing through redux, then this will be fine to use. While I've only begun using it recently myself it's made been pretty straight forward for managing routing, including route data.
You also pointed out that:
react-router-redux says that the project is no longer maintained
For this reason alone I would not use react-router-redux, unless you plan to maintain it yourself. Disregarding features and bugs, you'd also have to be concerned with any potential security issues that come up. Please also see this dicussion they're having about it's deprecation in their GitHub issues https://github.com/ReactTraining/react-router/issues/6358
Just to reiterate, if you need, or think you'll need, to synchronize your router state with your redux store then this is not a bad tool to use. If you don't think you'll need this then don't use it so your project doesn't become bloated.
That being said, I've also seen this alternative https://github.com/salvoravida/redux-first-history which looks interesting. It looks to offer a more decoupled approach to history, routing, and state than the connected-react-router, but I haven't used it yet.

What router and ui-framework to use in meteor?

Just started to discover meteor. created app with DiscoverMeteor book, but misunderstood many moments. then read Your first meteor application and Your first meteor application books. Realized that Todos example is really too simple to cover many important things. And only after that I found the official guide on Meteor.com! now reading about all these complex (for my opinion) things. and have 2 questions:
What router should I prefer to use? I want to create fast app with lots of data loading from the server. Found information that Iron router is deprecated, and Flow router is recommended nowadays, but also found that flow router can not route on server, only on client. And that exactly client routing is the reason why for example soundcloud is really slow. So that is the question - I know nothing about server/client routing, but want to make right decision for the future project.
What ui-framework to use? I read that blaze is easy to start, but react js is really powerful. So: is Blaze enough for serious project (like a popular blog)? Or do I have to learn react js in order not to rewrite code in the future?
I am working with Meteor 1.3.2.4, which is latest in market and believe, you don't have to do anything out of the box to go with experimental UI-Frameworks and stuff.
Blaze template which is handlebars based implementation is best.
Blaze template is very well glued with Socket.io, futures and DDP implementation for cutting edge implementation for asynchronous and reactive behaviour on UI.
Blaze is really good for cumbersome, heavy data websites as well. If you have any doubt, i can skype and show you what i have implemented in just 2 days on development using everything given by Meteor.
React.js, Koa.js (re-written Express framework), express etc are very good and powerful, but I think implementing it at initial level of your grasp is overkill. Go with Blaze first.
There are hundered sitting and developing Meteor.js just for you to be comfortable. I am not at all biased, I am giving you my open opinion.
I worked with Laravel 5.2, Play framework, MEAN.io, DJango in past, but believe there is nothing like pure Meteor js with there own packages. There are many videos on youtube like Meteor nights and stuff where you can find the developers from all around the world developing huge stuff just using stuff given by Meteor js.
For routing flow-router is good, even iron:router is awesome and easily gettable.
This video can guide you very well.
Flow Router is the recommended router by the official Meteor Guide. It's also the popular choice these days, and for a reason: it's a high quality router implementation.
As for MVC, it's really like choosing a religion. React has a huge community, possibly a bright future, and it's not Meteor-only unlike Blaze. But some folks find Blaze templates nicer than JSX files. I think it's easier to get help on StackOverflow if you pick React, but Blaze might be easier to get started.
Maybe this post helps a bit: How to set up React with Meteor?

automated screenshots of React application with PhantomJs/Webshot (or other)

Given you have a ReactJS web application
And want to take scripted snapshots of it.
How do you do it? What's your method?
What I've attempted:
I have a React app with the stack managed by the Meteor frameworkwebpack.
I've attempted to use [WebShot][1] (via [bryanmorgan:webshot meteor smart package][2] which works great...outside of react components.
When react components are involved it seems to fail silently--plain HTML will be captured, but components are missed. (I've attempted page delays, and also triggered the snapshot on a onLoadFinished callback, none of which work.)
Request
Any suggestions on making this work?
Otherwise,
I've lost enough time on it, I'm perfectly happy to use a different strategy.

meteor support for angularjs, skipping handlebars

I am NOT much used to handlebars, can i completely skip handlebars and use angular. I see couple of libraries of angular in mtr which one to use, please suggest? Also provide any feedback if there will be problems in my app if i completely go the angular way in meteor.
I don't know angular very well, but I've already tried using meteor with KnockoutJS. My first impressions are that this should work fine. However, one important thing to keep in mind is that those frameworks use totally different dependency tracking system and in some cases it can be tricky to synchronize them with meteor, e.g. with reactive data sources like Collection.
Loneleeandroo has a great package on GitHub called ngMeteor to use for integrating the two frameworks together. It's really, really slick. Here's a link for you: https://github.com/loneleeandroo/ngMeteor/
Hope this helps!
The angular-meteor project has the most traction on github, is actively maintained, and has a well done tutorial.
http://angular-meteor.com/
tutorial
http://angular-meteor.com/tutorial
github
https://github.com/Urigo/angular-meteor

Resources