Jess
Jess
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
Well, thank you for all your help xd
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
Why did we have to make the funny double n letter
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
I had a typo in the WASM module that named the field awaiting_comfirm instead of awaiting_confirm
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
Well, I found the issue
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
All keys are guaranteed to exist, only image and timers may be null
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
The engine will return a different JSON string depending on what runs (backgrounds, prompts/choices, etc.)
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
Yes
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
It shows the same JSON as the input to JSON.parse, {"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
No description
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
Also, the page store is only modified in the setInterval
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
It's more of a really poorly made interpreter
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
Thank you for being patient, by the way. I always end up invoking demons in the strangest ways
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
It now properly updates the page, but it's saying awaiting_confirm is undefined when I try to access it?
Page JSON {"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
Parsed page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: [], notifications: [], prompting: false, awaiting_comfirm: true }
Stored page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: Proxy, notifications: Proxy, prompting: false, awaiting_comfirm: true }
Prompting false, Awaiting confirm: undefined
Page JSON {"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
Parsed page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: [], notifications: [], prompting: false, awaiting_comfirm: true }
Stored page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: Proxy, notifications: Proxy, prompting: false, awaiting_comfirm: true }
Prompting false, Awaiting confirm: undefined
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
I've come to the conclusion I'm cursed
engine.tick(BigInt(250));
const pageJson = engine.renderPage();
console.log(`Page JSON ${pageJson}`);
const pageParsed = JSON.parse(pageJson) as Page;
console.log("Parsed page", pageParsed);
setPage(pageParsed);
console.log("Stored page", {...page});
console.log(`Prompting ${page.prompting}, Awaiting confirm: ${page.awaiting_confirm}`);
engine.tick(BigInt(250));
const pageJson = engine.renderPage();
console.log(`Page JSON ${pageJson}`);
const pageParsed = JSON.parse(pageJson) as Page;
console.log("Parsed page", pageParsed);
setPage(pageParsed);
console.log("Stored page", {...page});
console.log(`Prompting ${page.prompting}, Awaiting confirm: ${page.awaiting_confirm}`);
Page JSON {"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
Parsed page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: [], notifications: [], prompting: false, awaiting_comfirm: true }
Stored page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: Proxy, notifications: Proxy, prompting: false, awaiting_confirm: false, awaiting_comfirm: true }
Prompting false, Awaiting confirm: false App.tsx:60:14
Page JSON {"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
Parsed page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: [], notifications: [], prompting: false, awaiting_comfirm: true }
Stored page
Object { image: "daf01c05298d2520430802e452378e8733dfaadc", timer: null, choices: Proxy, notifications: Proxy, prompting: false, awaiting_confirm: false, awaiting_comfirm: true }
Prompting false, Awaiting confirm: false App.tsx:60:14
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
A really basic repro works fine
import { createStore } from "solid-js/store";
import { render } from "solid-js/web";
import { Show, onMount, onCleanup } from "solid-js";

function Counter() {
const [meta, setMeta] = createStore({ nested: false });

let interval: number;
onMount(() => {
interval = setInterval(() => {
if (meta.nested) {
setMeta(JSON.parse('{"nested": false}'));
} else {
setMeta(JSON.parse('{"nested": true}'));
}
}, 2500);
});

onCleanup(() => clearInterval(interval));

return (
<Show when={meta.nested}>
<p>Some text</p>
</Show>
);
}

render(() => <Counter />, document.getElementById("app")!);
import { createStore } from "solid-js/store";
import { render } from "solid-js/web";
import { Show, onMount, onCleanup } from "solid-js";

function Counter() {
const [meta, setMeta] = createStore({ nested: false });

let interval: number;
onMount(() => {
interval = setInterval(() => {
if (meta.nested) {
setMeta(JSON.parse('{"nested": false}'));
} else {
setMeta(JSON.parse('{"nested": true}'));
}
}, 2500);
});

onCleanup(() => clearInterval(interval));

return (
<Show when={meta.nested}>
<p>Some text</p>
</Show>
);
}

render(() => <Counter />, document.getElementById("app")!);
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
After some more fiddling I've got
Page JSON {"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
Awaiting confirm false, prompting false
Page JSON {"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
Awaiting confirm false, prompting false
from
setInterval(() => {
engine.tick(BigInt(250));
const pageJson = engine.renderPage();
console.log(`Page JSON ${pageJson}`);
setPage(JSON.parse(pageJson));
console.log(`Awaiting confirm ${page.awaiting_confirm}, prompting ${page.prompting}`);
}, 250);
setInterval(() => {
engine.tick(BigInt(250));
const pageJson = engine.renderPage();
console.log(`Page JSON ${pageJson}`);
setPage(JSON.parse(pageJson));
console.log(`Awaiting confirm ${page.awaiting_confirm}, prompting ${page.prompting}`);
}, 250);
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
It seems it isn't solid
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
I'll check
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
const [page, setPage] = createStore({
image: null,
timer: null,
choices: [],
notifications: [],
prompting: false,
awaiting_confirm: false,
} as Page)
// snip

{page.awaiting_confirm ? <p>I'm awaiting confirm</p> : <p>I'm not awaiting confirm</p>}
<br />
<Show when={page.awaiting_confirm}>
<button onClick={() => engine.clearAwaitingConfirm()}>Continue</button>
</Show>
const [page, setPage] = createStore({
image: null,
timer: null,
choices: [],
notifications: [],
prompting: false,
awaiting_confirm: false,
} as Page)
// snip

{page.awaiting_confirm ? <p>I'm awaiting confirm</p> : <p>I'm not awaiting confirm</p>}
<br />
<Show when={page.awaiting_confirm}>
<button onClick={() => engine.clearAwaitingConfirm()}>Continue</button>
</Show>
Shows no "Continue" and shows "I'm not awaiting confirm"
52 replies
SSolidJS
Created by Jess on 4/2/2024 in #support
Ternary and Show have unequal output
That didn't change anything
52 replies