-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(devtool): add react devtool support [WIP] #68
base: master
Are you sure you want to change the base?
feat(devtool): add react devtool support [WIP] #68
Conversation
console.error(e); | ||
} | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty line at EOF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure probably we need to add prettier, husky
@@ -0,0 +1,3 @@ | |||
import { initDevTools } from './devtool'; | |||
|
|||
initDevTools(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty line at EOF.
@@ -0,0 +1,3 @@ | |||
import { initDevTools } from './devtool'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will also need to add this file on the dev build right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it should be opt-int by the user if the user adds
import '../src/debug';
they will get support for React dev tool. do you think that there is any other better way of doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On rollup we can add this on dev bundle. and exclude it otherwise.
const rdtHook = (window).__REACT_DEVTOOLS_GLOBAL_HOOK__; | ||
|
||
// the developer has not installed react devtools | ||
if(rdtHook == null) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when a person runs app in Development env, should we add a log recommending them to use React DevTools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should add that
@ameerthehacker Can your check if this works? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ameerthehacker Also, we will have to trigger the event for component initialization, props, hooks right?
@@ -0,0 +1,3 @@ | |||
import { initDevTools } from './devtool'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On rollup we can add this on dev bundle. and exclude it otherwise.
cool @s-yadav |
This is the WIP PR for adding react dev tools support to Brahmos
This is to address issue #65