mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51902 changelog: [internal] Reviewed By: andrewdacenko Differential Revision: D76240769 fbshipit-source-id: 83d13c0446f86caf66addf82e1a06c5dd81388be
38 lines
1010 B
C++
38 lines
1010 B
C++
/*
|
|
* 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.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <FBReactNativeSpec/FBReactNativeSpecJSI.h>
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace facebook::react {
|
|
|
|
class DevServerHelper;
|
|
|
|
using SourceCodeConstants = NativeSourceCodeSourceCodeConstants<std::string>;
|
|
|
|
template <>
|
|
struct Bridging<SourceCodeConstants>
|
|
: NativeSourceCodeSourceCodeConstantsBridging<SourceCodeConstants> {};
|
|
|
|
class SourceCodeModule : public NativeSourceCodeCxxSpec<SourceCodeModule> {
|
|
public:
|
|
explicit SourceCodeModule(
|
|
std::shared_ptr<CallInvoker> jsInvoker,
|
|
std::shared_ptr<DevServerHelper> devServerHelper = nullptr)
|
|
: NativeSourceCodeCxxSpec(jsInvoker), devServerHelper_(devServerHelper) {}
|
|
|
|
SourceCodeConstants getConstants(jsi::Runtime& rt);
|
|
|
|
private:
|
|
std::weak_ptr<DevServerHelper> devServerHelper_;
|
|
};
|
|
|
|
} // namespace facebook::react
|