Compare commits

...

1 Commits

Author SHA1 Message Date
Ben Croker d220a1279a
Add user expression args 2025-03-02 09:54:37 -06:00
9 changed files with 29 additions and 30 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -351,10 +351,10 @@ function genRX(
ctx.fnContent = fnContent
try {
const fn = new Function('ctx', ...argNames, fnContent)
const fn = new Function('el', 'signals', ...argNames, fnContent)
return (...args: any[]) => {
try {
return fn(ctx, ...args)
return fn(ctx.el, ctx.signals, ...args)
} catch (error: any) {
throw runtimeErr('ExecuteExpression', ctx, {
error: error.message,

View File

@ -89,7 +89,6 @@ export type HTMLorSVGElement = Element & (HTMLElement | SVGElement)
export type Modifiers = Map<string, Set<string>> // mod name -> tags
export type RuntimeContext = InitContext & {
plugin: DatastarPlugin // The name of the plugin
el: HTMLorSVGElement // The element the attribute is on
rawKey: Readonly<string> // no parsing data-* key
key: Readonly<string> // data-* key without the prefix or tags

4
sdk/go/consts.go generated
View File

@ -7,8 +7,8 @@ import "time"
const (
DatastarKey = "datastar"
Version = "1.0.0-beta.9"
VersionClientByteSize = 39564
VersionClientByteSizeGzip = 14813
VersionClientByteSize = 39586
VersionClientByteSizeGzip = 14821
//region Default durations