@builder.io/sdk-solid 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.5.2
2
+
3
+ - No Changes.
4
+
1
5
  ### 0.5.1
2
6
 
3
7
  - Fix: make `RenderBlocks` properties `context` and `registeredComponents` optional for external use.
package/README.md CHANGED
@@ -9,3 +9,7 @@ This SDK is generated by [Mitosis](https://github.com/BuilderIO/mitosis). To see
9
9
  ## Fetch
10
10
 
11
11
  This Package uses fetch. See [these docs](https://github.com/BuilderIO/this-package-uses-fetch/blob/main/README.md) for more information.
12
+
13
+ ## Non-Node.js Runtimes (Edge, Serverless)
14
+
15
+ If planning to deploy your app to a non-Node.js runtime (like Edge or Serverless functions), make sure to read the [Non-Node.js Runtimes](../../README.md#non-nodejs-runtimes-edge-serverless) section of the main README.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./solid-index.jsx",
@@ -18,11 +18,18 @@
18
18
  "solid-styled-components": "^0.27.6"
19
19
  },
20
20
  "peerDependencies": {
21
- "solid-js": "^1.5.7"
21
+ "solid-js": ">=1.5.7"
22
22
  },
23
23
  "devDependencies": {
24
- "solid-js": "^1.5.7",
24
+ "nx": "^16.6.0",
25
+ "nx-cloud": "^16.2.0",
26
+ "solid-js": ">=1.5.7",
25
27
  "vite": "^3.0.4",
26
28
  "vite-plugin-solid": "^2.2.6"
29
+ },
30
+ "nx": {
31
+ "implicitDependencies": [
32
+ "@builder.io/sdks"
33
+ ]
27
34
  }
28
35
  }
@@ -6,6 +6,7 @@ function Text(props) {
6
6
  style={{
7
7
  outline: "none",
8
8
  }}
9
+ {...{}}
9
10
  ></span>
10
11
  );
11
12
  }
@@ -37,6 +37,18 @@ function ContentVariants(props) {
37
37
  .join("");
38
38
  }
39
39
 
40
+ function defaultContent() {
41
+ return shouldRenderVariants()
42
+ ? {
43
+ ...props.content,
44
+ testVariationId: props.content?.id,
45
+ }
46
+ : handleABTestingSync({
47
+ item: props.content,
48
+ canTrack: getDefaultCanTrack(props.canTrack),
49
+ });
50
+ }
51
+
40
52
  onMount(() => {
41
53
  /**
42
54
  * We unmount the non-winning variants post-hydration in Vue.
@@ -81,14 +93,7 @@ function ContentVariants(props) {
81
93
  </Show>
82
94
  <ContentComponent
83
95
  {...{}}
84
- content={
85
- shouldRenderVariants()
86
- ? props.content
87
- : handleABTestingSync({
88
- item: props.content,
89
- canTrack: getDefaultCanTrack(props.canTrack),
90
- })
91
- }
96
+ content={defaultContent()}
92
97
  classNameProp={`variant-${props.content?.id}`}
93
98
  showContent={true}
94
99
  model={props.model}
@@ -1 +1,2 @@
1
- export const SDK_VERSION = "0.5.1"
1
+ const SDK_VERSION = "UNKNOWN_VERSION";
2
+ export { SDK_VERSION }
@@ -2,7 +2,21 @@ import { logger } from "../../helpers/logger.js";
2
2
  import { isBrowser } from "../is-browser.js";
3
3
  import { isEditing } from "../is-editing.js";
4
4
  import { isNonNodeServer } from "../is-non-node-server.js";
5
- import { runInNonNode } from "./non-node-runtime.js";
5
+ let runInNonNode;
6
+ if (isNonNodeServer()) {
7
+ import("./non-node-runtime.js").then(m => {
8
+ runInNonNode = m.runInNonNode;
9
+ }).catch(err => {
10
+ const ERROR_MESSAGE = `Error importing JS interpreter for non-Node.js runtimes. Make sure \`js-interpreter\` is installed.
11
+ Read more here: https://github.com/BuilderIO/builder/tree/main/packages/sdks/README.md#non-nodejs-runtimes-edge-serverless
12
+ `;
13
+ logger.error(ERROR_MESSAGE, err);
14
+ runInNonNode = (..._args) => {
15
+ logger.error(ERROR_MESSAGE);
16
+ return void 0;
17
+ };
18
+ });
19
+ }
6
20
  function evaluate({
7
21
  code,
8
22
  context,
@@ -2795,7 +2795,7 @@ Interpreter.prototype["getGlobalScope"] = Interpreter.prototype.getGlobalScope;
2795
2795
  Interpreter.prototype["getStateStack"] = Interpreter.prototype.getStateStack;
2796
2796
  Interpreter.prototype["setStateStack"] = Interpreter.prototype.setStateStack;
2797
2797
  Interpreter["VALUE_IN_DESCRIPTOR"] = Interpreter.VALUE_IN_DESCRIPTOR;
2798
- import { parse } from "acorn";
2798
+ import { parse } from "./acorn";
2799
2799
  Interpreter.nativeGlobal.acornParse = parse;
2800
2800
  var stdin_default = Interpreter;
2801
2801
  export { stdin_default as default }