ssr-experiments's People
Forkers
shaker-hamdi barrielaj kritsoni tiwariaditya15 momolafrooo dmytroskrypnyk annie-huang matinrco dipanjanpanja6 julienkode zakariamagdyz david-ting roywillynson caglar09 tarik02 willer258 blyndaruk boomshakar dzmitry-sazonau ahmetaytangil parabjeetsingh iufb dangnghia1997 olaoluwa402 ldmrgrc arghun-dev nikolai56 haribhusal claudiomoura dereklance elabbasy00 technorahmon khaledelkhoreby andreweastwood kishn0109 abilovelchin ngmitan149 passhub sawthetphyoe dunglongtran abelovq sergey-markovich meru28 nasim67reja rossparachute d4vz piyushchauhan2011 amir-elabed mrayandika15 avanbu selvaramj andreibobryk tusharshaha giangntse150746 ingamuse zhiznevski peb4010 msmreja exrelativityssr-experiments's Issues
Is this still "the way"?
A lot has changed with Next and RTK in the past 5 months. Is this still the recommended way?
use hydration. still behaves wonky - middleware not executed on client?
That commit message is a little off-putting, too :P
Duplicate api request when getPokemonByName query accept an object instead of string
Does the caching strategy still work on the server and do I still need to call the hooks to query data.
Hello @phryneas first of all, thanks for the amazing work you and your team do.
I see how helpful your comments are all over the web.
I'm a bit confused when it comes to using RTK query during SSR, particularly using Next.js.
I have seen in this repo that even with the use of RTK query during SSR, you still make use of the hooks to fetch for the Pokemon details in the Pokemon page.
Because of that, I have multiple questions -
- Do I still need the hook to fetch/query data even even while using RTK query server side ?
- While using SSR, is the data still stored in the cache ?
- If the data is still stored in the cache and not run on every request, meaning I can still get the cached data from the query hook right ?
Please I would really appreciate your response.
Thanks @phryneas
can you please make this example in normal js instead of typescript ?
@phryneas
I try to convert this into normal js but I don't how to convert this part
# store.ts
export type AppStore = ReturnType<typeof makeStore>;
export type RootState = ReturnType<AppStore["getState"]>;
export type AppDispatch = AppStore["dispatch"];
and this part where is this
util: { getRunningOperationPromises }
defined ?
# pokemonApi.ts
// Export hooks for usage in functional components
export const {
useGetPokemonByNameQuery,
useGetPokemonListQuery,
util: { getRunningOperationPromises },
} = pokemonApi;
getting getRunningQueriesThunk() is not a function during SSR
I'm trying to run rtkQuery during SSR, all goes well until it gets to dispatching the getRunningQueriesThunk
and I get the following function TypeError: _features_api_subApis_propertyApi__WEBPACK_IMPORTED_MODULE_4__.propertyApi.util.getRunningQueriesThunk is not a function
export const getServerSideProps = reduxWrapper.getServerSideProps(
(store) => async (context) => {
const propertyId = context.params?.propertyId;
store.dispatch(getProperty.initiate(propertyId));
const response = await Promise.all(
store.dispatch(propertyApi.util.getRunningQueriesThunk())
);
console.log(response);
return {
props: {},
};
}
);
I have tried looking for solution online, but I found none,
When I check the methods/functions of the api.util
, I see the old getRunningOperationPromises
and cannot find getRunningQueriesThunk
Please how can I solve this?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.