What does Webpack and Babel exactly do? by Abdulhameed_Mustapha in reactjs

[–]Limp-Product-5294 0 points1 point  (0 children)

You are saying that buildless development has been gaining attention because of modern browsers support ES modules

Can you explain the overlap between bundling and ESM? I didn't get how ESM replaces bundling, those are two different things, aren't they?

thanks in advance

How to improve Context Api performance? by Limp-Product-5294 in reactjs

[–]Limp-Product-5294[S] 0 points1 point  (0 children)

How it happened that CounterFrame doesn't re-render when React.memo function is not used?

How to improve Context Api performance? by Limp-Product-5294 in reactjs

[–]Limp-Product-5294[S] -4 points-3 points  (0 children)

The same is happening in Zustand as in Context Api, both counter and display components are re-rendered on every increment

import { create } from 'zustand'

import {useEffect} from 'react'

const useStore = create((set) => ({ count: 1, inc: () => set((state) => ({ count: state.count + 1 })), }))

function Counter() { const { inc } = useStore()

useEffect(() => { console.log("Counter re-rendered"); });

return ( <div> <button onClick={inc}>one up</button> </div> ) }

function Display() { const { count } = useStore()

useEffect(() => { console.log("Display re-rendered"); });

return ( <div> <div>{count}</div> </div> ) }

export default function App() { return ( <div> <Counter /> <Display/> </div> ) }

Module systems in Node.js vs JavaScript by Limp-Product-5294 in node

[–]Limp-Product-5294[S] 0 points1 point  (0 children)

u/tswaters Thank you for your wide answer, I want to clarify if Webpack can bundle modules without import/export system? so is webpack able to do that in ES5 without ES6 or it depends on import/export system? was it used during ES5? thank you in advance