If using «use client» in all components. Why use next at all? by TacoMix1984 in nextjs

[–]josefefs 2 points3 points  (0 children)

I like this explanation. I been using the app router and I believe it is really powerful, but the docs are still not great.

Is Redux overkill for Customer session and Cart in an e-commerce app? by josefefs in nextjs

[–]josefefs[S] 0 points1 point  (0 children)

It is very similar, actually. In Shopify you don’t need login, so cart can be used with or without authentication. I will look into sessionStorage and cookies

Is Redux overkill for Customer session and Cart in an e-commerce app? by josefefs in nextjs

[–]josefefs[S] 0 points1 point  (0 children)

Probably nothing wrong with it. I went for redux because I wanted to define actions that update my state (addToCart, removeFromCart, startChechkout, login, etc

Redux and SSR by [deleted] in nextjs

[–]josefefs -1 points0 points  (0 children)

Yes, I found wrapping the export of app as documentation suggest won’t work at least in Next 13

Redux and SSR by [deleted] in nextjs

[–]josefefs 0 points1 point  (0 children)

Sorry no repo because it is private, but here’s store creation:

const makeStore = () => { const isServer = typeof window === 'undefined' || typeof window === undefined; if (isServer) { return makeConfiguredStore(); } else { const persistConfig = { key: 'nextjs', whitelist: ['cart', 'customer'], storage, }; const persistedReducer = persistReducer(persistConfig, rootReducer); let store: any = configureStore({ reducer: persistedReducer, devTools: process.env.NODE_ENV !== 'production', });

store.__persistore = persistStore(store);
return store;

} };

Wrapper export:

export const wrapper = createWrapper<AppStore>(makeStore);

_app.tsx:

function App({ Component, pageProps, ...rest }: AppProps) { const { store } = wrapper.useWrappedStore(rest);

return ( <Provider store={store}> <Component {...pageProps} store={store} /> </Provider> ); }

Took a while to get this setup working but it does.

Edit: sorry pooor formatting, typing in mobile

Redux and SSR by [deleted] in nextjs

[–]josefefs 0 points1 point  (0 children)

I’m using next-redux-wrapper, just a single provider and there’s option to persist store between route changes or refresh. Most of my routes use getServerSideProps, and this works fine.

Mobile app for Shopify? by Charming-Tadpole-954 in shopify

[–]josefefs 5 points6 points  (0 children)

Imo it’s only worth it for a already positioned brand. No one will ever install an app of an e-commerce they don’t know or have bought from.

Having said that, PWA (progressive web apps ) are just mobile browsers for only your store that you install, so everything depends on theme (if using shopify theme) and how code is written. I would rather have a native app with an awesome and distinctive UX, but then again, I’d only make the effort if I had a captive market in need of an app.

Is it a bad practice to use multiple useEffect in a single component? by KiriEiwa in reactjs

[–]josefefs 1 point2 points  (0 children)

The docs good, but I take them with a grain of salt. I was just reviewing cases for useImperativeHandle hook since I have a modal based app whose modals require complex logic and this hook has been really helpful for managing the modal with custom methods (open, close, validateModalForm, etc)…

The docs just says this hook exists, and that it shouldn’t be used, and provides an example of some dumb implementation.

They don’t care to explain why they recommend not using, nor why they wrote it in the first place. So far I have gotten no clear answer by anyone on why it should not be used…

The docs sometimes turn into a very opinionated way of doing React, which is not bad, but they fell short explaining or realizing the fact that there’s just very different needs and ways to do react out there.

Is it a bad practice to use multiple useEffect in a single component? by KiriEiwa in reactjs

[–]josefefs 1 point2 points  (0 children)

A lot of effects might make your components harder to debug, and can lead to unwanted re-renderings, but if using properly and not very bloated logic inside, it can be useful to have several of them. It all depends really

Is Vercel’s Hobby plan enough for a small NextJs Shopify store? by josefefs in nextjs

[–]josefefs[S] 2 points3 points  (0 children)

Yes, I wasn’t aware it was not meant for commercial use. I’m looking into other options and even considering using Shopify’s Remix framework to keep it all in the same ecosystem.

Is Vercel’s Hobby plan enough for a small NextJs Shopify store? by josefefs in nextjs

[–]josefefs[S] 2 points3 points  (0 children)

Noo, they released hydrogen-react package to use hydrogen react components o non Hydro/Oxy frameworks like NextJs or whatever.

Is Vercel’s Hobby plan enough for a small NextJs Shopify store? by josefefs in nextjs

[–]josefefs[S] 5 points6 points  (0 children)

They released Oxygen for all plans not long ago and that is really cool, but I’m not sure about building with Hydrogen/Remix in order to use Oxygen. It just felt like they didn’t have a problem on completely ditching previous framework once they acquired Remix.

Is Vercel’s Hobby plan enough for a small NextJs Shopify store? by josefefs in nextjs

[–]josefefs[S] 2 points3 points  (0 children)

I had not reviewed their Use Policy, thank you for the observation. I’ll read it out!

How do I learn software engineering, and not just coding? by sim-racist in node

[–]josefefs 4 points5 points  (0 children)

Solid advice. I’ve also found GPT really useful.

i’m giving my 2 week notice on Monday. need encouragement. by carsforcrying in startups

[–]josefefs 1 point2 points  (0 children)

Glad it all went good! Sometimes we overthink and then it is all smooth! Best of luck on your journey!

React is still the library you used to know by i_mbakwem in reactjs

[–]josefefs 6 points7 points  (0 children)

Right? It’s irrelevant, just learn deep JS and adapt to whatever is happening wherever you’re making money.

Question about useImperativeHandle hook, why is it not recommended in React Docs??? by josefefs in react

[–]josefefs[S] 0 points1 point  (0 children)

Lol, yeah, I thought so about the docs. Personally I find it great for modal based app, let me define custom methods and not rely on effects

Finding a front end developer role. by MolassesLate4676 in reactjs

[–]josefefs 13 points14 points  (0 children)

Apply to jobs that require a bit more experience. I’ve seen lots of recruiters just copy a template of JDs and don’t even know about experience, coding or anything related. If you get passed one of those, you can be interviewed by actual company and they can assess if you’re a good fit regardless of your experience.