Giter VIP home page Giter VIP logo

Comments (7)

vutran avatar vutran commented on June 5, 2024 1

We decided to move forward with removing Redux for the new Context API. Let's try to get React updated to the latest version so we can get this new hotness ready for the migration.

from dext.

adnasa avatar adnasa commented on June 5, 2024 1

Let's try to get React updated to the latest version

I'm on it 😄

from dext.

adnasa avatar adnasa commented on June 5, 2024 1

One cool thing about using context here would be to eliminate imports of ipcRenderer,
which essentially means that we leak electron functionality into our components.

Admittedly, I have yet to try out the new Context API, but even with the old approach, you could see the benefit

class A extends React.Component {
  getChildContext () {
    return {
      socket: ipcRenderer,
    }
  }
}

class B extends React.Component {
  static contextTypes = {
    // because `context`, `socket` doesn't have to interface `ipcRenderer`
    socket: PropTypes.shape({
      on: PropTypes.function.isRequired,
    })
  }
}

// unit-test
// mock all the things..
const view = shallow(
  <B {...props} />,
  {
    socket: {
      on: jest.fn()
    }
  }
)

from dext.

himanshuchauhan avatar himanshuchauhan commented on June 5, 2024

Can I start working on this? Anything essential I need to know before working on this?

from dext.

vutran avatar vutran commented on June 5, 2024

Can I start working on this? Anything essential I need to know before working on this?

@himanshuchauhan Definitely. Let's try to keep the PR small since it's a huge migration. Ideally, we can move one state at a time. Please refer to PR #206 for an example of what we previously did. Let us know if you have any other questions.

Thanks!

from dext.

adnasa avatar adnasa commented on June 5, 2024

Let's try to get React updated to the latest version

#211 🔥

from dext.

adnasa avatar adnasa commented on June 5, 2024

🚀

from dext.

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.