-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
ReactInstanceSettings.h
279 lines (207 loc) · 8.06 KB
/
ReactInstanceSettings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "ReactInstanceSettings.g.h"
#if _DEBUG
#define REACT_DEFAULT_USE_DEVELOPER_SUPPORT true
#define REACT_DEFAULT_USE_WEB_DEBUGGER true
#define REACT_DEFAULT_USE_FAST_REFRESH true
#define REACT_DEFAULT_USE_LIVE_RELOAD false
#define REACT_DEFAULT_ENABLE_DEVELOPER_MENU true
#else
#define REACT_DEFAULT_USE_DEVELOPER_SUPPORT false
#define REACT_DEFAULT_USE_WEB_DEBUGGER false
#define REACT_DEFAULT_USE_FAST_REFRESH false
#define REACT_DEFAULT_USE_LIVE_RELOAD false
#define REACT_DEFAULT_ENABLE_DEVELOPER_MENU false
#endif // _DEBUG
namespace winrt::Microsoft::ReactNative::implementation {
struct ReactInstanceSettings : ReactInstanceSettingsT<ReactInstanceSettings> {
ReactInstanceSettings() = default;
IReactPropertyBag Properties() noexcept;
hstring MainComponentName() noexcept;
void MainComponentName(hstring const &value) noexcept;
bool UseDeveloperSupport() noexcept;
void UseDeveloperSupport(bool value) noexcept;
hstring JavaScriptMainModuleName() noexcept;
void JavaScriptMainModuleName(hstring const &value) noexcept;
hstring JavaScriptBundleFile() noexcept;
void JavaScriptBundleFile(hstring const &value) noexcept;
bool UseWebDebugger() noexcept;
void UseWebDebugger(bool value) noexcept;
bool UseFastRefresh() noexcept;
void UseFastRefresh(bool value) noexcept;
bool UseLiveReload() noexcept;
void UseLiveReload(bool value) noexcept;
bool UseDirectDebugger() noexcept;
void UseDirectDebugger(bool value) noexcept;
bool DebuggerBreakOnNextLine() noexcept;
void DebuggerBreakOnNextLine(bool value) noexcept;
bool UseJsi() noexcept;
void UseJsi(bool value) noexcept;
bool EnableJITCompilation() noexcept;
void EnableJITCompilation(bool value) noexcept;
bool EnableByteCodeCaching() noexcept;
void EnableByteCodeCaching(bool value) noexcept;
bool EnableDeveloperMenu() noexcept;
void EnableDeveloperMenu(bool value) noexcept;
hstring ByteCodeFileUri() noexcept;
void ByteCodeFileUri(hstring const &value) noexcept;
hstring DebugHost() noexcept;
void DebugHost(hstring const &value) noexcept;
hstring DebugBundlePath() noexcept;
void DebugBundlePath(hstring const &value) noexcept;
hstring BundleRootPath() noexcept;
void BundleRootPath(hstring const &value) noexcept;
uint16_t DebuggerPort() noexcept;
void DebuggerPort(uint16_t value) noexcept;
IRedBoxHandler RedBoxHandler() noexcept;
void RedBoxHandler(IRedBoxHandler const &value) noexcept;
private:
IReactPropertyBag m_properties{ReactPropertyBagHelper::CreatePropertyBag()};
hstring m_mainComponentName{};
bool m_useDeveloperSupport{REACT_DEFAULT_USE_DEVELOPER_SUPPORT};
hstring m_javaScriptMainModuleName{};
hstring m_javaScriptBundleFile{};
bool m_useWebDebugger{REACT_DEFAULT_USE_WEB_DEBUGGER};
bool m_useFastRefresh{REACT_DEFAULT_USE_FAST_REFRESH};
bool m_useLiveReload{REACT_DEFAULT_USE_LIVE_RELOAD};
bool m_useDirectDebugger{false};
bool m_debuggerBreakOnNextLine{false};
bool m_useJsi{true};
bool m_enableJITCompilation{true};
bool m_enableByteCodeCaching{false};
bool m_enableDeveloperMenu{REACT_DEFAULT_ENABLE_DEVELOPER_MENU};
hstring m_byteCodeFileUri{};
hstring m_debugHost{};
hstring m_debugBundlePath{};
hstring m_bundleRootPath{};
uint16_t m_debuggerPort{9229};
IRedBoxHandler m_redBoxHandler{nullptr};
};
} // namespace winrt::Microsoft::ReactNative::implementation
namespace winrt::Microsoft::ReactNative::factory_implementation {
struct ReactInstanceSettings : ReactInstanceSettingsT<ReactInstanceSettings, implementation::ReactInstanceSettings> {};
} // namespace winrt::Microsoft::ReactNative::factory_implementation
namespace winrt::Microsoft::ReactNative::implementation {
//=============================================================================================
// ReactInstanceSettings inline implementation
//=============================================================================================
inline IReactPropertyBag ReactInstanceSettings::Properties() noexcept {
return m_properties;
}
inline hstring ReactInstanceSettings::MainComponentName() noexcept {
return m_mainComponentName;
}
inline void ReactInstanceSettings::MainComponentName(hstring const &value) noexcept {
m_mainComponentName = value;
}
inline bool ReactInstanceSettings::UseDeveloperSupport() noexcept {
return m_useDeveloperSupport;
}
inline void ReactInstanceSettings::UseDeveloperSupport(bool value) noexcept {
m_useDeveloperSupport = value;
}
inline hstring ReactInstanceSettings::JavaScriptMainModuleName() noexcept {
return m_javaScriptMainModuleName;
}
inline void ReactInstanceSettings::JavaScriptMainModuleName(hstring const &value) noexcept {
m_javaScriptMainModuleName = value;
}
inline hstring ReactInstanceSettings::JavaScriptBundleFile() noexcept {
return m_javaScriptBundleFile;
}
inline void ReactInstanceSettings::JavaScriptBundleFile(hstring const &value) noexcept {
m_javaScriptBundleFile = value;
}
inline bool ReactInstanceSettings::UseWebDebugger() noexcept {
return m_useWebDebugger;
}
inline void ReactInstanceSettings::UseWebDebugger(bool value) noexcept {
m_useWebDebugger = value;
}
inline bool ReactInstanceSettings::UseFastRefresh() noexcept {
return m_useFastRefresh;
}
inline void ReactInstanceSettings::UseFastRefresh(bool value) noexcept {
m_useFastRefresh = value;
}
inline bool ReactInstanceSettings::UseLiveReload() noexcept {
return m_useLiveReload;
}
inline void ReactInstanceSettings::UseLiveReload(bool value) noexcept {
m_useLiveReload = value;
}
inline bool ReactInstanceSettings::UseDirectDebugger() noexcept {
return m_useDirectDebugger;
}
inline void ReactInstanceSettings::UseDirectDebugger(bool value) noexcept {
m_useDirectDebugger = value;
}
inline bool ReactInstanceSettings::DebuggerBreakOnNextLine() noexcept {
return m_debuggerBreakOnNextLine;
}
inline void ReactInstanceSettings::DebuggerBreakOnNextLine(bool value) noexcept {
m_debuggerBreakOnNextLine = value;
}
inline bool ReactInstanceSettings::UseJsi() noexcept {
return m_useJsi;
}
inline void ReactInstanceSettings::UseJsi(bool value) noexcept {
m_useJsi = value;
}
inline bool ReactInstanceSettings::EnableJITCompilation() noexcept {
return m_enableJITCompilation;
}
inline void ReactInstanceSettings::EnableJITCompilation(bool value) noexcept {
m_enableJITCompilation = value;
}
inline bool ReactInstanceSettings::EnableByteCodeCaching() noexcept {
return m_enableByteCodeCaching;
}
inline void ReactInstanceSettings::EnableByteCodeCaching(bool value) noexcept {
m_enableByteCodeCaching = value;
}
inline bool ReactInstanceSettings::EnableDeveloperMenu() noexcept {
return m_enableDeveloperMenu;
}
inline void ReactInstanceSettings::EnableDeveloperMenu(bool value) noexcept {
m_enableDeveloperMenu = value;
}
inline hstring ReactInstanceSettings::ByteCodeFileUri() noexcept {
return m_byteCodeFileUri;
}
inline void ReactInstanceSettings::ByteCodeFileUri(hstring const &value) noexcept {
m_byteCodeFileUri = value;
}
inline hstring ReactInstanceSettings::DebugHost() noexcept {
return m_debugHost;
}
inline void ReactInstanceSettings::DebugHost(hstring const &value) noexcept {
m_debugHost = value;
}
inline hstring ReactInstanceSettings::DebugBundlePath() noexcept {
return m_debugBundlePath;
}
inline void ReactInstanceSettings::DebugBundlePath(hstring const &value) noexcept {
m_debugBundlePath = value;
}
inline hstring ReactInstanceSettings::BundleRootPath() noexcept {
return m_bundleRootPath;
}
inline void ReactInstanceSettings::BundleRootPath(hstring const &value) noexcept {
m_bundleRootPath = value;
}
inline uint16_t ReactInstanceSettings::DebuggerPort() noexcept {
return m_debuggerPort;
}
inline void ReactInstanceSettings::DebuggerPort(uint16_t value) noexcept {
m_debuggerPort = value;
}
inline IRedBoxHandler ReactInstanceSettings::RedBoxHandler() noexcept {
return m_redBoxHandler;
}
inline void ReactInstanceSettings::RedBoxHandler(IRedBoxHandler const &value) noexcept {
m_redBoxHandler = value;
}
} // namespace winrt::Microsoft::ReactNative::implementation