Skip to content

Commit 0575dd1

Browse files
[BridgeJS] Hide it behind an experimental feature flag
1 parent 5c596cb commit 0575dd1

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Diff for: Plugins/BridgeJS/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# BridgeJS
22

3+
> Important: This feature is still experimental, and the API may change frequently. Use at your own risk
4+
> with `JAVASCRIPTKIT_EXPERIMENTAL_BRIDGEJS=1` environment variable.
5+
36
> Note: This documentation is intended for JavaScriptKit developers, not JavaScriptKit users.
47
58
## Overview

Diff for: Plugins/BridgeJS/Sources/BridgeJSCommandPlugin/BridgeJSCommandPlugin.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct BridgeJSCommandPlugin: CommandPlugin {
2727
Generated code will be placed in the target's 'Generated' directory.
2828
2929
OPTIONS:
30-
--target <target> Specify target(s) to generate bridge code for. If omitted,
30+
--target <target> Specify target(s) to generate bridge code for. If omitted,
3131
generates for all targets with JavaScriptKit dependency.
3232
"""
3333
}

Diff for: Plugins/PackageToJS/Sources/PackageToJS.swift

+5
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,11 @@ struct PackagingPlanner {
564564
packageInputs.append(packageJsonTask)
565565

566566
if exportedSkeletons.count > 0 || importedSkeletons.count > 0 {
567+
if ProcessInfo.processInfo.environment["JAVASCRIPTKIT_EXPERIMENTAL_BRIDGEJS"] == nil {
568+
fatalError(
569+
"BridgeJS is still an experimental feature. Set the environment variable JAVASCRIPTKIT_EXPERIMENTAL_BRIDGEJS=1 to enable."
570+
)
571+
}
567572
let bridgeJs = outputDir.appending(path: "bridge.js")
568573
let bridgeDts = outputDir.appending(path: "bridge.d.ts")
569574
packageInputs.append(

0 commit comments

Comments
 (0)