@barefootjs/test 0.27.0 → 0.28.1
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.js +62 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -189819,6 +189819,7 @@ var ErrorCodes = {
|
|
|
189819
189819
|
SHARED_PROGRAM_REQUIRED: "BF050",
|
|
189820
189820
|
WRONG_PACKAGE_IMPORT: "BF051",
|
|
189821
189821
|
BUILTIN_REQUIRES_IMPORT: "BF054",
|
|
189822
|
+
INLINED_IMPORT_MISSING_EXPORT: "BF055",
|
|
189822
189823
|
UNDECLARED_INIT_STATEMENT_REFERENCE: "BF052",
|
|
189823
189824
|
STRIPPED_CLIENT_IMPORT_REFERENCED: "BF053",
|
|
189824
189825
|
STAGE_REACTIVE_IN_TEMPLATE: "BF060",
|
|
@@ -189849,6 +189850,7 @@ var errorMessages = {
|
|
|
189849
189850
|
[ErrorCodes.BUILTIN_REQUIRES_IMPORT]: "Built-in <Async> / <Region> must be imported from '@barefootjs/client'. " + "The compiler recognises these tags by their import (not by tag name), " + "so an unimported tag with this name is treated as an undeclared component.",
|
|
189850
189851
|
[ErrorCodes.UNDECLARED_INIT_STATEMENT_REFERENCE]: "Init statement references an undeclared identifier. Declare it at module scope, inside the component, or import it — otherwise ESM strict mode throws ReferenceError at runtime.",
|
|
189851
189852
|
[ErrorCodes.STRIPPED_CLIENT_IMPORT_REFERENCED]: "Import was stripped from the client bundle but its binding is still referenced. Client components ('use client' .tsx) are not callable as plain functions from imperative .ts modules — render them as JSX from a 'use client' parent instead. If the flagged name is a local shadow rather than the stripped import, please file an issue.",
|
|
189853
|
+
[ErrorCodes.INLINED_IMPORT_MISSING_EXPORT]: "An inlined relative import requests a name the target module does not export. The client bundle would throw ReferenceError at load.",
|
|
189852
189854
|
[ErrorCodes.STAGE_REACTIVE_IN_TEMPLATE]: "Reactive binding (signal getter or memo) referenced from template scope. The template lambda runs at module scope without the reactive context, so the value cannot be evaluated at SSR. Wrap the JSX expression in /* @client */ to defer it to hydrate, or restructure so the template uses a prop or static value.",
|
|
189853
189855
|
[ErrorCodes.STAGE_INIT_LOCAL_IN_TEMPLATE]: "Init-scope local referenced from template scope. The template lambda runs at module scope (via render() / renderChild()) and cannot reach init-body locals. Wrap the JSX expression in /* @client */, or lift the value to a prop or module-scope const.",
|
|
189854
189856
|
[ErrorCodes.STAGE_AWAIT_IN_TEMPLATE]: "AwaitExpression in template scope. The generated template and init functions are synchronous — a bare `await` produces a SyntaxError at parse time. Move the await into the component body (before the return) or into an onMount/effect callback, and pass the resolved value to JSX.",
|
|
@@ -192326,6 +192328,8 @@ function importsBrowserOnlyClientApi(ctx) {
|
|
|
192326
192328
|
if (imp.isTypeOnly)
|
|
192327
192329
|
continue;
|
|
192328
192330
|
for (const spec of imp.specifiers) {
|
|
192331
|
+
if (spec.isTypeOnly)
|
|
192332
|
+
continue;
|
|
192329
192333
|
const importedName = spec.name;
|
|
192330
192334
|
if (BROWSER_ONLY_CLIENT_APIS.has(importedName))
|
|
192331
192335
|
return true;
|
|
@@ -195484,7 +195488,8 @@ function transformConditionalBranch(node, ctx) {
|
|
|
195484
195488
|
const callsReactive = exprCallsReactiveGetters(node, ctx);
|
|
195485
195489
|
const hasCalls = exprHasFunctionCalls(node);
|
|
195486
195490
|
const reactive = isReactiveExpression(exprText, ctx, node) || isReactiveOrigin(branchOrigin);
|
|
195487
|
-
const
|
|
195491
|
+
const refsLoopParam = branchOrigin.freeRefs?.some((r) => r.kind === "render-item") ?? false;
|
|
195492
|
+
const needsSlot = reactive || callsReactive || refsLoopParam;
|
|
195488
195493
|
const slotId = needsSlot ? generateSlotId(ctx) : null;
|
|
195489
195494
|
return {
|
|
195490
195495
|
type: "expression",
|
|
@@ -197937,9 +197942,12 @@ var KEYWORDS_AND_GLOBALS = new Set([
|
|
|
197937
197942
|
// ../jsx/src/ir-to-client-js/walk-prop-accesses.ts
|
|
197938
197943
|
var import_typescript12 = __toESM(require_typescript(), 1);
|
|
197939
197944
|
|
|
197940
|
-
// ../jsx/src/
|
|
197945
|
+
// ../jsx/src/value-references.ts
|
|
197941
197946
|
var import_typescript13 = __toESM(require_typescript(), 1);
|
|
197942
197947
|
|
|
197948
|
+
// ../jsx/src/relocate.ts
|
|
197949
|
+
var import_typescript14 = __toESM(require_typescript(), 1);
|
|
197950
|
+
|
|
197943
197951
|
// ../jsx/src/lowering-registry.ts
|
|
197944
197952
|
var plugins = [];
|
|
197945
197953
|
function registerLoweringPlugin(plugin) {
|
|
@@ -198116,8 +198124,51 @@ function formatDateLocalNames(metadata) {
|
|
|
198116
198124
|
return names;
|
|
198117
198125
|
}
|
|
198118
198126
|
|
|
198127
|
+
// ../jsx/src/ir-to-client-js/control-flow/plan/lazy-row-eligibility.ts
|
|
198128
|
+
var PURE_SOURCE_GLOBALS = new Set([
|
|
198129
|
+
"Object",
|
|
198130
|
+
"Array",
|
|
198131
|
+
"JSON",
|
|
198132
|
+
"Number",
|
|
198133
|
+
"String",
|
|
198134
|
+
"Boolean"
|
|
198135
|
+
]);
|
|
198136
|
+
var INERT_BINDING_GLOBALS = new Set([
|
|
198137
|
+
"Object",
|
|
198138
|
+
"Array",
|
|
198139
|
+
"JSON",
|
|
198140
|
+
"Number",
|
|
198141
|
+
"String",
|
|
198142
|
+
"Boolean",
|
|
198143
|
+
"Math",
|
|
198144
|
+
"Date",
|
|
198145
|
+
"Intl",
|
|
198146
|
+
"Symbol",
|
|
198147
|
+
"Map",
|
|
198148
|
+
"Set",
|
|
198149
|
+
"WeakMap",
|
|
198150
|
+
"WeakSet",
|
|
198151
|
+
"Promise",
|
|
198152
|
+
"RegExp",
|
|
198153
|
+
"Error",
|
|
198154
|
+
"BigInt",
|
|
198155
|
+
"console",
|
|
198156
|
+
"undefined",
|
|
198157
|
+
"NaN",
|
|
198158
|
+
"Infinity",
|
|
198159
|
+
"globalThis",
|
|
198160
|
+
"parseInt",
|
|
198161
|
+
"parseFloat",
|
|
198162
|
+
"isNaN",
|
|
198163
|
+
"isFinite",
|
|
198164
|
+
"encodeURIComponent",
|
|
198165
|
+
"decodeURIComponent",
|
|
198166
|
+
"encodeURI",
|
|
198167
|
+
"decodeURI"
|
|
198168
|
+
]);
|
|
198169
|
+
|
|
198119
198170
|
// ../jsx/src/ir-to-client-js/emit-reactive.ts
|
|
198120
|
-
var
|
|
198171
|
+
var import_typescript15 = __toESM(require_typescript(), 1);
|
|
198121
198172
|
|
|
198122
198173
|
// ../jsx/src/ir-to-client-js/control-flow/stringify/event-delegation.ts
|
|
198123
198174
|
var NON_BUBBLING_EVENTS = new Set([
|
|
@@ -198132,7 +198183,7 @@ var NON_BUBBLING_EVENTS = new Set([
|
|
|
198132
198183
|
]);
|
|
198133
198184
|
|
|
198134
198185
|
// ../jsx/src/ir-to-client-js/rewrite-props-object.ts
|
|
198135
|
-
var
|
|
198186
|
+
var import_typescript16 = __toESM(require_typescript(), 1);
|
|
198136
198187
|
|
|
198137
198188
|
// ../jsx/src/ir-to-client-js/source-map.ts
|
|
198138
198189
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
@@ -198223,21 +198274,21 @@ class SourceMapGenerator {
|
|
|
198223
198274
|
}
|
|
198224
198275
|
|
|
198225
198276
|
// ../jsx/src/preprocess-inline-jsx-callbacks.ts
|
|
198226
|
-
var
|
|
198277
|
+
var import_typescript17 = __toESM(require_typescript(), 1);
|
|
198227
198278
|
|
|
198228
198279
|
// ../jsx/src/ssr-defaults.ts
|
|
198229
|
-
var
|
|
198280
|
+
var import_typescript18 = __toESM(require_typescript(), 1);
|
|
198230
198281
|
var UNRESOLVED = Symbol("unresolved");
|
|
198231
198282
|
var NO_RETURN = Symbol("no-return");
|
|
198232
198283
|
|
|
198233
198284
|
// ../jsx/src/augment-inherited-props.ts
|
|
198234
|
-
var
|
|
198285
|
+
var import_typescript19 = __toESM(require_typescript(), 1);
|
|
198235
198286
|
|
|
198236
198287
|
// ../jsx/src/rich-type-refusal.ts
|
|
198237
198288
|
var EMPTY_BINDINGS2 = new Map;
|
|
198238
198289
|
// ../jsx/src/shared-program.ts
|
|
198239
198290
|
init_path();
|
|
198240
|
-
var
|
|
198291
|
+
var import_typescript20 = __toESM(require_typescript(), 1);
|
|
198241
198292
|
// ../jsx/src/adapters/interface.ts
|
|
198242
198293
|
class BaseAdapter {
|
|
198243
198294
|
renderChildren(children) {
|
|
@@ -198776,9 +198827,9 @@ function registerBuiltinLoweringPlugins() {
|
|
|
198776
198827
|
registerLoweringPlugin(plugin);
|
|
198777
198828
|
}
|
|
198778
198829
|
// ../jsx/src/combine-client-js.ts
|
|
198779
|
-
var import_typescript20 = __toESM(require_typescript(), 1);
|
|
198780
|
-
// ../jsx/src/debug.ts
|
|
198781
198830
|
var import_typescript21 = __toESM(require_typescript(), 1);
|
|
198831
|
+
// ../jsx/src/debug.ts
|
|
198832
|
+
var import_typescript22 = __toESM(require_typescript(), 1);
|
|
198782
198833
|
function escapeForIdBoundary(name) {
|
|
198783
198834
|
return name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
198784
198835
|
}
|
|
@@ -198870,7 +198921,7 @@ function resolveSetters(handler, setterToSignal, fnSetters) {
|
|
|
198870
198921
|
return refs;
|
|
198871
198922
|
}
|
|
198872
198923
|
// ../jsx/src/profiler.ts
|
|
198873
|
-
var
|
|
198924
|
+
var import_typescript23 = __toESM(require_typescript(), 1);
|
|
198874
198925
|
|
|
198875
198926
|
// ../jsx/src/index.ts
|
|
198876
198927
|
registerBuiltinLoweringPlugins();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/test",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"description": "Test utilities for BarefootJS - IR-based component testing without a browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"directory": "packages/test"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@barefootjs/jsx": "0.
|
|
42
|
+
"@barefootjs/jsx": "0.28.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.0.0"
|