Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ameerthehacker
Copy link
Member

This is the WIP PR for adding react dev tools support to Brahmos
This is to address issue #65

console.error(e);
}
};
}
Copy link
Collaborator

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.

Copy link
Member Author

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();
Copy link
Collaborator

@s-yadav s-yadav Nov 10, 2019

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';
Copy link
Collaborator

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?

Copy link
Member Author

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?

Copy link
Collaborator

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;

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?

Copy link
Member Author

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

@s-yadav
Copy link
Collaborator

s-yadav commented Dec 11, 2020

@ameerthehacker Can your check if this works?

Copy link
Collaborator

@s-yadav s-yadav left a 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';
Copy link
Collaborator

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.

@ameerthehacker
Copy link
Member Author

cool @s-yadav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants