File tree 3 files changed +1727
-0
lines changed
packages/react-devtools-core
3 files changed +1727
-0
lines changed Original file line number Diff line number Diff line change 1
1
# node_modules ignored by default
2
2
3
3
** /build /**
4
+ ** /vendor /**
4
5
** /node_modules /**
5
6
flow /*
Original file line number Diff line number Diff line change @@ -57,8 +57,19 @@ function onError(e) {
57
57
58
58
function initialize ( socket ) {
59
59
var listeners = [ ] ;
60
+ var isLegacyRN = false ;
60
61
socket . onmessage = ( evt ) => {
61
62
if ( evt . data === 'attach:agent' ) {
63
+ // <hack>
64
+ // TODO: This branch (and vendor/backend-1.0.6.js) can be removed when we're comfortable dropping
65
+ // support for RN <= 0.42 in Nuclide RN inspector. We used to send backend to RN to `eval`
66
+ // but in newer RN versions we just import the backend from npm package.
67
+ // We use `attach:agent` to detect old RN versions because we don't send it anymore.
68
+ if ( ! isLegacyRN ) {
69
+ isLegacyRN = true ;
70
+ socket . send ( 'eval:' + fs . readFileSync ( path . join ( __dirname , '../vendor/backend-1.0.6.js' ) ) ) ;
71
+ }
72
+ // </hack>
62
73
return ;
63
74
}
64
75
var data = JSON . parse ( evt . data ) ;
You can’t perform that action at this time.
0 commit comments