Skip to content

JiT compilation support in JS API#2086

Merged
ikholopov-omni merged 1 commit intodataform-co:mainfrom
ikholopov-omni:jit-js-compile
Feb 11, 2026
Merged

JiT compilation support in JS API#2086
ikholopov-omni merged 1 commit intodataform-co:mainfrom
ikholopov-omni:jit-js-compile

Conversation

@ikholopov-omni
Copy link
Collaborator

JS API for JiT compilation actions definition (mutually exclusive with AoT properties) and JiT context/result typings.

@ikholopov-omni ikholopov-omni marked this pull request as ready for review February 10, 2026 01:28
@ikholopov-omni ikholopov-omni requested a review from a team as a code owner February 10, 2026 01:28
@ikholopov-omni ikholopov-omni requested review from Tuseeq1 and kolina and removed request for a team February 10, 2026 01:28
This was referenced Feb 10, 2026
flattenPreOps = flattenPreOps.concat(typeof op === "object" ? op : [op]);
})
if (!!this.contextableQuery || !!this.contextableWhere || !!flattenPostOps.length || !!flattenPreOps.length) {
const err = new Error(`Cannot mix AoT and JiT compilation in action: ${this.contextableQuery}, ${this.contextableWhere}, ${this.contextablePostOps}, ${this.contextablePreOps}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd report specific violation reason here (i.e. what specific config field triggered it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

*/
export class TableContext implements ITableContext {
constructor(private table: Table, private isIncremental = false) {}
constructor(private table: Table, private isIncremental = false) { }
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the cause of these diffs?

Copy link
Collaborator Author

@ikholopov-omni ikholopov-omni Feb 11, 2026

Choose a reason for hiding this comment

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

My IDE (vscode) is extremely opinionated about TS formatiing, apparently (like golang-level of opinionation).

I could clean those up by splitting it out of the commit, but this will continue being an overhead long-term :/

Probably worth setting up formatter next to the linter check.

Comment on lines 524 to 536
let flattenPostOps: unknown[] = [];
this.contextablePostOps.forEach(op => {
flattenPostOps = flattenPostOps.concat(typeof op === "object" ? op : [op]);
})
let flattenPreOps: unknown[] = [];
this.contextablePreOps.forEach(op => {
flattenPreOps = flattenPreOps.concat(typeof op === "object" ? op : [op]);
})
if (!!this.contextableQuery || !!this.contextableWhere || !!flattenPostOps.length || !!flattenPreOps.length) {
const err = new Error(`Cannot mix AoT and JiT compilation in action: ${this.contextableQuery}, ${this.contextableWhere}, ${this.contextablePostOps}, ${this.contextablePreOps}`);
this.session.compileError(err, this.getFileName());
throw err;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This validation can be reused for different action types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved to util

@ikholopov-omni ikholopov-omni merged commit 4246ebb into dataform-co:main Feb 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants