@builder.io/sdk-solid 1.0.20 → 1.0.21
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/dist/index.d.ts +3 -3
- package/lib/browser/dev.js +1 -1
- package/lib/browser/dev.jsx +1 -1
- package/lib/browser/index.js +1 -1
- package/lib/browser/index.jsx +1 -1
- package/lib/edge/dev.js +1 -1
- package/lib/edge/dev.jsx +1 -1
- package/lib/edge/index.js +1 -1
- package/lib/edge/index.jsx +1 -1
- package/lib/node/dev.js +23 -3
- package/lib/node/dev.jsx +23 -3
- package/lib/node/index.js +24 -3
- package/lib/node/index.jsx +24 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -938,11 +938,11 @@ interface GetContentOptions {
|
|
|
938
938
|
/**
|
|
939
939
|
* Optional override of the `fetch` function. (Defaults to global `fetch`)
|
|
940
940
|
*/
|
|
941
|
-
fetch?:
|
|
941
|
+
fetch?: (input: string, init?: object) => Promise<any>;
|
|
942
942
|
/**
|
|
943
|
-
* Optional fetch options to be passed to the `fetch` function.
|
|
943
|
+
* Optional fetch options to be passed as the second argument to the `fetch` function.
|
|
944
944
|
*/
|
|
945
|
-
fetchOptions?:
|
|
945
|
+
fetchOptions?: object;
|
|
946
946
|
}
|
|
947
947
|
|
|
948
948
|
type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
package/lib/browser/dev.js
CHANGED
package/lib/browser/dev.jsx
CHANGED
package/lib/browser/index.js
CHANGED
package/lib/browser/index.jsx
CHANGED
package/lib/edge/dev.js
CHANGED
package/lib/edge/dev.jsx
CHANGED
package/lib/edge/index.js
CHANGED
package/lib/edge/index.jsx
CHANGED
package/lib/node/dev.js
CHANGED
|
@@ -381,8 +381,28 @@ if (typeof output === 'object' && output !== null) {
|
|
|
381
381
|
output;
|
|
382
382
|
`;
|
|
383
383
|
};
|
|
384
|
+
var IVM_INSTANCE = null;
|
|
385
|
+
var getIvm = () => {
|
|
386
|
+
try {
|
|
387
|
+
if (IVM_INSTANCE)
|
|
388
|
+
return IVM_INSTANCE;
|
|
389
|
+
const dynRequiredIvm = safeDynamicRequire("isolated-vm");
|
|
390
|
+
if (dynRequiredIvm)
|
|
391
|
+
return dynRequiredIvm;
|
|
392
|
+
} catch (error2) {
|
|
393
|
+
logger.error("isolated-vm import error.", error2);
|
|
394
|
+
}
|
|
395
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
396
|
+
|
|
397
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
398
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
399
|
+
a server-only execution path within your application.
|
|
400
|
+
|
|
401
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
402
|
+
`);
|
|
403
|
+
};
|
|
384
404
|
var getIsolateContext = () => {
|
|
385
|
-
const ivm =
|
|
405
|
+
const ivm = getIvm();
|
|
386
406
|
const isolate = new ivm.Isolate({
|
|
387
407
|
memoryLimit: 128
|
|
388
408
|
});
|
|
@@ -397,7 +417,7 @@ var runInNode = ({
|
|
|
397
417
|
rootSetState,
|
|
398
418
|
rootState
|
|
399
419
|
}) => {
|
|
400
|
-
const ivm =
|
|
420
|
+
const ivm = getIvm();
|
|
401
421
|
const state = fastClone({
|
|
402
422
|
...rootState,
|
|
403
423
|
...localState
|
|
@@ -4575,7 +4595,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4575
4595
|
}
|
|
4576
4596
|
|
|
4577
4597
|
// src/constants/sdk-version.ts
|
|
4578
|
-
var SDK_VERSION = "1.0.
|
|
4598
|
+
var SDK_VERSION = "1.0.21";
|
|
4579
4599
|
|
|
4580
4600
|
// src/functions/register.ts
|
|
4581
4601
|
var registry = {};
|
package/lib/node/dev.jsx
CHANGED
|
@@ -370,8 +370,28 @@ if (typeof output === 'object' && output !== null) {
|
|
|
370
370
|
output;
|
|
371
371
|
`;
|
|
372
372
|
};
|
|
373
|
+
var IVM_INSTANCE = null;
|
|
374
|
+
var getIvm = () => {
|
|
375
|
+
try {
|
|
376
|
+
if (IVM_INSTANCE)
|
|
377
|
+
return IVM_INSTANCE;
|
|
378
|
+
const dynRequiredIvm = safeDynamicRequire("isolated-vm");
|
|
379
|
+
if (dynRequiredIvm)
|
|
380
|
+
return dynRequiredIvm;
|
|
381
|
+
} catch (error2) {
|
|
382
|
+
logger.error("isolated-vm import error.", error2);
|
|
383
|
+
}
|
|
384
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
385
|
+
|
|
386
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
387
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
388
|
+
a server-only execution path within your application.
|
|
389
|
+
|
|
390
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
391
|
+
`);
|
|
392
|
+
};
|
|
373
393
|
var getIsolateContext = () => {
|
|
374
|
-
const ivm =
|
|
394
|
+
const ivm = getIvm();
|
|
375
395
|
const isolate = new ivm.Isolate({
|
|
376
396
|
memoryLimit: 128
|
|
377
397
|
});
|
|
@@ -386,7 +406,7 @@ var runInNode = ({
|
|
|
386
406
|
rootSetState,
|
|
387
407
|
rootState
|
|
388
408
|
}) => {
|
|
389
|
-
const ivm =
|
|
409
|
+
const ivm = getIvm();
|
|
390
410
|
const state = fastClone({
|
|
391
411
|
...rootState,
|
|
392
412
|
...localState
|
|
@@ -4160,7 +4180,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4160
4180
|
}
|
|
4161
4181
|
|
|
4162
4182
|
// src/constants/sdk-version.ts
|
|
4163
|
-
var SDK_VERSION = "1.0.
|
|
4183
|
+
var SDK_VERSION = "1.0.21";
|
|
4164
4184
|
|
|
4165
4185
|
// src/functions/register.ts
|
|
4166
4186
|
var registry = {};
|
package/lib/node/index.js
CHANGED
|
@@ -128,6 +128,7 @@ function getBlockComponentOptions(block) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// src/helpers/logger.ts
|
|
131
|
+
var MSG_PREFIX = "[Builder.io]: ";
|
|
131
132
|
var logger = {
|
|
132
133
|
log: (...message) => void 0,
|
|
133
134
|
error: (...message) => void 0,
|
|
@@ -379,8 +380,28 @@ if (typeof output === 'object' && output !== null) {
|
|
|
379
380
|
output;
|
|
380
381
|
`;
|
|
381
382
|
};
|
|
383
|
+
var IVM_INSTANCE = null;
|
|
384
|
+
var getIvm = () => {
|
|
385
|
+
try {
|
|
386
|
+
if (IVM_INSTANCE)
|
|
387
|
+
return IVM_INSTANCE;
|
|
388
|
+
const dynRequiredIvm = safeDynamicRequire("isolated-vm");
|
|
389
|
+
if (dynRequiredIvm)
|
|
390
|
+
return dynRequiredIvm;
|
|
391
|
+
} catch (error2) {
|
|
392
|
+
logger.error("isolated-vm import error.", error2);
|
|
393
|
+
}
|
|
394
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
395
|
+
|
|
396
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
397
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
398
|
+
a server-only execution path within your application.
|
|
399
|
+
|
|
400
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
401
|
+
`);
|
|
402
|
+
};
|
|
382
403
|
var getIsolateContext = () => {
|
|
383
|
-
const ivm =
|
|
404
|
+
const ivm = getIvm();
|
|
384
405
|
const isolate = new ivm.Isolate({
|
|
385
406
|
memoryLimit: 128
|
|
386
407
|
});
|
|
@@ -395,7 +416,7 @@ var runInNode = ({
|
|
|
395
416
|
rootSetState,
|
|
396
417
|
rootState
|
|
397
418
|
}) => {
|
|
398
|
-
const ivm =
|
|
419
|
+
const ivm = getIvm();
|
|
399
420
|
const state = fastClone({
|
|
400
421
|
...rootState,
|
|
401
422
|
...localState
|
|
@@ -4559,7 +4580,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4559
4580
|
}
|
|
4560
4581
|
|
|
4561
4582
|
// src/constants/sdk-version.ts
|
|
4562
|
-
var SDK_VERSION = "1.0.
|
|
4583
|
+
var SDK_VERSION = "1.0.21";
|
|
4563
4584
|
|
|
4564
4585
|
// src/functions/register.ts
|
|
4565
4586
|
var registry = {};
|
package/lib/node/index.jsx
CHANGED
|
@@ -114,6 +114,7 @@ function getBlockComponentOptions(block) {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
// src/helpers/logger.ts
|
|
117
|
+
var MSG_PREFIX = "[Builder.io]: ";
|
|
117
118
|
var logger = {
|
|
118
119
|
log: (...message) => void 0,
|
|
119
120
|
error: (...message) => void 0,
|
|
@@ -368,8 +369,28 @@ if (typeof output === 'object' && output !== null) {
|
|
|
368
369
|
output;
|
|
369
370
|
`;
|
|
370
371
|
};
|
|
372
|
+
var IVM_INSTANCE = null;
|
|
373
|
+
var getIvm = () => {
|
|
374
|
+
try {
|
|
375
|
+
if (IVM_INSTANCE)
|
|
376
|
+
return IVM_INSTANCE;
|
|
377
|
+
const dynRequiredIvm = safeDynamicRequire("isolated-vm");
|
|
378
|
+
if (dynRequiredIvm)
|
|
379
|
+
return dynRequiredIvm;
|
|
380
|
+
} catch (error2) {
|
|
381
|
+
logger.error("isolated-vm import error.", error2);
|
|
382
|
+
}
|
|
383
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
384
|
+
|
|
385
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
386
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
387
|
+
a server-only execution path within your application.
|
|
388
|
+
|
|
389
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
390
|
+
`);
|
|
391
|
+
};
|
|
371
392
|
var getIsolateContext = () => {
|
|
372
|
-
const ivm =
|
|
393
|
+
const ivm = getIvm();
|
|
373
394
|
const isolate = new ivm.Isolate({
|
|
374
395
|
memoryLimit: 128
|
|
375
396
|
});
|
|
@@ -384,7 +405,7 @@ var runInNode = ({
|
|
|
384
405
|
rootSetState,
|
|
385
406
|
rootState
|
|
386
407
|
}) => {
|
|
387
|
-
const ivm =
|
|
408
|
+
const ivm = getIvm();
|
|
388
409
|
const state = fastClone({
|
|
389
410
|
...rootState,
|
|
390
411
|
...localState
|
|
@@ -4144,7 +4165,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4144
4165
|
}
|
|
4145
4166
|
|
|
4146
4167
|
// src/constants/sdk-version.ts
|
|
4147
|
-
var SDK_VERSION = "1.0.
|
|
4168
|
+
var SDK_VERSION = "1.0.21";
|
|
4148
4169
|
|
|
4149
4170
|
// src/functions/register.ts
|
|
4150
4171
|
var registry = {};
|