Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

externalize @player-ui/player from native bundles #483

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions core/make-flow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "MakeFlow"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/make-flow",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "MakeFlow",
native_bundle = NATIVE_BUNDLE,
deps = [
":node_modules/@player-ui/types",
],
Expand Down
9 changes: 7 additions & 2 deletions core/partial-match-registry/BUILD
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

tsup_config(name = "tsup_config")
NATIVE_BUNDLE = "Registry"

tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/partial-match-registry",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "Registry",
native_bundle = NATIVE_BUNDLE,
deps = [
"//:node_modules/@types/dlv",
"//:node_modules/dlv",
Expand Down
10 changes: 8 additions & 2 deletions core/player/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

# TODO: Would be nice to macro all the native things to avoid missing this setup (consequence is bundling Player in a plugin bundle)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any estimate for how much effort this would require? If its not huge would it be worth it to just do it now?

NATIVE_BUNDLE = "Player"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/player",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "Player",
native_bundle = NATIVE_BUNDLE,
test_deps = [
":node_modules/@player-ui/make-flow",
"//:vitest_config",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"ebnf": "^1.9.0",
"error-polyfill": "^0.1.3",
"esbuild-wasm": "^0.19.8",
"esbuild-plugin-external-global": "^1.0.1",
"eslint": "^8.54.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
Expand Down
9 changes: 7 additions & 2 deletions plugins/async-node/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "AsyncNodePlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/async-node-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "AsyncNodePlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/beacon/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "BeaconPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/beacon-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "BeaconPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/check-path/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "CheckPathPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/check-path-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "CheckPathPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/common-expressions/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "CommonExpressionsPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/common-expressions-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "CommonExpressionsPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/common-types/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "CommonTypesPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/common-types-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "CommonTypesPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/computed-properties/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "ComputedPropertiesPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/computed-properties-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ComputedPropertiesPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/expression/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "ExpressionPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/expression-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ExpressionPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/external-action/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "ExternalActionPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/external-action-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ExternalActionPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/markdown/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "MarkdownPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/markdown-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "MarkdownPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
":node_modules/@player-ui/types",
Expand Down
9 changes: 7 additions & 2 deletions plugins/metrics/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "MetricsPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/metrics-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "MetricsPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/partial-match-fingerprint/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "PartialMatchFingerprintPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/partial-match-fingerprint-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "PartialMatchFingerprintPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/pubsub/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "PubSubPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/pubsub-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "PubSubPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/reference-assets/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")
load("@rules_player//player:defs.bzl", "js_xlr_pipeline")

NATIVE_BUNDLE = "ReferenceAssetsPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_xlr_pipeline(
package_name = "@player-ui/reference-assets-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ReferenceAssetsPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
Loading