GithubHelp home page GithubHelp logo

Comments (6)

vzaidman avatar vzaidman commented on May 29, 2024 1

hey! the library is supposed to only be used in dev.

the code

if (process.env.NODE_ENV === 'development') {
  const whyDidYouRender = require('@welldone-software/why-did-you-render');
  // ...
}

makes sure that it doesn't affect the production code.

from why-did-you-render.

extempl avatar extempl commented on May 29, 2024 1

@vzaidman
Just checked - same for prod - WDYR itself does not called, but the code is there, and lodash is there, and override is there.
With all process.env.NODE_ENV === 'development' checks.

from why-did-you-render.

vzaidman avatar vzaidman commented on May 29, 2024 1

Gotcha. I'll make sure there's no window._ override and revise the guidelines not to include the line importSource: '@welldone-software/why-did-you-render' in process.env.NODE_ENV === 'development'.

I'd also try to find a way to compile the library as an empty file with console.error or something if the app is included in prod. The library should not be included in prod in any capacity.

from why-did-you-render.

extempl avatar extempl commented on May 29, 2024

@vzaidman It still corrupts results on dev for me. Some parts of app does not work when window._ is overridden.
Also, when it is switched off it is still ends up in the source code (and imports lodash) because of importSource: '@welldone-software/why-did-you-render', I guess.

from why-did-you-render.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.