mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
51
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3372ce1227 | ||
|
|
99b7cb77a7 | ||
|
|
969e14271c | ||
|
|
8386a9e4f1 | ||
|
|
163d553ba2 | ||
|
|
589bf35cd1 | ||
|
|
dd6c23fb61 | ||
|
|
218d2f6fdc | ||
|
|
456e01bf3f | ||
|
|
8bc133c6c1 | ||
|
|
f7ea40bc28 | ||
|
|
ad5949ffd6 | ||
|
|
2d2011c7ae | ||
|
|
29b74061e4 | ||
|
|
4f2755bda5 | ||
|
|
64d34080af | ||
|
|
b9dcc1b670 | ||
|
|
49b0045669 | ||
|
|
2b5938c900 | ||
|
|
d3890080c8 | ||
|
|
62fd6895e3 | ||
|
|
7b8590f860 | ||
|
|
4e595b7c7d | ||
|
|
ed24a4d05b | ||
|
|
92cae27cb2 | ||
|
|
490b05d0d8 | ||
|
|
09441d8691 | ||
|
|
5735bb5955 | ||
|
|
6e9a46ab81 | ||
|
|
f599e2a613 | ||
|
|
b577679746 | ||
|
|
88f05b219c | ||
|
|
dc3736893d | ||
|
|
3a954caf4f | ||
|
|
2dfb36e3c6 | ||
|
|
10b45b6200 | ||
|
|
430765b071 | ||
|
|
ed6aa0f25a | ||
|
|
8027067322 | ||
|
|
eb9e94256e | ||
|
|
dc4a6d2c7e | ||
|
|
417e068220 | ||
|
|
dc132a4fd4 | ||
|
|
18ba21149a | ||
|
|
53f89bacd4 | ||
|
|
14dc03e2bd | ||
|
|
22002bb70c | ||
|
|
b00d3be572 | ||
|
|
4acb3d3e7c | ||
|
|
f4b6131850 | ||
|
|
b9e6e349f5 |
+1
-1
@@ -98,4 +98,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.285.0
|
||||
^0.286.0
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"fb-dotslash": "0.5.8",
|
||||
"flow-api-translator": "0.32.0",
|
||||
"flow-bin": "^0.285.0",
|
||||
"flow-bin": "^0.286.0",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-eslint": "0.32.0",
|
||||
"hermes-transform": "0.32.0",
|
||||
|
||||
@@ -119,7 +119,6 @@ async function runServer(
|
||||
watchFolders,
|
||||
});
|
||||
const {middleware, websocketEndpoints} = createDevMiddleware({
|
||||
projectRoot,
|
||||
serverBaseUrl: devServerUrl,
|
||||
logger: createDevMiddlewareLogger(terminalReporter),
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@generated SignedSource<<d090ed9a9e781c82884f22944254ed65>>
|
||||
Git revision: 8b84a77b2c82c670886ef064dfc92d6bce83e579
|
||||
@generated SignedSource<<e0cc45c5c3854d0d3013f1c735e804b8>>
|
||||
Git revision: 8cce39003f66f66a8fb4c0e581a2b5046cf9c1d1
|
||||
Built with --nohooks: false
|
||||
Is local checkout: false
|
||||
Remote URL: https://github.com/facebook/react-native-devtools-frontend
|
||||
|
||||
packages/debugger-frontend/dist/third-party/front_end/Images/react_native/learn-debugging-basics.jpg
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 45 KiB |
packages/debugger-frontend/dist/third-party/front_end/Images/react_native/learn-native-debugging.jpg
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 51 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 4.0 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+16
-14
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -983,7 +983,7 @@ import*as e from"../../../services/trace_bounds/trace_bounds.js";import*as t fro
|
||||
|
||||
<p class="tooltip">${Ai(Oi.feedbackTooltip)}</p>
|
||||
</div>
|
||||
`,n=s.Directives.repeat([i],(()=>this.#ve),(e=>e));s.render(n,this.#e,{host:this})}}customElements.define("devtools-performance-sidebar-insights",Ui);var Bi=Object.freeze({__proto__:null,SidebarInsightsTab:Ui});class qi extends Event{removedAnnotation;static eventName="removeannotation";constructor(e){super(qi.eventName,{bubbles:!0,composed:!0}),this.removedAnnotation=e}}class Vi extends Event{annotation;static eventName="revealannotation";constructor(e){super(Vi.eventName,{bubbles:!0,composed:!0}),this.annotation=e}}class ji extends r.Widget.VBox{#ri=new r.TabbedPane.TabbedPane;#tn=new Wi;#in=new Ki;#nn=a.Settings.Settings.instance().createSetting("timeline-user-has-opened-sidebar-once",!1);userHasOpenedSidebarOnce(){return this.#nn.get()}constructor(){super(),this.setMinimumSize(170,0),this.#ri.appendTab("insights","Insights",this.#tn,void 0,void 0,!1,!1,0,"timeline.insights-tab"),this.#ri.appendTab("annotations","Annotations",this.#in,void 0,void 0,!1,!1,1,"timeline.annotations-tab"),this.#ri.selectTab("insights")}wasShown(){this.#nn.set(!0),this.#ri.show(this.element),this.#rn(),"insights"===this.#ri.selectedTabId&&this.#ri.tabIsDisabled("insights")&&this.#ri.selectTab("annotations")}setAnnotations(e,t){this.#in.setAnnotations(e,t),this.#rn()}#rn(){const e=this.#in.deduplicatedAnnotations();this.#ri.setBadge("annotations",e.length>0?e.length.toString():null)}setParsedTrace(e,t){this.#tn.setParsedTrace(e,t)}setInsights(e){this.#tn.setInsights(e),this.#ri.setTabEnabled("insights",null!==e)}setActiveInsight(e){this.#tn.setActiveInsight(e),e&&this.#ri.selectTab("insights")}}class Wi extends r.Widget.VBox{#sn=new Ui;constructor(){super(),this.element.classList.add("sidebar-insights"),this.element.appendChild(this.#sn)}setParsedTrace(e,t){this.#sn.parsedTrace=e,this.#sn.traceMetadata=t}setInsights(e){this.#sn.insights=e}setActiveInsight(e){this.#sn.activeInsight=e}}class Ki extends r.Widget.VBox{#sn=new xi;constructor(){super(),this.element.classList.add("sidebar-annotations"),this.element.appendChild(this.#sn)}setAnnotations(e,t){this.#sn.annotationEntryToColorMap=t,this.#sn.annotations=e}deduplicatedAnnotations(){return this.#sn.deduplicatedAnnotations()}}var Gi=Object.freeze({__proto__:null,DEFAULT_SIDEBAR_TAB:"insights",DEFAULT_SIDEBAR_WIDTH_PX:240,RemoveAnnotation:qi,RevealAnnotation:Vi,SidebarWidget:ji}),Yi={cssText:`:host{max-height:100%;overflow:hidden auto;scrollbar-width:thin}.timeline-summary{font-size:var(--sys-typescale-body4-size);flex-direction:column;padding:0 var(--sys-size-6) var(--sys-size-4) var(--sys-size-8)}.summary-range{font-weight:var(--ref-typeface-weight-medium);height:24.5px;line-height:22px}.category-summary{gap:var(--sys-size-4);display:flex;flex-direction:column}.category-row{min-height:16px;line-height:16px}.category-swatch{display:inline-block;width:var(--sys-size-6);height:var(--sys-size-6);margin-right:var(--sys-size-4);top:var(--sys-size-1);position:relative;border:var(--sys-size-1) solid var(--sys-color-neutral-outline)}.category-name{display:inline;word-break:break-all}.category-value{text-align:right;position:relative;float:right;z-index:0;width:var(--sys-size-19)}.background-bar-container{position:absolute;inset:0 0 0 var(--sys-size-3);z-index:-1}.background-bar{width:100%;float:right;height:var(--sys-size-8);background-color:var(--sys-color-surface-yellow);border-bottom:var(--sys-size-1) solid var(--sys-color-yellow-outline)}\n/*# sourceURL=${import.meta.resolve("./timelineSummary.css")} */\n`};const{render:Xi,html:Ji}=s,Zi={total:"Total",rangeSS:"Range: {PH1} – {PH2}"},Qi=t.i18n.registerUIStrings("panels/timeline/components/TimelineSummary.ts",Zi),en=t.i18n.getLocalizedString.bind(void 0,Qi);class tn extends HTMLElement{#e=r.UIUtils.createShadowRootWithCoreStyles(this,{cssFile:Yi,delegatesFocus:void 0});#on=0;#an=0;#ln=0;#dn=[];set data(e){this.#ln=e.total,this.#dn=e.categories,this.#on=e.rangeStart,this.#an=e.rangeEnd,this.#i()}#i(){const e=Ji`
|
||||
`,n=s.Directives.repeat([i],(()=>this.#ve),(e=>e));s.render(n,this.#e,{host:this})}}customElements.define("devtools-performance-sidebar-insights",Ui);var Bi=Object.freeze({__proto__:null,SidebarInsightsTab:Ui});class qi extends Event{removedAnnotation;static eventName="removeannotation";constructor(e){super(qi.eventName,{bubbles:!0,composed:!0}),this.removedAnnotation=e}}class Vi extends Event{annotation;static eventName="revealannotation";constructor(e){super(Vi.eventName,{bubbles:!0,composed:!0}),this.annotation=e}}class ji extends r.Widget.VBox{#ri=new r.TabbedPane.TabbedPane;#tn=new Wi;#in=new Ki;#nn=a.Settings.Settings.instance().createSetting("timeline-user-has-opened-sidebar-once",!1);userHasOpenedSidebarOnce(){return this.#nn.get()}constructor(){super(),this.setMinimumSize(170,0);const e=!S.Runtime.experiments.isEnabled("react-native-specific-ui");e&&this.#ri.appendTab("insights","Insights",this.#tn,void 0,void 0,!1,!1,0,"timeline.insights-tab"),this.#ri.appendTab("annotations","Annotations",this.#in,void 0,void 0,!1,!1,1,"timeline.annotations-tab"),this.#ri.selectTab(e?"insights":"annotations")}wasShown(){this.#nn.set(!0),this.#ri.show(this.element),this.#rn(),"insights"===this.#ri.selectedTabId&&this.#ri.tabIsDisabled("insights")&&this.#ri.selectTab("annotations")}setAnnotations(e,t){this.#in.setAnnotations(e,t),this.#rn()}#rn(){const e=this.#in.deduplicatedAnnotations();this.#ri.setBadge("annotations",e.length>0?e.length.toString():null)}setParsedTrace(e,t){this.#tn.setParsedTrace(e,t)}setInsights(e){this.#tn.setInsights(e),this.#ri.setTabEnabled("insights",null!==e)}setActiveInsight(e){this.#tn.setActiveInsight(e),e&&this.#ri.selectTab("insights")}}class Wi extends r.Widget.VBox{#sn=new Ui;constructor(){super(),this.element.classList.add("sidebar-insights"),this.element.appendChild(this.#sn)}setParsedTrace(e,t){this.#sn.parsedTrace=e,this.#sn.traceMetadata=t}setInsights(e){this.#sn.insights=e}setActiveInsight(e){this.#sn.activeInsight=e}}class Ki extends r.Widget.VBox{#sn=new xi;constructor(){super(),this.element.classList.add("sidebar-annotations"),this.element.appendChild(this.#sn)}setAnnotations(e,t){this.#sn.annotationEntryToColorMap=t,this.#sn.annotations=e}deduplicatedAnnotations(){return this.#sn.deduplicatedAnnotations()}}var Gi=Object.freeze({__proto__:null,DEFAULT_SIDEBAR_TAB:"insights",DEFAULT_SIDEBAR_WIDTH_PX:240,RemoveAnnotation:qi,RevealAnnotation:Vi,SidebarWidget:ji}),Yi={cssText:`:host{max-height:100%;overflow:hidden auto;scrollbar-width:thin}.timeline-summary{font-size:var(--sys-typescale-body4-size);flex-direction:column;padding:0 var(--sys-size-6) var(--sys-size-4) var(--sys-size-8)}.summary-range{font-weight:var(--ref-typeface-weight-medium);height:24.5px;line-height:22px}.category-summary{gap:var(--sys-size-4);display:flex;flex-direction:column}.category-row{min-height:16px;line-height:16px}.category-swatch{display:inline-block;width:var(--sys-size-6);height:var(--sys-size-6);margin-right:var(--sys-size-4);top:var(--sys-size-1);position:relative;border:var(--sys-size-1) solid var(--sys-color-neutral-outline)}.category-name{display:inline;word-break:break-all}.category-value{text-align:right;position:relative;float:right;z-index:0;width:var(--sys-size-19)}.background-bar-container{position:absolute;inset:0 0 0 var(--sys-size-3);z-index:-1}.background-bar{width:100%;float:right;height:var(--sys-size-8);background-color:var(--sys-color-surface-yellow);border-bottom:var(--sys-size-1) solid var(--sys-color-yellow-outline)}\n/*# sourceURL=${import.meta.resolve("./timelineSummary.css")} */\n`};const{render:Xi,html:Ji}=s,Zi={total:"Total",rangeSS:"Range: {PH1} – {PH2}"},Qi=t.i18n.registerUIStrings("panels/timeline/components/TimelineSummary.ts",Zi),en=t.i18n.getLocalizedString.bind(void 0,Qi);class tn extends HTMLElement{#e=r.UIUtils.createShadowRootWithCoreStyles(this,{cssFile:Yi,delegatesFocus:void 0});#on=0;#an=0;#ln=0;#dn=[];set data(e){this.#ln=e.total,this.#dn=e.categories,this.#on=e.rangeStart,this.#an=e.rangeEnd,this.#i()}#i(){const e=Ji`
|
||||
<div class="timeline-summary">
|
||||
<div class="summary-range">${en(Zi.rangeSS,{PH1:t.TimeUtilities.millisToString(this.#on),PH2:t.TimeUtilities.millisToString(this.#an)})}</div>
|
||||
<div class="category-summary">
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,71 +1,71 @@
|
||||
#!/usr/bin/env dotslash
|
||||
|
||||
// @generated SignedSource<<80974ea6ac4427cf5fd9f14f6779b5c6>>
|
||||
// @generated SignedSource<<f03dde90e30b4654dc18ba4c688f588e>>
|
||||
|
||||
|
||||
{
|
||||
"name": "React Native DevTools",
|
||||
"platforms": {
|
||||
"linux-aarch64": {
|
||||
"size": 116072551,
|
||||
"size": 116056498,
|
||||
"hash": "sha256",
|
||||
"digest": "3fd69eff02f4a41818a7ecb252ab0de449fa1f88fe0dd1de474bd15dd2e63856",
|
||||
"digest": "74ddbe463a81b57533a87f4301c6a6c74323018f70e4f1dbeed0dfbe2ebab257",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOBrLd2GhnOLBe4XfcroGD8Uh8odfhSuE5y5f6WSUCPAD93HJyyUbNxvU8rneUBXRi6SjftdBfU9ggRGlEdLVoTt3bp1bS8C370rWXH5oZIPkX87SovgSPmlCQygx8OQIUmShnoHVMSa3xArpSdXRdOvqNrwiOsmBkmxJXm_NycW502xfhcL6A6d38"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQNNgo1RofrfkLfx2qh_zLXdyNL54sIiYfd6p9aXIk-1zJ2lV1dpD2p58FTweCN6y3RZcdE_u9U8z16S_xRbtgA0mobHgSK6JASeR3dCLmMAazKXiiSb98rToqI9XAdOc4pJOGhOb2PVQ_c6lzngiOQ0vkyYU7xFENy-7jKKLbqYFSoDgT7RBs4dnbw"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-arm64/React Native DevTools"
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"size": 115924495,
|
||||
"size": 115924960,
|
||||
"hash": "sha256",
|
||||
"digest": "d154ffed0d8a66849da78baebf78e1323ecb8bbeda30d27b82a9b507196266c1",
|
||||
"digest": "eba05066886fe6cd88b4123ed423ad301fd35b2f12381627b3b22c7955c73333",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPp7lTIJZPh1_Bz1ONneTDc_i5ScY8TLzgHe4DzvYz6e7z-QHdBKhUNbNVBInrYrJaPKPum8FOGcvFW9JsvPNpsdMiAbjivdKQPAEkGOZ-unSOqL1dPPjW-yZYSBGucXmcgQiXVaDhqG3Wcu04JLsFKlKb9QvAZZ-tyN72E8ndAQ0mgDyhzEhwB"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOXAiG9ivBeW9v9jZMpg7nJZRT1SNBjTz8Nc5_SWUPCUf3xDekbhB6w3lWc8JtfklAzOL5TlJOsvIT3eujx2exadBpcS5NiAnq47KYvcgGP9iVxv5NuRwxttCc3Vncl5CLpGA6-Ifkt1g2-MrdM5yiaSaMKOCDQ83C2Fw07zH6tXt28jsZcTaPj"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-x64/React Native DevTools"
|
||||
},
|
||||
"macos-aarch64": {
|
||||
"size": 110891525,
|
||||
"size": 110890882,
|
||||
"hash": "sha256",
|
||||
"digest": "b05e1ae5528dcfcff5178d943d90128c9bf28ecd89da4dc303fd4ca748e5fc88",
|
||||
"digest": "f289b7ae3c300b9d744c729a0024e55a2a8d6953a6a8e834d867f705daad1153",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQMfoVd8CCoqS0ETntAOKhks2FtIDsyoPEeJHLIc-bxPESxTSHf02xDSSM-vjCG9gBitObq3iZECz1LGwbYS9qrjqXdrf7oljIWzK-eszvQwDe0wzCsywqRXBtLlDBb5h8a1WxjA_scRqoGCDbvk7-XovnJNdmTX4vq0CFb8QUUcEz31sVQ_v5IRjDdF"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQP4xY72fwAGy3-m2Gx7mPodV90K-GbWYYIZ9_xgI89O0rm5GPmXE0u-C18Vq2h6x3zL479nhS7o9_OonWaISxx6TMYZcZsG9nkqTW3-uWcUi6ndzPNQILwryGVg034jrlmjKLB2CiIRoJvdW37wB_1AWFCOKO9gXRozFKV4ndjGDxDC6HJvbfFTacvX"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
},
|
||||
"macos-x86_64": {
|
||||
"size": 117767014,
|
||||
"size": 117778007,
|
||||
"hash": "sha256",
|
||||
"digest": "6aa15f6dc13bea46503fcad1b9ba93b3007ea659abb63a2f6bf9b34c3abf834a",
|
||||
"digest": "a4698d6c3e2fdfb0c7bafec2130f3701c655468f953af836bf66ce3fe848c6ae",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQM57KwrYx0XeV3M8JrX_StgCFVbMHB5L-ShQfzIdoG4jfz71Z7U7CtK5FZ72Uwzm9wmzx5n0-w_3P8DRd24gvMWUSaN8QNdyxIUxd1n0BqJRYsvsbc8w2YpNeWadcce701zV5dYgQg7PIjPzDSuhYWM_7ih_QtZIBIHUUjCtr0sJBUYZVaqBQag6Q"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQMpGXCifWF6VrFwv_jM4lw-E8eFi59l776z1OYrS8u3mLluAyA8bUtscEyLwoMitqyjF7or5lPuW7OFyiyZ00bKFxSC5lH6Xo_Sc41cQN5n5hmXCX7Wpku9ilU39_ZWmI95W3_oAacYXA1l6ZmHX2AWlv3jERpywrP4J_RNFBi5UAvOhPFo4LtRXw"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"size": 125530089,
|
||||
"size": 125528869,
|
||||
"hash": "sha256",
|
||||
"digest": "da1747672dd222b1389f6ad9e1c67778ea0bc4e8859ddee23222a92bcaaed48f",
|
||||
"digest": "95234a13e6ba55556cff46f3da8af9e57ff1010c5483265cbbd444cad01c4216",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQN_2xTT04YUkfSPrA0LaBIHmjUTCCxBkiTgUpb3TUn02lpaFas2x3asL1LeHpZHlUmb_NiLE0PLZYg3T232fdIbmLaquPST7lQpsXDDMG-ykGK7-xxfK5CMU608Pd5Crw5YZBPF3O2PCtiIIcR85tWSqmyWYuoX-PnIhLnBWHjbpNcMcj9RkVqB"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOJdgsL68PBrM0rJk-WOm-re-8uqKfI1FfcTcAr1hiFSQr2bKBOqQNtHLnEA6JlRvKrwlOp4XTB6y9pC1TISeGo2dG_BYwN9jsVRLzcGWvfnpZ6GR7evVe82-XKS3Ya5YpScRdLycRqrhHuACXXbQ0HNvhNJjBWZtnQ8N3vOFJXn5QOGlobXqYp"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
|
||||
@@ -8,11 +8,15 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
|
||||
const {BrowserWindow, Menu, app, shell, ipcMain} = require('electron') as any;
|
||||
import SettingsStore from './SettingsStore.js';
|
||||
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
|
||||
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
|
||||
const {BrowserWindow, Menu, app, shell, ipcMain} = require('electron') as any;
|
||||
|
||||
const appSettings = new SettingsStore();
|
||||
const windowMetadata = new WeakMap<
|
||||
typeof BrowserWindow,
|
||||
$ReadOnly<{
|
||||
@@ -53,10 +57,11 @@ function handleLaunchArgs(argv: string[]) {
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
// Create the browser window.
|
||||
frontendWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 600,
|
||||
...(getSavedWindowPosition(windowKey) ?? {
|
||||
width: 1200,
|
||||
height: 600,
|
||||
}),
|
||||
webPreferences: {
|
||||
partition: 'persist:react-native-devtools',
|
||||
preload: require.resolve('./preload.js'),
|
||||
@@ -66,6 +71,8 @@ function handleLaunchArgs(argv: string[]) {
|
||||
});
|
||||
// Auto-hide the Windows/Linux menu bar
|
||||
frontendWindow.setMenuBarVisibility(false);
|
||||
// Observe and update saved window position
|
||||
setupWindowResizeListeners(frontendWindow, windowKey);
|
||||
}
|
||||
|
||||
// Open links in the default browser instead of in new Electron windows.
|
||||
@@ -119,6 +126,37 @@ function configureAppMenu() {
|
||||
Menu.setApplicationMenu(menu);
|
||||
}
|
||||
|
||||
function getSavedWindowPosition(
|
||||
windowKey: string,
|
||||
): ?{width: number, height: number, x?: number, y?: number} {
|
||||
return appSettings.get('windowArrangements', {})[windowKey];
|
||||
}
|
||||
|
||||
function saveWindowPosition(
|
||||
windowKey: string,
|
||||
position: {x: number, y: number, width: number, height: number},
|
||||
) {
|
||||
const windowArrangements = appSettings.get('windowArrangements', {});
|
||||
windowArrangements[windowKey] = position;
|
||||
appSettings.set('windowArrangements', windowArrangements);
|
||||
}
|
||||
|
||||
function setupWindowResizeListeners(
|
||||
browserWindow: typeof BrowserWindow,
|
||||
windowKey: string,
|
||||
) {
|
||||
const savePosition = () => {
|
||||
if (!browserWindow.isDestroyed()) {
|
||||
const [x, y] = browserWindow.getPosition();
|
||||
const [width, height] = browserWindow.getSize();
|
||||
saveWindowPosition(windowKey, {x, y, width, height});
|
||||
}
|
||||
};
|
||||
browserWindow.on('moved', savePosition);
|
||||
browserWindow.on('resized', savePosition);
|
||||
browserWindow.on('closed', savePosition);
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
handleLaunchArgs(process.argv.slice(app.isPackaged ? 1 : 2));
|
||||
configureAppMenu();
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
|
||||
const {app} = require('electron') as any;
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
type Options = $ReadOnly<{
|
||||
name?: string,
|
||||
defaults?: Object,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* A data persistence layer for storing application settings, modelled after
|
||||
* [`electron-store`](https://www.npmjs.com/package/electron-store).
|
||||
*
|
||||
* Values are saved in a `config.json` file in `app.getPath('userData')`.
|
||||
*
|
||||
* Compatibility:
|
||||
* - Maintains API and file format compatibility with `electron-store@8.2.0`.
|
||||
* - Supports the Electron main process only.
|
||||
*/
|
||||
export default class SettingsStore {
|
||||
#defaultValues: Object = {};
|
||||
path: string;
|
||||
|
||||
constructor(options: Options = {}) {
|
||||
options = {
|
||||
name: 'config',
|
||||
...options,
|
||||
};
|
||||
this.#defaultValues = {
|
||||
...this.#defaultValues,
|
||||
...options.defaults,
|
||||
};
|
||||
this.path = path.resolve(
|
||||
app.getPath('userData'),
|
||||
`${options.name ?? 'config'}.json`,
|
||||
);
|
||||
}
|
||||
|
||||
get(key: string, defaultValue?: any): any {
|
||||
const store = this.store;
|
||||
return store[key] !== undefined ? store[key] : defaultValue;
|
||||
}
|
||||
|
||||
set(key: string, value: any): void {
|
||||
const {store} = this;
|
||||
if (typeof key === 'object') {
|
||||
const object = key;
|
||||
for (const [k, v] of Object.entries(object)) {
|
||||
store[k] = v;
|
||||
}
|
||||
} else {
|
||||
store[key] = value;
|
||||
}
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
has(key: string): boolean {
|
||||
return key in this.store;
|
||||
}
|
||||
|
||||
reset(...keys: Array<string>): void {
|
||||
for (const key of keys) {
|
||||
if (this.#defaultValues[key] != null) {
|
||||
this.set(key, this.#defaultValues[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete(key: string): void {
|
||||
const {store} = this;
|
||||
delete store[key];
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.store = {};
|
||||
for (const key of Object.keys(this.#defaultValues)) {
|
||||
this.reset(key);
|
||||
}
|
||||
}
|
||||
|
||||
get store(): {[string]: mixed} {
|
||||
try {
|
||||
const data = fs.readFileSync(this.path, 'utf8');
|
||||
const deserializedData = this._deserialize(data);
|
||||
return {
|
||||
...((deserializedData: any): {[string]: mixed}),
|
||||
};
|
||||
} catch (error) {
|
||||
if (error?.code === 'ENOENT') {
|
||||
this._ensureDirectory();
|
||||
return {};
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
set store(value: mixed): void {
|
||||
this._ensureDirectory();
|
||||
this._write(value);
|
||||
}
|
||||
|
||||
_deserialize = (value: string): mixed => JSON.parse(value);
|
||||
_serialize = (value: mixed): string =>
|
||||
JSON.stringify(value, undefined, '\t') ?? '';
|
||||
|
||||
_ensureDirectory(): void {
|
||||
fs.mkdirSync(path.dirname(this.path), {recursive: true});
|
||||
}
|
||||
|
||||
_write(value: mixed): void {
|
||||
const data = this._serialize(value);
|
||||
|
||||
fs.writeFileSync(this.path, data, {mode: 0o666});
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,7 @@ async function unstable_spawnDebuggerShellWithArgs(
|
||||
{
|
||||
mode = 'detached',
|
||||
flavor = 'prebuilt',
|
||||
prebuiltBinaryPath,
|
||||
}: $ReadOnly<{
|
||||
// In 'syncAndExit' mode, the current process will block until the spawned process exits, and then it will exit
|
||||
// with the same exit code as the spawned process.
|
||||
@@ -37,9 +38,13 @@ async function unstable_spawnDebuggerShellWithArgs(
|
||||
// continue to run normally.
|
||||
mode?: 'syncThenExit' | 'detached',
|
||||
flavor?: DebuggerShellFlavor,
|
||||
prebuiltBinaryPath?: string,
|
||||
}> = {},
|
||||
): Promise<void> {
|
||||
const [binaryPath, baseArgs] = getShellBinaryAndArgs(flavor);
|
||||
const [binaryPath, baseArgs] = getShellBinaryAndArgs(
|
||||
flavor,
|
||||
prebuiltBinaryPath,
|
||||
);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const child = spawn(binaryPath, [...baseArgs, ...args], {
|
||||
@@ -109,14 +114,13 @@ export type DebuggerShellPreparationResult = $ReadOnly<{
|
||||
*/
|
||||
async function unstable_prepareDebuggerShell(
|
||||
flavor: DebuggerShellFlavor,
|
||||
{prebuiltBinaryPath}: {prebuiltBinaryPath?: string} = {},
|
||||
): Promise<DebuggerShellPreparationResult> {
|
||||
const [binaryPath, baseArgs] = getShellBinaryAndArgs(flavor);
|
||||
|
||||
try {
|
||||
switch (flavor) {
|
||||
case 'prebuilt':
|
||||
const prebuiltResult = await prepareDebuggerShellFromDotSlashFile(
|
||||
DEVTOOLS_BINARY_DOTSLASH_FILE,
|
||||
prebuiltBinaryPath ?? DEVTOOLS_BINARY_DOTSLASH_FILE,
|
||||
);
|
||||
if (prebuiltResult.code !== 'success') {
|
||||
return prebuiltResult;
|
||||
@@ -128,6 +132,11 @@ async function unstable_prepareDebuggerShell(
|
||||
flavor as empty;
|
||||
throw new Error(`Unknown flavor: ${flavor}`);
|
||||
}
|
||||
|
||||
const [binaryPath, baseArgs] = getShellBinaryAndArgs(
|
||||
flavor,
|
||||
prebuiltBinaryPath,
|
||||
);
|
||||
const {code, stderr} = await spawnAndGetStderr(binaryPath, [
|
||||
...baseArgs,
|
||||
'--version',
|
||||
@@ -149,10 +158,14 @@ async function unstable_prepareDebuggerShell(
|
||||
|
||||
function getShellBinaryAndArgs(
|
||||
flavor: DebuggerShellFlavor,
|
||||
prebuiltBinaryPath: ?string,
|
||||
): [string, Array<string>] {
|
||||
switch (flavor) {
|
||||
case 'prebuilt':
|
||||
return [require('fb-dotslash'), [DEVTOOLS_BINARY_DOTSLASH_FILE]];
|
||||
return [
|
||||
require('fb-dotslash'),
|
||||
[prebuiltBinaryPath ?? DEVTOOLS_BINARY_DOTSLASH_FILE],
|
||||
];
|
||||
case 'dev':
|
||||
return [
|
||||
// NOTE: Internally at Meta, this is aliased to a workspace that is
|
||||
|
||||
@@ -21,10 +21,6 @@ import {
|
||||
withServerForEachTest,
|
||||
} from './ServerUtils';
|
||||
import {createHash} from 'crypto';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const fsPromise = fs.promises;
|
||||
|
||||
// WebSocket is unreliable when using fake timers.
|
||||
jest.useRealTimers();
|
||||
@@ -47,7 +43,6 @@ describe.each(['HTTP', 'HTTPS'])(
|
||||
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: __dirname,
|
||||
secure: protocol === 'HTTPS',
|
||||
});
|
||||
|
||||
@@ -472,14 +467,7 @@ describe.each(['HTTP', 'HTTPS'])(
|
||||
}
|
||||
});
|
||||
|
||||
test('reads source from disk', async () => {
|
||||
// Should be just 'foo\n', but the newline can get mangled by the OS
|
||||
// and/or SCM, so let's read the source of truth from disk.
|
||||
const fileRealContents = await fsPromise.readFile(
|
||||
path.join(__dirname, '__fixtures__', 'mock-source-file.txt'),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
test('throws when attempting to pass a filesystem url', async () => {
|
||||
const {device, debugger_} = await createAndConnectTarget(
|
||||
serverRef,
|
||||
autoCleanup.signal,
|
||||
@@ -490,6 +478,7 @@ describe.each(['HTTP', 'HTTPS'])(
|
||||
vm: 'bar-vm',
|
||||
},
|
||||
);
|
||||
|
||||
try {
|
||||
await sendFromTargetToDebugger(device, debugger_, 'page1', {
|
||||
method: 'Debugger.scriptParsed',
|
||||
@@ -500,7 +489,7 @@ describe.each(['HTTP', 'HTTPS'])(
|
||||
endLine: 0,
|
||||
startColumn: 0,
|
||||
endColumn: 0,
|
||||
hash: createHash('sha256').update(fileRealContents).digest('hex'),
|
||||
hash: createHash('sha256').update('').digest('hex'),
|
||||
},
|
||||
});
|
||||
const response = await debugger_.sendAndGetResponse({
|
||||
@@ -511,8 +500,15 @@ describe.each(['HTTP', 'HTTPS'])(
|
||||
},
|
||||
});
|
||||
expect(response.result).toEqual(
|
||||
expect.objectContaining({scriptSource: fileRealContents}),
|
||||
expect.objectContaining({
|
||||
error: {
|
||||
message: expect.stringContaining(
|
||||
'Can\'t parse requested URL "__fixtures__/mock-source-file.txt"',
|
||||
),
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
// The device does not receive the getScriptSource request, since it
|
||||
// is handled by the proxy.
|
||||
expect(device.wrappedEventParsed).not.toBeCalledWith({
|
||||
|
||||
@@ -33,7 +33,6 @@ describe.each(['HTTP', 'HTTPS'])(
|
||||
protocol => {
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
secure: protocol === 'HTTPS',
|
||||
});
|
||||
const autoCleanup = withAbortSignalForEachTest();
|
||||
|
||||
@@ -39,7 +39,6 @@ describe('inspector proxy device message middleware', () => {
|
||||
const createCustomMessageHandler = jest.fn().mockImplementation(() => null);
|
||||
const {server} = await createServer({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_customInspectorMessageHandler: createCustomMessageHandler,
|
||||
});
|
||||
|
||||
@@ -83,7 +82,6 @@ describe('inspector proxy device message middleware', () => {
|
||||
const createCustomMessageHandler = jest.fn().mockImplementation(() => null);
|
||||
const {server} = await createServer({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_customInspectorMessageHandler: createCustomMessageHandler,
|
||||
});
|
||||
const {serverBaseUrl, serverBaseWsUrl} = serverRefUrls(server);
|
||||
@@ -169,7 +167,6 @@ describe('inspector proxy device message middleware', () => {
|
||||
|
||||
const {server} = await createServer({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_customInspectorMessageHandler: createCustomMessageHandler,
|
||||
});
|
||||
|
||||
@@ -231,7 +228,6 @@ describe('inspector proxy device message middleware', () => {
|
||||
const handleDeviceMessage = jest.fn();
|
||||
const {server} = await createServer({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_customInspectorMessageHandler: () => ({
|
||||
handleDeviceMessage,
|
||||
handleDebuggerMessage() {},
|
||||
@@ -264,7 +260,6 @@ describe('inspector proxy device message middleware', () => {
|
||||
const handleDeviceMessage = jest.fn();
|
||||
const {server} = await createServer({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_customInspectorMessageHandler: () => ({
|
||||
handleDeviceMessage,
|
||||
handleDebuggerMessage() {},
|
||||
@@ -304,7 +299,6 @@ describe('inspector proxy device message middleware', () => {
|
||||
const handleDebuggerMessage = jest.fn();
|
||||
const {server} = await createServer({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_customInspectorMessageHandler: () => ({
|
||||
handleDeviceMessage() {},
|
||||
handleDebuggerMessage,
|
||||
@@ -341,7 +335,6 @@ describe('inspector proxy device message middleware', () => {
|
||||
const handleDebuggerMessage = jest.fn();
|
||||
const {server} = await createServer({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_customInspectorMessageHandler: () => ({
|
||||
handleDeviceMessage() {},
|
||||
handleDebuggerMessage,
|
||||
|
||||
@@ -37,7 +37,6 @@ const PAGE_DEFAULTS = {
|
||||
describe('inspector-proxy device socket handoff', () => {
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
});
|
||||
const autoCleanup = withAbortSignalForEachTest();
|
||||
afterEach(() => {
|
||||
|
||||
@@ -27,7 +27,6 @@ jest.useFakeTimers();
|
||||
describe('inspector proxy HTTP API', () => {
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
});
|
||||
const autoCleanup = withAbortSignalForEachTest();
|
||||
afterEach(() => {
|
||||
@@ -261,7 +260,6 @@ describe('inspector proxy HTTP API', () => {
|
||||
describe('HTTP vs HTTPS', () => {
|
||||
const secureServerRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
secure: true,
|
||||
});
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ jest.setTimeout(10000);
|
||||
describe('inspector proxy React Native reloads', () => {
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
});
|
||||
const autoCleanup = withAbortSignalForEachTest();
|
||||
afterEach(() => {
|
||||
|
||||
@@ -34,7 +34,6 @@ describe('enableStandaloneFuseboxShell experiment', () => {
|
||||
};
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
unstable_browserLauncher: BrowserLauncherWithFuseboxShell,
|
||||
unstable_experiments: {
|
||||
enableStandaloneFuseboxShell: true,
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
foo
|
||||
@@ -17,7 +17,6 @@ jest.setTimeout(10000);
|
||||
describe('embedder script', () => {
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
projectRoot: '',
|
||||
});
|
||||
|
||||
test('is always served', async () => {
|
||||
|
||||
@@ -24,8 +24,6 @@ import path from 'path';
|
||||
import serveStaticMiddleware from 'serve-static';
|
||||
|
||||
type Options = $ReadOnly<{
|
||||
projectRoot: string,
|
||||
|
||||
/**
|
||||
* The base URL to the dev server, as reachable from the machine on which
|
||||
* dev-middleware is hosted. Typically `http://localhost:${metroPort}`.
|
||||
@@ -78,7 +76,6 @@ type DevMiddlewareAPI = $ReadOnly<{
|
||||
}>;
|
||||
|
||||
export default function createDevMiddleware({
|
||||
projectRoot,
|
||||
serverBaseUrl,
|
||||
logger,
|
||||
// $FlowFixMe[incompatible-type]
|
||||
@@ -96,7 +93,6 @@ export default function createDevMiddleware({
|
||||
);
|
||||
|
||||
const inspectorProxy = new InspectorProxy(
|
||||
projectRoot,
|
||||
serverBaseUrl,
|
||||
eventReporter,
|
||||
experiments,
|
||||
|
||||
@@ -28,9 +28,7 @@ import type {
|
||||
|
||||
import CdpDebugLogging from './CdpDebugLogging';
|
||||
import DeviceEventReporter from './DeviceEventReporter';
|
||||
import * as fs from 'fs';
|
||||
import invariant from 'invariant';
|
||||
import * as path from 'path';
|
||||
import WS from 'ws';
|
||||
|
||||
const debug = require('debug')('Metro:InspectorProxy');
|
||||
@@ -75,7 +73,6 @@ export type DeviceOptions = $ReadOnly<{
|
||||
name: string,
|
||||
app: string,
|
||||
socket: WS,
|
||||
projectRoot: string,
|
||||
eventReporter: ?EventReporter,
|
||||
createMessageMiddleware: ?CreateCustomMessageHandlerFn,
|
||||
deviceRelativeBaseUrl: URL,
|
||||
@@ -120,9 +117,6 @@ export default class Device {
|
||||
// Mapping built from scriptParsed events and used to fetch file content in `Debugger.getScriptSource`.
|
||||
#scriptIdToSourcePathMapping: Map<string, string> = new Map();
|
||||
|
||||
// Root of the project used for relative to absolute source path conversion.
|
||||
#projectRoot: string;
|
||||
|
||||
#deviceEventReporter: ?DeviceEventReporter;
|
||||
|
||||
#pagesPollingIntervalId: ReturnType<typeof setInterval>;
|
||||
@@ -151,7 +145,6 @@ export default class Device {
|
||||
name,
|
||||
app,
|
||||
socket,
|
||||
projectRoot,
|
||||
eventReporter,
|
||||
createMessageMiddleware,
|
||||
serverRelativeBaseUrl,
|
||||
@@ -163,7 +156,6 @@ export default class Device {
|
||||
this.#name = name;
|
||||
this.#app = app;
|
||||
this.#deviceSocket = socket;
|
||||
this.#projectRoot = projectRoot;
|
||||
this.#serverRelativeBaseUrl = serverRelativeBaseUrl;
|
||||
this.#deviceRelativeBaseUrl = deviceRelativeBaseUrl;
|
||||
this.#deviceEventReporter = eventReporter
|
||||
@@ -880,7 +872,7 @@ export default class Device {
|
||||
return this.#processDebuggerSetBreakpointByUrl(req, debuggerInfo);
|
||||
case 'Debugger.getScriptSource':
|
||||
// Sends response to debugger via side-effect
|
||||
this.#processDebuggerGetScriptSource(req, socket);
|
||||
void this.#processDebuggerGetScriptSource(req, socket);
|
||||
return null;
|
||||
case 'Network.loadNetworkResource':
|
||||
// If we're rewriting URLs (to frontend-relative), we don't want to
|
||||
@@ -965,10 +957,10 @@ export default class Device {
|
||||
return processedReq;
|
||||
}
|
||||
|
||||
#processDebuggerGetScriptSource(
|
||||
async #processDebuggerGetScriptSource(
|
||||
req: CDPRequest<'Debugger.getScriptSource'>,
|
||||
socket: WS,
|
||||
): void {
|
||||
): Promise<void> {
|
||||
const sendSuccessResponse = (scriptSource: string) => {
|
||||
const result: {
|
||||
scriptSource: string,
|
||||
@@ -1005,33 +997,23 @@ export default class Device {
|
||||
const pathToSource = this.#scriptIdToSourcePathMapping.get(
|
||||
req.params.scriptId,
|
||||
);
|
||||
if (pathToSource != null) {
|
||||
const httpURL = this.#tryParseHTTPURL(pathToSource);
|
||||
if (httpURL) {
|
||||
// URL is server-relatve, so we should be able to fetch it from here.
|
||||
this.#fetchText(httpURL).then(
|
||||
text => sendSuccessResponse(text),
|
||||
err =>
|
||||
sendErrorResponse(
|
||||
`Failed to fetch source url ${pathToSource}: ${err.message}`,
|
||||
),
|
||||
|
||||
try {
|
||||
const httpURL =
|
||||
pathToSource == null ? null : this.#tryParseHTTPURL(pathToSource);
|
||||
if (!httpURL) {
|
||||
throw new Error(
|
||||
`Can't parse requested URL ${pathToSource === undefined ? 'undefined' : JSON.stringify(pathToSource)}`,
|
||||
);
|
||||
} else {
|
||||
let file;
|
||||
try {
|
||||
file = fs.readFileSync(
|
||||
path.resolve(this.#projectRoot, pathToSource),
|
||||
'utf8',
|
||||
);
|
||||
} catch (err) {
|
||||
sendErrorResponse(
|
||||
`Failed to fetch source file ${pathToSource}: ${err.message}`,
|
||||
);
|
||||
}
|
||||
if (file != null) {
|
||||
sendSuccessResponse(file);
|
||||
}
|
||||
}
|
||||
|
||||
const text = await this.#fetchText(httpURL);
|
||||
|
||||
sendSuccessResponse(text);
|
||||
} catch (err) {
|
||||
sendErrorResponse(
|
||||
`Failed to fetch source url ${pathToSource === undefined ? 'undefined' : JSON.stringify(pathToSource)} for scriptId ${req.params.scriptId}: ${err.message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,6 @@ export interface InspectorProxyQueries {
|
||||
* Main Inspector Proxy class that connects JavaScript VM inside Android/iOS apps and JS debugger.
|
||||
*/
|
||||
export default class InspectorProxy implements InspectorProxyQueries {
|
||||
// Root of the project used for relative to absolute source path conversion.
|
||||
#projectRoot: string;
|
||||
|
||||
// The base URL to the dev server from the dev-middleware host.
|
||||
#serverBaseUrl: URL;
|
||||
|
||||
@@ -101,7 +98,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
|
||||
#eventLoopPerfTracker: EventLoopPerfTracker;
|
||||
|
||||
constructor(
|
||||
projectRoot: string,
|
||||
serverBaseUrl: string,
|
||||
eventReporter: ?EventReporter,
|
||||
experiments: Experiments,
|
||||
@@ -109,7 +105,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
|
||||
customMessageHandler: ?CreateCustomMessageHandlerFn,
|
||||
trackEventLoopPerf?: boolean = false,
|
||||
) {
|
||||
this.#projectRoot = projectRoot;
|
||||
this.#serverBaseUrl = new URL(serverBaseUrl);
|
||||
this.#devices = new Map();
|
||||
this.#eventReporter = eventReporter;
|
||||
@@ -355,7 +350,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
|
||||
name: deviceName,
|
||||
app: appName,
|
||||
socket,
|
||||
projectRoot: this.#projectRoot,
|
||||
eventReporter: this.#eventReporter,
|
||||
createMessageMiddleware: this.#customMessageHandler,
|
||||
deviceRelativeBaseUrl,
|
||||
|
||||
@@ -21,6 +21,7 @@ import type {NextHandleFunction} from 'connect';
|
||||
import type {IncomingMessage, ServerResponse} from 'http';
|
||||
|
||||
import getDevToolsFrontendUrl from '../utils/getDevToolsFrontendUrl';
|
||||
import {createHash} from 'crypto';
|
||||
import url from 'url';
|
||||
|
||||
const LEGACY_SYNTHETIC_PAGE_TITLE =
|
||||
@@ -190,11 +191,15 @@ export default function openDebuggerMiddleware({
|
||||
}
|
||||
}
|
||||
if (shouldUseStandaloneFuseboxShell) {
|
||||
const windowKey = [
|
||||
serverBaseUrl,
|
||||
target.webSocketDebuggerUrl,
|
||||
target.appId,
|
||||
].join('-');
|
||||
const windowKey = createHash('sha256')
|
||||
.update(
|
||||
[
|
||||
serverBaseUrl,
|
||||
target.webSocketDebuggerUrl,
|
||||
target.appId,
|
||||
].join('-'),
|
||||
)
|
||||
.digest('hex');
|
||||
if (!browserLauncher.unstable_showFuseboxShell) {
|
||||
throw new Error(
|
||||
'Fusebox shell is not supported by the current browser launcher',
|
||||
|
||||
+9
-9
@@ -67,18 +67,18 @@ class ReactRootProjectPlugin : Plugin<Project> {
|
||||
) {
|
||||
project.logger.error(
|
||||
"""
|
||||
********************************************************************************
|
||||
********************************************************************************
|
||||
|
||||
WARNING: Setting `newArchEnabled=false` in your `gradle.properties` file is not
|
||||
supported anymore since React Native 0.82.
|
||||
|
||||
You can remove the line from your `gradle.properties` file.
|
||||
|
||||
The application will run with the New Architecture enabled by default.
|
||||
WARNING: Setting `newArchEnabled=false` in your `gradle.properties` file is not
|
||||
supported anymore since React Native 0.82.
|
||||
|
||||
********************************************************************************
|
||||
You can remove the line from your `gradle.properties` file.
|
||||
|
||||
"""
|
||||
The application will run with the New Architecture enabled by default.
|
||||
|
||||
********************************************************************************
|
||||
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+14
-14
@@ -168,13 +168,13 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
|
||||
# This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
|
||||
# We set REACTNATIVE_MERGED_SO so libraries/apps can selectively decide to depend on either libreactnative.so
|
||||
# or link against a old prefab target (this is needed for React Native 0.76 on).
|
||||
set(REACTNATIVE_MERGED_SO true)
|
||||
|
||||
|
||||
{{ libraryIncludes }}
|
||||
|
||||
|
||||
set(AUTOLINKED_LIBRARIES
|
||||
{{ libraryModules }}
|
||||
)
|
||||
@@ -191,28 +191,28 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
|
||||
* once the code is regenerated.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "autolinking.h"
|
||||
{{ autolinkingCppIncludes }}
|
||||
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) {
|
||||
{{ autolinkingCppTurboModuleJavaProviders }}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
|
||||
{{ autolinkingCppTurboModuleCxxProviders }}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
|
||||
{{ autolinkingCppComponentDescriptors }}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
"""
|
||||
@@ -228,22 +228,22 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
|
||||
* once the code is regenerated.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <ReactCommon/CallInvoker.h>
|
||||
#include <ReactCommon/JavaTurboModule.h>
|
||||
#include <ReactCommon/TurboModule.h>
|
||||
#include <jsi/jsi.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms);
|
||||
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker);
|
||||
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry);
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
"""
|
||||
|
||||
+5
-5
@@ -65,19 +65,19 @@ abstract class GenerateEntryPointTask : DefaultTask() {
|
||||
val generatedFileContentsTemplate =
|
||||
"""
|
||||
package com.facebook.react;
|
||||
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
import com.facebook.react.views.view.WindowUtilKt;
|
||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* This class is the entry point for loading React Native using the configuration
|
||||
* that the users specifies in their .gradle files.
|
||||
@@ -102,7 +102,7 @@ abstract class GenerateEntryPointTask : DefaultTask() {
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
"""
|
||||
.trimIndent()
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -137,61 +137,61 @@ abstract class GeneratePackageListTask : DefaultTask() {
|
||||
val generatedFileContentsTemplate =
|
||||
"""
|
||||
package com.facebook.react;
|
||||
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.shell.MainPackageConfig;
|
||||
import com.facebook.react.shell.MainReactPackage;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
{{ packageImports }}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
private MainPackageConfig mConfig;
|
||||
|
||||
|
||||
public PackageList(ReactNativeHost reactNativeHost) {
|
||||
this(reactNativeHost, null);
|
||||
}
|
||||
|
||||
|
||||
public PackageList(Application application) {
|
||||
this(application, null);
|
||||
}
|
||||
|
||||
|
||||
public PackageList(ReactNativeHost reactNativeHost, MainPackageConfig config) {
|
||||
this.reactNativeHost = reactNativeHost;
|
||||
mConfig = config;
|
||||
}
|
||||
|
||||
|
||||
public PackageList(Application application, MainPackageConfig config) {
|
||||
this.reactNativeHost = null;
|
||||
this.application = application;
|
||||
mConfig = config;
|
||||
}
|
||||
|
||||
|
||||
private ReactNativeHost getReactNativeHost() {
|
||||
return this.reactNativeHost;
|
||||
}
|
||||
|
||||
|
||||
private Resources getResources() {
|
||||
return this.getApplication().getResources();
|
||||
}
|
||||
|
||||
|
||||
private Application getApplication() {
|
||||
if (this.reactNativeHost == null) return this.application;
|
||||
return this.reactNativeHost.getApplication();
|
||||
}
|
||||
|
||||
|
||||
private Context getApplicationContext() {
|
||||
return this.getApplication().getApplicationContext();
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<ReactPackage> getPackages() {
|
||||
return new ArrayList<>(Arrays.<ReactPackage>asList(
|
||||
new MainReactPackage(mConfig){{ packageClassInstances }}
|
||||
|
||||
+18
-18
@@ -21,24 +21,24 @@ internal object BackwardCompatUtils {
|
||||
if (reactMap.isNotEmpty()) {
|
||||
project.logger.error(
|
||||
"""
|
||||
********************************************************************************
|
||||
|
||||
ERROR: Using old project.ext.react configuration.
|
||||
We identified that your project is using a old configuration block as:
|
||||
|
||||
project.ext.react = [
|
||||
// ...
|
||||
]
|
||||
|
||||
You should migrate to the new configuration:
|
||||
|
||||
react {
|
||||
// ...
|
||||
}
|
||||
You can find documentation inside `android/app/build.gradle` on how to use it.
|
||||
|
||||
********************************************************************************
|
||||
"""
|
||||
********************************************************************************
|
||||
|
||||
ERROR: Using old project.ext.react configuration.
|
||||
We identified that your project is using a old configuration block as:
|
||||
|
||||
project.ext.react = [
|
||||
// ...
|
||||
]
|
||||
|
||||
You should migrate to the new configuration:
|
||||
|
||||
react {
|
||||
// ...
|
||||
}
|
||||
You can find documentation inside `android/app/build.gradle` on how to use it.
|
||||
|
||||
********************************************************************************
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+4
-4
@@ -105,11 +105,11 @@ private fun detectCliFile(reactNativeRoot: File, preconfiguredCliFile: File?): F
|
||||
|
||||
error(
|
||||
"""
|
||||
Couldn't determine CLI location!
|
||||
Couldn't determine CLI location!
|
||||
|
||||
Please set `react { cliFile = file(...) }` inside your
|
||||
build.gradle to the path of the react-native cli.js file.
|
||||
This file typically resides in `node_modules/react-native/cli.js`
|
||||
Please set `react { cliFile = file(...) }` inside your
|
||||
build.gradle to the path of the react-native cli.js file.
|
||||
This file typically resides in `node_modules/react-native/cli.js`
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
|
||||
+92
-92
@@ -120,20 +120,20 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
assertThat(output)
|
||||
.isEqualTo(
|
||||
"""
|
||||
# This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# We set REACTNATIVE_MERGED_SO so libraries/apps can selectively decide to depend on either libreactnative.so
|
||||
# or link against a old prefab target (this is needed for React Native 0.76 on).
|
||||
set(REACTNATIVE_MERGED_SO true)
|
||||
|
||||
|
||||
|
||||
set(AUTOLINKED_LIBRARIES
|
||||
|
||||
)
|
||||
"""
|
||||
# This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# We set REACTNATIVE_MERGED_SO so libraries/apps can selectively decide to depend on either libreactnative.so
|
||||
# or link against a old prefab target (this is needed for React Native 0.76 on).
|
||||
set(REACTNATIVE_MERGED_SO true)
|
||||
|
||||
|
||||
|
||||
set(AUTOLINKED_LIBRARIES
|
||||
|
||||
)
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -147,24 +147,24 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
assertThat(output)
|
||||
.isEqualTo(
|
||||
"""
|
||||
# This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# We set REACTNATIVE_MERGED_SO so libraries/apps can selectively decide to depend on either libreactnative.so
|
||||
# or link against a old prefab target (this is needed for React Native 0.76 on).
|
||||
set(REACTNATIVE_MERGED_SO true)
|
||||
|
||||
add_subdirectory("./a/directory/" aPackage_autolinked_build)
|
||||
add_subdirectory("./another/directory/with\ spaces/" anotherPackage_autolinked_build)
|
||||
add_subdirectory("./another/directory/cxx/" anotherPackage_cxxmodule_autolinked_build)
|
||||
|
||||
set(AUTOLINKED_LIBRARIES
|
||||
react_codegen_aPackage
|
||||
react_codegen_anotherPackage
|
||||
another_cxxModule
|
||||
)
|
||||
"""
|
||||
# This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# We set REACTNATIVE_MERGED_SO so libraries/apps can selectively decide to depend on either libreactnative.so
|
||||
# or link against a old prefab target (this is needed for React Native 0.76 on).
|
||||
set(REACTNATIVE_MERGED_SO true)
|
||||
|
||||
add_subdirectory("./a/directory/" aPackage_autolinked_build)
|
||||
add_subdirectory("./another/directory/with\ spaces/" anotherPackage_autolinked_build)
|
||||
add_subdirectory("./another/directory/cxx/" anotherPackage_cxxmodule_autolinked_build)
|
||||
|
||||
set(AUTOLINKED_LIBRARIES
|
||||
react_codegen_aPackage
|
||||
react_codegen_anotherPackage
|
||||
another_cxxModule
|
||||
)
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -178,38 +178,38 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
assertThat(output)
|
||||
.isEqualTo(
|
||||
"""
|
||||
/**
|
||||
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "autolinking.h"
|
||||
#include "autolinking.h"
|
||||
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) {
|
||||
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) {
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
|
||||
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
|
||||
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
"""
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -223,50 +223,50 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
assertThat(output)
|
||||
.isEqualTo(
|
||||
"""
|
||||
/**
|
||||
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "autolinking.h"
|
||||
#include <aPackage.h>
|
||||
#include <anotherPackage.h>
|
||||
#include <react/renderer/components/anotherPackage/ComponentDescriptors.h>
|
||||
#include <AnotherCxxModule.h>
|
||||
#include "autolinking.h"
|
||||
#include <aPackage.h>
|
||||
#include <anotherPackage.h>
|
||||
#include <react/renderer/components/anotherPackage/ComponentDescriptors.h>
|
||||
#include <AnotherCxxModule.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) {
|
||||
auto module_aPackage = aPackage_ModuleProvider(moduleName, params);
|
||||
if (module_aPackage != nullptr) {
|
||||
return module_aPackage;
|
||||
}
|
||||
auto module_anotherPackage = anotherPackage_ModuleProvider(moduleName, params);
|
||||
if (module_anotherPackage != nullptr) {
|
||||
return module_anotherPackage;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) {
|
||||
auto module_aPackage = aPackage_ModuleProvider(moduleName, params);
|
||||
if (module_aPackage != nullptr) {
|
||||
return module_aPackage;
|
||||
}
|
||||
auto module_anotherPackage = anotherPackage_ModuleProvider(moduleName, params);
|
||||
if (module_anotherPackage != nullptr) {
|
||||
return module_anotherPackage;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
|
||||
if (moduleName == AnotherCxxModule::kModuleName) {
|
||||
return std::make_shared<AnotherCxxModule>(jsInvoker);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
|
||||
if (moduleName == AnotherCxxModule::kModuleName) {
|
||||
return std::make_shared<AnotherCxxModule>(jsInvoker);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
|
||||
providerRegistry->add(concreteComponentDescriptorProvider<AnotherPackageComponentDescriptor>());
|
||||
return;
|
||||
}
|
||||
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
|
||||
providerRegistry->add(concreteComponentDescriptorProvider<AnotherPackageComponentDescriptor>());
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
"""
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+16
-16
@@ -138,16 +138,16 @@ class GenerateCodegenArtifactsTaskTest {
|
||||
// language=JSON
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"name": "@a/library",
|
||||
"codegenConfig": {
|
||||
"name": "an-awesome-library",
|
||||
"android": {
|
||||
"javaPackageName": "com.awesome.package"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
{
|
||||
"name": "@a/library",
|
||||
"codegenConfig": {
|
||||
"name": "an-awesome-library",
|
||||
"android": {
|
||||
"javaPackageName": "com.awesome.package"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -172,12 +172,12 @@ class GenerateCodegenArtifactsTaskTest {
|
||||
// language=JSON
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"name": "@a/library",
|
||||
"codegenConfig": {
|
||||
}
|
||||
}
|
||||
"""
|
||||
{
|
||||
"name": "@a/library",
|
||||
"codegenConfig": {
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+38
-38
@@ -47,45 +47,45 @@ class GenerateEntryPointTaskTest {
|
||||
assertThat(result)
|
||||
.isEqualTo(
|
||||
"""
|
||||
package com.facebook.react;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
import com.facebook.react.views.view.WindowUtilKt;
|
||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* This class is the entry point for loading React Native using the configuration
|
||||
* that the users specifies in their .gradle files.
|
||||
*
|
||||
* The `loadReactNative(this)` method invocation should be called inside the
|
||||
* application onCreate otherwise the app won't load correctly.
|
||||
*/
|
||||
public class ReactNativeApplicationEntryPoint {
|
||||
public static void loadReactNative(Context context) {
|
||||
try {
|
||||
SoLoader.init(context, OpenSourceMergedSoMapping.INSTANCE);
|
||||
} catch (IOException error) {
|
||||
throw new RuntimeException(error);
|
||||
package com.facebook.react;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
import com.facebook.react.views.view.WindowUtilKt;
|
||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* This class is the entry point for loading React Native using the configuration
|
||||
* that the users specifies in their .gradle files.
|
||||
*
|
||||
* The `loadReactNative(this)` method invocation should be called inside the
|
||||
* application onCreate otherwise the app won't load correctly.
|
||||
*/
|
||||
public class ReactNativeApplicationEntryPoint {
|
||||
public static void loadReactNative(Context context) {
|
||||
try {
|
||||
SoLoader.init(context, OpenSourceMergedSoMapping.INSTANCE);
|
||||
} catch (IOException error) {
|
||||
throw new RuntimeException(error);
|
||||
}
|
||||
|
||||
if (com.facebook.react.BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
||||
DefaultNewArchitectureEntryPoint.load();
|
||||
}
|
||||
|
||||
if (com.facebook.react.BuildConfig.IS_EDGE_TO_EDGE_ENABLED) {
|
||||
WindowUtilKt.setEdgeToEdgeFeatureFlagOn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (com.facebook.react.BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
||||
DefaultNewArchitectureEntryPoint.load();
|
||||
}
|
||||
|
||||
if (com.facebook.react.BuildConfig.IS_EDGE_TO_EDGE_ENABLED) {
|
||||
WindowUtilKt.setEdgeToEdgeFeatureFlagOn();
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+114
-114
@@ -59,11 +59,11 @@ class GeneratePackageListTaskTest {
|
||||
assertThat(result)
|
||||
.isEqualTo(
|
||||
"""
|
||||
// @react-native/a-package
|
||||
import com.facebook.react.aPackage;
|
||||
// @react-native/another-package
|
||||
import com.facebook.react.anotherPackage;
|
||||
"""
|
||||
// @react-native/a-package
|
||||
import com.facebook.react.aPackage;
|
||||
// @react-native/another-package
|
||||
import com.facebook.react.anotherPackage;
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -85,10 +85,10 @@ class GeneratePackageListTaskTest {
|
||||
assertThat(result)
|
||||
.isEqualTo(
|
||||
"""
|
||||
,
|
||||
new APackage(),
|
||||
new AnotherPackage()
|
||||
"""
|
||||
,
|
||||
new APackage(),
|
||||
new AnotherPackage()
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -234,69 +234,69 @@ class GeneratePackageListTaskTest {
|
||||
assertThat(result)
|
||||
.isEqualTo(
|
||||
"""
|
||||
package com.facebook.react;
|
||||
package com.facebook.react;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.shell.MainPackageConfig;
|
||||
import com.facebook.react.shell.MainReactPackage;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.shell.MainPackageConfig;
|
||||
import com.facebook.react.shell.MainReactPackage;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
private MainPackageConfig mConfig;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
private MainPackageConfig mConfig;
|
||||
|
||||
public PackageList(ReactNativeHost reactNativeHost) {
|
||||
this(reactNativeHost, null);
|
||||
}
|
||||
public PackageList(ReactNativeHost reactNativeHost) {
|
||||
this(reactNativeHost, null);
|
||||
}
|
||||
|
||||
public PackageList(Application application) {
|
||||
this(application, null);
|
||||
}
|
||||
public PackageList(Application application) {
|
||||
this(application, null);
|
||||
}
|
||||
|
||||
public PackageList(ReactNativeHost reactNativeHost, MainPackageConfig config) {
|
||||
this.reactNativeHost = reactNativeHost;
|
||||
mConfig = config;
|
||||
}
|
||||
public PackageList(ReactNativeHost reactNativeHost, MainPackageConfig config) {
|
||||
this.reactNativeHost = reactNativeHost;
|
||||
mConfig = config;
|
||||
}
|
||||
|
||||
public PackageList(Application application, MainPackageConfig config) {
|
||||
this.reactNativeHost = null;
|
||||
this.application = application;
|
||||
mConfig = config;
|
||||
}
|
||||
public PackageList(Application application, MainPackageConfig config) {
|
||||
this.reactNativeHost = null;
|
||||
this.application = application;
|
||||
mConfig = config;
|
||||
}
|
||||
|
||||
private ReactNativeHost getReactNativeHost() {
|
||||
return this.reactNativeHost;
|
||||
}
|
||||
private ReactNativeHost getReactNativeHost() {
|
||||
return this.reactNativeHost;
|
||||
}
|
||||
|
||||
private Resources getResources() {
|
||||
return this.getApplication().getResources();
|
||||
}
|
||||
private Resources getResources() {
|
||||
return this.getApplication().getResources();
|
||||
}
|
||||
|
||||
private Application getApplication() {
|
||||
if (this.reactNativeHost == null) return this.application;
|
||||
return this.reactNativeHost.getApplication();
|
||||
}
|
||||
private Application getApplication() {
|
||||
if (this.reactNativeHost == null) return this.application;
|
||||
return this.reactNativeHost.getApplication();
|
||||
}
|
||||
|
||||
private Context getApplicationContext() {
|
||||
return this.getApplication().getApplicationContext();
|
||||
}
|
||||
private Context getApplicationContext() {
|
||||
return this.getApplication().getApplicationContext();
|
||||
}
|
||||
|
||||
public ArrayList<ReactPackage> getPackages() {
|
||||
return new ArrayList<>(Arrays.<ReactPackage>asList(
|
||||
new MainReactPackage(mConfig)
|
||||
));
|
||||
}
|
||||
}
|
||||
"""
|
||||
public ArrayList<ReactPackage> getPackages() {
|
||||
return new ArrayList<>(Arrays.<ReactPackage>asList(
|
||||
new MainReactPackage(mConfig)
|
||||
));
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -312,74 +312,74 @@ class GeneratePackageListTaskTest {
|
||||
assertThat(result)
|
||||
.isEqualTo(
|
||||
"""
|
||||
package com.facebook.react;
|
||||
package com.facebook.react;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.shell.MainPackageConfig;
|
||||
import com.facebook.react.shell.MainReactPackage;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.shell.MainPackageConfig;
|
||||
import com.facebook.react.shell.MainReactPackage;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
|
||||
// @react-native/a-package
|
||||
import com.facebook.react.aPackage;
|
||||
// @react-native/another-package
|
||||
import com.facebook.react.anotherPackage;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
private MainPackageConfig mConfig;
|
||||
// @react-native/a-package
|
||||
import com.facebook.react.aPackage;
|
||||
// @react-native/another-package
|
||||
import com.facebook.react.anotherPackage;
|
||||
|
||||
public PackageList(ReactNativeHost reactNativeHost) {
|
||||
this(reactNativeHost, null);
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
private MainPackageConfig mConfig;
|
||||
|
||||
public PackageList(Application application) {
|
||||
this(application, null);
|
||||
}
|
||||
public PackageList(ReactNativeHost reactNativeHost) {
|
||||
this(reactNativeHost, null);
|
||||
}
|
||||
|
||||
public PackageList(ReactNativeHost reactNativeHost, MainPackageConfig config) {
|
||||
this.reactNativeHost = reactNativeHost;
|
||||
mConfig = config;
|
||||
}
|
||||
public PackageList(Application application) {
|
||||
this(application, null);
|
||||
}
|
||||
|
||||
public PackageList(Application application, MainPackageConfig config) {
|
||||
this.reactNativeHost = null;
|
||||
this.application = application;
|
||||
mConfig = config;
|
||||
}
|
||||
public PackageList(ReactNativeHost reactNativeHost, MainPackageConfig config) {
|
||||
this.reactNativeHost = reactNativeHost;
|
||||
mConfig = config;
|
||||
}
|
||||
|
||||
private ReactNativeHost getReactNativeHost() {
|
||||
return this.reactNativeHost;
|
||||
}
|
||||
public PackageList(Application application, MainPackageConfig config) {
|
||||
this.reactNativeHost = null;
|
||||
this.application = application;
|
||||
mConfig = config;
|
||||
}
|
||||
|
||||
private Resources getResources() {
|
||||
return this.getApplication().getResources();
|
||||
}
|
||||
private ReactNativeHost getReactNativeHost() {
|
||||
return this.reactNativeHost;
|
||||
}
|
||||
|
||||
private Application getApplication() {
|
||||
if (this.reactNativeHost == null) return this.application;
|
||||
return this.reactNativeHost.getApplication();
|
||||
}
|
||||
private Resources getResources() {
|
||||
return this.getApplication().getResources();
|
||||
}
|
||||
|
||||
private Context getApplicationContext() {
|
||||
return this.getApplication().getApplicationContext();
|
||||
}
|
||||
private Application getApplication() {
|
||||
if (this.reactNativeHost == null) return this.application;
|
||||
return this.reactNativeHost.getApplication();
|
||||
}
|
||||
|
||||
public ArrayList<ReactPackage> getPackages() {
|
||||
return new ArrayList<>(Arrays.<ReactPackage>asList(
|
||||
new MainReactPackage(mConfig),
|
||||
new APackage(),
|
||||
new AnotherPackage()
|
||||
));
|
||||
}
|
||||
}
|
||||
"""
|
||||
private Context getApplicationContext() {
|
||||
return this.getApplication().getApplicationContext();
|
||||
}
|
||||
|
||||
public ArrayList<ReactPackage> getPackages() {
|
||||
return new ArrayList<>(Arrays.<ReactPackage>asList(
|
||||
new MainReactPackage(mConfig),
|
||||
new APackage(),
|
||||
new AnotherPackage()
|
||||
));
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+6
-6
@@ -34,9 +34,9 @@ class AgpConfiguratorUtilsTest {
|
||||
writeText(
|
||||
// language=xml
|
||||
"""
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
</manifest>
|
||||
"""
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
</manifest>
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -53,9 +53,9 @@ class AgpConfiguratorUtilsTest {
|
||||
writeText(
|
||||
// language=xml
|
||||
"""
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.react" >
|
||||
</manifest>
|
||||
"""
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.react" >
|
||||
</manifest>
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+36
-36
@@ -549,9 +549,9 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("gradle.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
VERSION_NAME=1000.0.0
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
VERSION_NAME=1000.0.0
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -560,9 +560,9 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=1000.0.0
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=1000.0.0
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -583,11 +583,11 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("gradle.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
VERSION_NAME=0.0.0-20221101-2019-cfe811ab1
|
||||
HERMES_VERSION_NAME=0.12.0-commitly-20221101-2019-cfe811ab1
|
||||
HERMES_V1_VERSION_NAME=250829098.0.0-stable
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
VERSION_NAME=0.0.0-20221101-2019-cfe811ab1
|
||||
HERMES_VERSION_NAME=0.12.0-commitly-20221101-2019-cfe811ab1
|
||||
HERMES_V1_VERSION_NAME=250829098.0.0-stable
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -596,9 +596,9 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=250829098.0.0-stable
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=250829098.0.0-stable
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -619,8 +619,8 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("gradle.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -629,8 +629,8 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -650,9 +650,9 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("gradle.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -661,9 +661,9 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -683,10 +683,10 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("gradle.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
react.internal.publishingGroup=io.github.test
|
||||
react.internal.hermesPublishingGroup=io.github.test
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
react.internal.publishingGroup=io.github.test
|
||||
react.internal.hermesPublishingGroup=io.github.test
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -695,9 +695,9 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -716,8 +716,8 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("gradle.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -726,9 +726,9 @@ class DependencyUtilsTest {
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+5
-5
@@ -320,11 +320,11 @@ class PathUtilsTest {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"name": "a-library",
|
||||
"codegenConfig": {}
|
||||
}
|
||||
"""
|
||||
{
|
||||
"name": "a-library",
|
||||
"codegenConfig": {}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+9
-9
@@ -150,11 +150,11 @@ class ProjectUtilsTest {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"name": "a-library",
|
||||
"codegenConfig": {}
|
||||
}
|
||||
"""
|
||||
{
|
||||
"name": "a-library",
|
||||
"codegenConfig": {}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -170,10 +170,10 @@ class ProjectUtilsTest {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"name": "a-library"
|
||||
}
|
||||
"""
|
||||
{
|
||||
"name": "a-library"
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+31
-31
@@ -238,30 +238,30 @@ class ReactSettingsExtensionTest {
|
||||
File(generatedFolder, "autolinking.json").apply {
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"root": "/",
|
||||
"reactNativePath": "/node_modules/react-native",
|
||||
"reactNativeVersion": "0.75",
|
||||
"dependencies": {},
|
||||
"healthChecks": [],
|
||||
"platforms": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
},
|
||||
"assets": [],
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {
|
||||
"sourceDir": "/",
|
||||
"appName": "app",
|
||||
"packageName": "com.TestApp",
|
||||
"applicationId": "com.TestApp",
|
||||
"mainActivity": ".MainActivity",
|
||||
"assets": []
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
{
|
||||
"root": "/",
|
||||
"reactNativePath": "/node_modules/react-native",
|
||||
"reactNativeVersion": "0.75",
|
||||
"dependencies": {},
|
||||
"healthChecks": [],
|
||||
"platforms": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
},
|
||||
"assets": [],
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {
|
||||
"sourceDir": "/",
|
||||
"appName": "app",
|
||||
"packageName": "com.TestApp",
|
||||
"applicationId": "com.TestApp",
|
||||
"mainActivity": ".MainActivity",
|
||||
"assets": []
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
@@ -309,13 +309,13 @@ class ReactSettingsExtensionTest {
|
||||
File(generatedFolder, "autolinking.json").apply {
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
}
|
||||
}
|
||||
"""
|
||||
{
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
+2
-2
@@ -197,10 +197,10 @@ class JsonUtilsTest {
|
||||
val validJson =
|
||||
createJsonFile(
|
||||
"""
|
||||
|
||||
|
||||
> AwesomeProject@0.0.1 npx
|
||||
> rnc-cli config
|
||||
|
||||
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"project": {
|
||||
|
||||
+30
@@ -10,11 +10,41 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const {version: packageVersion} = require('../package.json');
|
||||
const main = require('./configs/main');
|
||||
|
||||
module.exports = function (babel, options) {
|
||||
return main(options);
|
||||
};
|
||||
|
||||
let cacheKey;
|
||||
module.exports.getCacheKey = () => {
|
||||
if (cacheKey != null) {
|
||||
// Memoize
|
||||
return cacheKey;
|
||||
}
|
||||
if (!packageVersion.endsWith('-main')) {
|
||||
// Assume the integrity of package contents for published npm releases.
|
||||
cacheKey = packageVersion;
|
||||
return cacheKey;
|
||||
}
|
||||
// For anyone working with a `-main` version, contents may vary over time
|
||||
// even though the version does not. Hash the relevant contents of this
|
||||
// package. Lazy-load dependencies we only need on this slow path.
|
||||
const {createHash} = require('crypto');
|
||||
const {readFileSync} = require('fs');
|
||||
const key = createHash('md5');
|
||||
[
|
||||
readFileSync(__filename),
|
||||
readFileSync(require.resolve('./configs/main.js')),
|
||||
readFileSync(require.resolve('./configs/hmr.js')),
|
||||
readFileSync(require.resolve('./configs/lazy-imports.js')),
|
||||
readFileSync(require.resolve('./passthrough-syntax-plugins.js')),
|
||||
readFileSync(require.resolve('./plugin-warn-on-deep-imports.js')),
|
||||
].forEach(part => key.update(part));
|
||||
cacheKey = key.digest('hex');
|
||||
return cacheKey;
|
||||
};
|
||||
|
||||
module.exports.getPreset = main.getPreset;
|
||||
module.exports.passthroughSyntaxPlugins = require('./passthrough-syntax-plugins');
|
||||
|
||||
+2
-1
@@ -23,13 +23,14 @@ import type {
|
||||
*/
|
||||
|
||||
const {parseSync, transformFromAstSync} = require('@babel/core');
|
||||
const {getCacheKey: getPresetCacheKey} = require('@react-native/babel-preset');
|
||||
const makeHMRConfig = require('@react-native/babel-preset/src/configs/hmr');
|
||||
const crypto = require('crypto');
|
||||
const fs = require('fs');
|
||||
const nullthrows = require('nullthrows');
|
||||
const path = require('path');
|
||||
|
||||
const cacheKeyParts = [fs.readFileSync(__filename)];
|
||||
const cacheKeyParts = [getPresetCacheKey(), fs.readFileSync(__filename)];
|
||||
|
||||
// TS detection conditions copied from @react-native/babel-preset
|
||||
function isTypeScriptSource(fileName /*: string */) {
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ export interface RefreshControlPropsAndroid extends ViewProps {
|
||||
/**
|
||||
* Size of the refresh indicator, see RefreshControl.SIZE.
|
||||
*/
|
||||
size?: number | undefined;
|
||||
size?: 'default' | 'large' | undefined;
|
||||
}
|
||||
|
||||
export interface RefreshControlProps
|
||||
|
||||
@@ -449,6 +449,12 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
before we can get to the long term breaking change.
|
||||
*/
|
||||
if (instance != null) {
|
||||
// Register the input immediately when the ref is set so that focus()
|
||||
// can be called from ref callbacks
|
||||
// Double registering during useLayoutEffect is fine, because the underlying
|
||||
// state is a Set.
|
||||
TextInputState.registerInput(instance);
|
||||
|
||||
// $FlowFixMe[prop-missing] - See the explanation above.
|
||||
// $FlowFixMe[unsafe-object-assign]
|
||||
Object.assign(instance, {
|
||||
|
||||
@@ -21,8 +21,8 @@ const ViewNativeComponent: HostComponent<Props> =
|
||||
}));
|
||||
|
||||
interface NativeCommands {
|
||||
+focus: () => void;
|
||||
+blur: () => void;
|
||||
+focus: (viewRef: HostInstance) => void;
|
||||
+blur: (viewRef: HostInstance) => void;
|
||||
+hotspotUpdate: (viewRef: HostInstance, x: number, y: number) => void;
|
||||
+setPressed: (viewRef: HostInstance, pressed: boolean) => void;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTImageShadowView : RCTShadowView
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#import <React/RCTLog.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@implementation RCTImageShadowView
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import <React/RCTView.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@class RCTBridge;
|
||||
@class RCTImageSource;
|
||||
@@ -29,4 +29,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#import <React/RCTUtils.h>
|
||||
#import <React/UIView+React.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
/**
|
||||
* Determines whether an image of `currentSize` should be reloaded for display
|
||||
@@ -505,4 +505,4 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#import <React/RCTViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTImageViewManager : RCTViewManager
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTImageViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@@ -117,4 +117,4 @@ RCT_EXPORT_METHOD(queryCache
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+3
-2
@@ -14,6 +14,7 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
|
||||
import type {HostInstance} from 'react-native';
|
||||
|
||||
import ReactNativeElement from '../../../../src/private/webapis/dom/nodes/ReactNativeElement';
|
||||
import TextInput from '../../../Components/TextInput/TextInput';
|
||||
import TextInputState from '../../../Components/TextInput/TextInputState';
|
||||
import View from '../../../Components/View/View';
|
||||
import ReactFabricHostComponent from '../ReactFabricHostComponent';
|
||||
@@ -48,7 +49,7 @@ describe('ReactFabricPublicInstance', () => {
|
||||
const nodeRef = createRef<HostInstance>();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<View ref={nodeRef} />);
|
||||
root.render(<TextInput ref={nodeRef} />);
|
||||
});
|
||||
|
||||
const node = nullthrows(nodeRef.current);
|
||||
@@ -73,7 +74,7 @@ describe('ReactFabricPublicInstance', () => {
|
||||
const ref = createRef<HostInstance>();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<View ref={ref} />);
|
||||
root.render(<TextInput ref={ref} />);
|
||||
});
|
||||
|
||||
const node = nullthrows(ref.current);
|
||||
|
||||
@@ -373,7 +373,7 @@ export type GradientValue = {
|
||||
direction?: string | undefined;
|
||||
colorStops: ReadonlyArray<{
|
||||
color: ColorValue | null;
|
||||
positions?: ReadonlyArray<string[]> | undefined;
|
||||
positions?: ReadonlyArray<string> | undefined;
|
||||
}>;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import "RCTTextAttributes.h"
|
||||
|
||||
@@ -32,4 +32,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTBaseTextShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTShadowView+Layout.h>
|
||||
|
||||
@@ -159,4 +159,4 @@ static void RCTInlineViewYogaNodeDirtied(YGNodeConstRef node)
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,4 +18,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTBaseTextViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@implementation RCTBaseTextViewManager
|
||||
|
||||
@@ -61,4 +61,4 @@ RCT_REMAP_SHADOW_PROPERTY(textTransform, textAttributes.textTransform, RCTTextTr
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#import <React/RCTTextDecorationLineType.h>
|
||||
#import <React/RCTTextTransform.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -104,4 +104,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTTextAttributes.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTAssert.h>
|
||||
#import <React/RCTFont.h>
|
||||
@@ -355,4 +355,4 @@ static NSString *capitalizeText(NSString *text)
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -20,4 +20,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTRawTextShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTShadowView+Layout.h>
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,4 +18,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTRawTextViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTRawTextShadowView.h>
|
||||
|
||||
@@ -29,4 +29,4 @@ RCT_EXPORT_SHADOW_PROPERTY(text, NSString)
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import "RCTBaseTextShadowView.h"
|
||||
|
||||
@@ -30,4 +30,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTTextShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTBridge.h>
|
||||
#import <React/RCTShadowView+Layout.h>
|
||||
@@ -467,4 +467,4 @@ static float RCTTextShadowViewBaseline(YGNodeConstRef node, const float width, c
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTComponent.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@@ -31,4 +31,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTTextView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <MobileCoreServices/UTCoreTypes.h>
|
||||
|
||||
@@ -295,4 +295,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import "RCTBaseTextViewManager.h"
|
||||
|
||||
@@ -16,4 +16,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTTextViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTShadowView+Layout.h>
|
||||
#import <React/RCTShadowView.h>
|
||||
@@ -94,4 +94,4 @@ RCT_EXPORT_VIEW_PROPERTY(selectable, BOOL)
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "RCTBaseTextInputView.h"
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,4 +18,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTMultilineTextInputView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
@@ -64,4 +64,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "RCTBaseTextInputViewManager.h"
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,4 +18,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
#import <React/RCTMultilineTextInputView.h>
|
||||
#import <React/RCTMultilineTextInputViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@implementation RCTMultilineTextInputViewManager
|
||||
|
||||
@@ -25,4 +25,4 @@ RCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, backedTextInputView.dataDetectorTypes
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "RCTBaseTextShadowView.h"
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -27,4 +27,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTBaseTextInputShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTBridge.h>
|
||||
#import <React/RCTShadowView+Layout.h>
|
||||
@@ -365,4 +365,4 @@ static float RCTTextInputShadowViewBaseline(YGNodeConstRef node, const float wid
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTView.h>
|
||||
|
||||
@@ -65,4 +65,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTBaseTextInputView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTBridge.h>
|
||||
#import <React/RCTConvert.h>
|
||||
@@ -843,4 +843,4 @@ static BOOL findMismatch(NSString *first, NSString *second, NSRange *firstRange,
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#import "RCTBaseTextViewManager.h"
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTBaseTextInputViewManager : RCTBaseTextViewManager
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTBaseTextInputViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTBridge.h>
|
||||
#import <React/RCTConvert.h>
|
||||
@@ -181,4 +181,4 @@ RCT_EXPORT_METHOD(setTextAndSelection
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#import <React/RCTShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTInputAccessoryShadowView : RCTShadowView
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTInputAccessoryShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@class RCTBridge;
|
||||
@class RCTInputAccessoryViewContent;
|
||||
@@ -19,4 +19,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTInputAccessoryView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTBridge.h>
|
||||
#import <React/RCTTouchHandler.h>
|
||||
@@ -79,4 +79,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTInputAccessoryViewContent : UIView
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTInputAccessoryViewContent.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/UIView+React.h>
|
||||
|
||||
@@ -75,4 +75,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#import <React/RCTViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTInputAccessoryViewManager : RCTViewManager
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTInputAccessoryViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTInputAccessoryShadowView.h>
|
||||
#import <React/RCTInputAccessoryView.h>
|
||||
@@ -30,4 +30,4 @@ RCT_REMAP_VIEW_PROPERTY(backgroundColor, inputAccessoryView.backgroundColor, UIC
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "RCTBaseTextInputView.h"
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,4 +18,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTSinglelineTextInputView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTBridge.h>
|
||||
|
||||
@@ -40,4 +40,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "RCTBaseTextInputViewManager.h"
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,4 +18,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTSinglelineTextInputViewManager.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTBaseTextInputShadowView.h>
|
||||
#import <React/RCTSinglelineTextInputView.h>
|
||||
@@ -32,4 +32,4 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#import "RCTBaseTextShadowView.h"
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTVirtualTextShadowView : RCTBaseTextShadowView
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTVirtualTextShadowView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <React/RCTShadowView+Layout.h>
|
||||
#import <yoga/Yoga.h>
|
||||
@@ -39,4 +39,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <React/RCTComponent.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@@ -25,4 +25,4 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
#import <React/RCTVirtualTextView.h>
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
#ifndef RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
@implementation RCTVirtualTextView
|
||||
|
||||
@end
|
||||
|
||||
#endif // RCT_FIT_RM_OLD_COMPONENT
|
||||
#endif // RCT_REMOVE_LEGACY_ARCH
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user