@milaboratories/pl-middle-layer 1.37.99 → 1.38.0
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/block_registry/registry.d.ts.map +1 -1
- package/dist/debug/index.d.ts +1 -0
- package/dist/debug/index.d.ts.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1900 -1853
- package/dist/index.mjs.map +1 -1
- package/dist/js_render/computable_context.d.ts +3 -2
- package/dist/js_render/computable_context.d.ts.map +1 -1
- package/dist/js_render/context.d.ts +2 -1
- package/dist/js_render/context.d.ts.map +1 -1
- package/dist/js_render/index.d.ts +3 -3
- package/dist/js_render/index.d.ts.map +1 -1
- package/dist/middle_layer/active_cfg.d.ts.map +1 -1
- package/dist/middle_layer/block.d.ts.map +1 -1
- package/dist/middle_layer/middle_layer.d.ts +4 -1
- package/dist/middle_layer/middle_layer.d.ts.map +1 -1
- package/dist/middle_layer/project_overview.d.ts.map +1 -1
- package/dist/middle_layer/render.d.ts +2 -2
- package/dist/middle_layer/render.d.ts.map +1 -1
- package/dist/middle_layer/render.test.d.ts.map +1 -1
- package/dist/model/project_helper.d.ts.map +1 -1
- package/dist/pool/driver.d.ts +1 -1
- package/dist/pool/driver.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/block_registry/registry.ts +1 -0
- package/src/cfg_render/executor.test.ts +3 -3
- package/src/debug/index.ts +2 -0
- package/src/js_render/computable_context.ts +38 -16
- package/src/js_render/context.ts +4 -1
- package/src/js_render/index.ts +12 -4
- package/src/middle_layer/active_cfg.ts +2 -1
- package/src/middle_layer/block.ts +9 -2
- package/src/middle_layer/middle_layer.ts +14 -1
- package/src/middle_layer/navigation_states.ts +2 -2
- package/src/middle_layer/project_overview.ts +17 -6
- package/src/middle_layer/render.test.ts +2 -0
- package/src/middle_layer/render.ts +4 -4
- package/src/model/project_helper.ts +2 -2
- package/src/pool/driver.ts +17 -2
|
@@ -25,7 +25,7 @@ import type {
|
|
|
25
25
|
} from '@milaboratories/pl-model-middle-layer';
|
|
26
26
|
import { constructBlockContextArgsOnly } from './block_ctx';
|
|
27
27
|
import { ifNotUndef } from '../cfg_render/util';
|
|
28
|
-
import type
|
|
28
|
+
import { extractCodeWithInfo, type BlockSection } from '@platforma-sdk/model';
|
|
29
29
|
import { computableFromCfgOrRF } from './render';
|
|
30
30
|
import type { NavigationStates } from './navigation_states';
|
|
31
31
|
import { getBlockPackInfo } from './util';
|
|
@@ -154,15 +154,22 @@ export function projectOverview(
|
|
|
154
154
|
|
|
155
155
|
const bp = getBlockPackInfo(prj, id);
|
|
156
156
|
|
|
157
|
-
const { sections, title, inputsValid, sdkVersion }
|
|
157
|
+
const { sections, title, inputsValid, sdkVersion, featureFlags, isIncompatibleWithRuntime }
|
|
158
158
|
= ifNotUndef(bp, ({ bpId, cfg }) => {
|
|
159
|
+
if (!env.runtimeCapabilities.checkCompatibility(cfg.featureFlags)) {
|
|
160
|
+
return {
|
|
161
|
+
isIncompatibleWithRuntime: true,
|
|
162
|
+
featureFlags: cfg.featureFlags,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
159
165
|
const blockCtxArgsOnly = constructBlockContextArgsOnly(prjEntry, id);
|
|
166
|
+
const codeWithInfo = extractCodeWithInfo(cfg);
|
|
160
167
|
return {
|
|
161
168
|
sections: computableFromCfgOrRF(
|
|
162
169
|
env,
|
|
163
170
|
blockCtxArgsOnly,
|
|
164
171
|
cfg.sections,
|
|
165
|
-
|
|
172
|
+
codeWithInfo,
|
|
166
173
|
bpId,
|
|
167
174
|
).wrap({
|
|
168
175
|
recover: (e) => {
|
|
@@ -178,7 +185,7 @@ export function projectOverview(
|
|
|
178
185
|
env,
|
|
179
186
|
blockCtxArgsOnly,
|
|
180
187
|
title,
|
|
181
|
-
|
|
188
|
+
codeWithInfo,
|
|
182
189
|
bpId,
|
|
183
190
|
).wrap({
|
|
184
191
|
recover: (e) => {
|
|
@@ -192,7 +199,7 @@ export function projectOverview(
|
|
|
192
199
|
env,
|
|
193
200
|
blockCtxArgsOnly,
|
|
194
201
|
cfg.inputsValid,
|
|
195
|
-
|
|
202
|
+
codeWithInfo,
|
|
196
203
|
bpId,
|
|
197
204
|
).wrap({
|
|
198
205
|
recover: (e) => {
|
|
@@ -202,7 +209,9 @@ export function projectOverview(
|
|
|
202
209
|
return false;
|
|
203
210
|
},
|
|
204
211
|
}) as ComputableStableDefined<boolean>,
|
|
205
|
-
sdkVersion:
|
|
212
|
+
sdkVersion: codeWithInfo?.sdkVersion,
|
|
213
|
+
featureFlags: codeWithInfo?.featureFlags ?? {},
|
|
214
|
+
isIncompatibleWithRuntime: false,
|
|
206
215
|
};
|
|
207
216
|
}) || {};
|
|
208
217
|
|
|
@@ -239,6 +248,8 @@ export function projectOverview(
|
|
|
239
248
|
currentBlockPack: bp?.info?.source,
|
|
240
249
|
updates,
|
|
241
250
|
sdkVersion,
|
|
251
|
+
featureFlags,
|
|
252
|
+
isIncompatibleWithRuntime,
|
|
242
253
|
navigationState: navigationStates.getState(id),
|
|
243
254
|
};
|
|
244
255
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockCodeWithInfo, TypedConfigOrConfigLambda } from '@platforma-sdk/model';
|
|
2
2
|
import { isConfigLambda } from '@platforma-sdk/model';
|
|
3
3
|
import type { Computable, ComputableRenderingOps } from '@milaboratories/computable';
|
|
4
4
|
import { computableFromCfg } from '../cfg_render/executor';
|
|
@@ -16,12 +16,12 @@ export function computableFromCfgOrRF(
|
|
|
16
16
|
env: MiddleLayerEnvironment,
|
|
17
17
|
ctx: BlockContextAny,
|
|
18
18
|
cfgOrFh: TypedConfigOrConfigLambda,
|
|
19
|
-
|
|
19
|
+
codeWithInfo: BlockCodeWithInfo | undefined,
|
|
20
20
|
configKey: string,
|
|
21
21
|
ops: Partial<ComputableRenderingOps> = {},
|
|
22
22
|
): Computable<unknown> {
|
|
23
23
|
if (isConfigLambda(cfgOrFh)) {
|
|
24
|
-
if (
|
|
25
|
-
return computableFromRF(env, ctx, cfgOrFh,
|
|
24
|
+
if (codeWithInfo === undefined) throw new Error('No code bundle.');
|
|
25
|
+
return computableFromRF(env, ctx, cfgOrFh, codeWithInfo, configKey, ops);
|
|
26
26
|
} else return computableFromCfg(env.driverKit, ctx, cfgOrFh, ops);
|
|
27
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { extractCodeWithInfo, type BlockConfig, type PlRef } from '@platforma-sdk/model';
|
|
2
2
|
import { LRUCache } from 'lru-cache';
|
|
3
3
|
import type { QuickJSWASMModule } from 'quickjs-emscripten';
|
|
4
4
|
import { executeSingleLambda } from '../js_render';
|
|
@@ -27,7 +27,7 @@ export class ProjectHelper {
|
|
|
27
27
|
const blockConfig = req.blockConfig();
|
|
28
28
|
if (blockConfig.enrichmentTargets === undefined) return undefined;
|
|
29
29
|
const args = req.args();
|
|
30
|
-
const result = executeSingleLambda(this.quickJs, blockConfig.enrichmentTargets, blockConfig
|
|
30
|
+
const result = executeSingleLambda(this.quickJs, blockConfig.enrichmentTargets, extractCodeWithInfo(blockConfig)!, args) as PlRef[];
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
33
|
|
package/src/pool/driver.ts
CHANGED
|
@@ -81,6 +81,20 @@ function migrateFilters(filters: PTableRecordFilter[]): PTableRecordFilter[] {
|
|
|
81
81
|
return filtersV2;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
function migratePTableDef(
|
|
85
|
+
def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>>,
|
|
86
|
+
): PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>> {
|
|
87
|
+
if (!('partitionFilters' in (def as Omit<typeof def, 'partitionFilters'>))) {
|
|
88
|
+
// For old blocks make all filters partition filters
|
|
89
|
+
return {
|
|
90
|
+
...def,
|
|
91
|
+
partitionFilters: def.filters,
|
|
92
|
+
filters: [],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return def;
|
|
96
|
+
}
|
|
97
|
+
|
|
84
98
|
const bigintReplacer = (_: string, v: unknown) => (typeof v === 'bigint' ? v.toString() : v);
|
|
85
99
|
|
|
86
100
|
class PFrameHolder implements PFrameInternal.PFrameDataSource, Disposable {
|
|
@@ -324,7 +338,7 @@ export class PFrameDriver implements InternalPFrameDriver {
|
|
|
324
338
|
|
|
325
339
|
const table = pFrameHolder.pFrame.createTable({
|
|
326
340
|
src: joinEntryToInternal(params.def.src),
|
|
327
|
-
filters: migrateFilters(params.def.filters),
|
|
341
|
+
filters: migrateFilters([...params.def.partitionFilters, ...params.def.filters]),
|
|
328
342
|
});
|
|
329
343
|
|
|
330
344
|
let sortedTable = table;
|
|
@@ -370,9 +384,10 @@ export class PFrameDriver implements InternalPFrameDriver {
|
|
|
370
384
|
}
|
|
371
385
|
|
|
372
386
|
public createPTable(
|
|
373
|
-
|
|
387
|
+
rawDef: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>>,
|
|
374
388
|
ctx: ComputableCtx,
|
|
375
389
|
): PTableHandle {
|
|
390
|
+
const def = migratePTableDef(rawDef);
|
|
376
391
|
const pFrameHandle = this.createPFrame(extractAllColumns(def.src), ctx);
|
|
377
392
|
const defIds = mapPTableDef(def, (c) => c.id);
|
|
378
393
|
const res = this.pTables.acquire({ def: defIds, pFrameHandle });
|