Skip to content

Commit

Permalink
Convert com.facebook.react.devsupport.HMRClient to Kotlin (facebook…
Browse files Browse the repository at this point in the history
…#49089)

Summary:
Pull Request resolved: facebook#49089

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: tdn120

Differential Revision: D68954223

fbshipit-source-id: 6dd6e33ade211a6df2eea7a8dd761cc427bfd5c3
  • Loading branch information
cortinico authored and facebook-github-bot committed Feb 3, 2025
1 parent e45883e commit 17f7bf3
Showing 1 changed file with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.devsupport;
package com.facebook.react.devsupport

import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.JavaScriptModule

/**
* JS module interface for HMRClient
*
* <p>The HMR(Hot Module Replacement)Client allows for the application to receive updates from Metro
* The HMR(Hot Module Replacement)Client allows for the application to receive updates from Metro
* (over a web socket), allowing for injection of JavaScript to the running application (without a
* refresh).
*/
public interface HMRClient extends JavaScriptModule {
public interface HMRClient : JavaScriptModule {

/**
* Enable the HMRClient so that the client will receive updates from Metro.
Expand All @@ -27,20 +27,26 @@ public interface HMRClient extends JavaScriptModule {
* @param port The port that the HMRClient should communicate with on the host.
* @param isEnabled Whether HMR is enabled initially.
* @param scheme The protocol that the HMRClient should communicate with on the host (defaults to
* http).
* http).
*/
void setup(
String platform, String bundleEntry, String host, int port, boolean isEnabled, String scheme);
public fun setup(
platform: String?,
bundleEntry: String?,
host: String?,
port: Int,
isEnabled: Boolean,
scheme: String?
)

/** Registers an additional JS bundle with HMRClient. */
void registerBundle(String bundleUrl);
public fun registerBundle(bundleUrl: String?)

/**
* Sets up a connection to the packager when called the first time. Ensures code updates received
* from the packager are applied.
*/
void enable();
public fun enable()

/** Turns off the HMR client so it doesn't process updates from the packager. */
void disable();
public fun disable()
}

0 comments on commit 17f7bf3

Please sign in to comment.