Comments (7)
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.
Let's try to get React updated to the latest version
I'm on it 😄
from dext.
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.
Can I start working on this? Anything essential I need to know before working on this?
from dext.
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.
Let's try to get React updated to the latest version
#211 🔥
from dext.
🚀
from dext.
Related Issues (20)
- App search HOT 2
- [Question] execute command immediately after entered keyword (no need to specify query) HOT 4
- Hide from the dock and add context menu HOT 2
- getting disabled plugins HOT 4
- Plugins should fallback to icon.png for items
- Linux packaging error
- yarn run build:prod error HOT 1
- settings window HOT 3
- Core plugin calculator returns functions upon specific queries HOT 1
- Does the Alfred theme to Dext theme conversion tool have a place in dpm-cli or should it be it's own tool? HOT 3
- How Can I start up dext app when I login to Mac HOT 2
- consider automating dep updates HOT 1
- upgrade build
- have dedicated folders for modules HOT 3
- add test for `utils/CacheConf`
- add test for `utils/conf` HOT 5
- RFC: remove `app/renderer/src/schema` HOT 2
- upgrade react
- remove destruct HOT 2
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.
from dext.