Solidor
Solidor
TTyphonJS
Created by Solidor on 3/15/2024 in #typhonjs-runtime
Dynamic Reducers use cases
I am currently in the process of rewriting how the Titan system handles some things, and I was wondering about whether I should start using the dynamic reducers. Way back when I first made the system, the TJS dynamic reducers didn't exist yet, so went through the process of setting up my own item list component for character sheets. Essentially, the component is a reactive list that looks through an actor's item using a filter function (such as type === 'spell', etc). Then it creates a svelte component for each item that matches the filter (such as a Character Sheet Spell Component) and inputs the item's ID. The filter can be changed at runtime in response to user input. The item component then looks up its item like so: $: item = $document.items.get(id); This way, whenever the item gets updated, the actor sheet of the owning actor also gets updated. Similarly, I am able to modify the item with controls from the actor sheet like so:

<IntegerIncrementInput
bind:value={item.system.quantity}
on:change={() => {
item.update({
system: {
quantity: item.system.quantity,
},
});
}}
/>

<IntegerIncrementInput
bind:value={item.system.quantity}
on:change={() => {
item.update({
system: {
quantity: item.system.quantity,
},
});
}}
/>
So what I am wondering is, is it worth it to convert to using the dynamic reducers when I already have components that do the heavy lifting of sorting / filtering items, as well as updating the actor sheet in response to item changes? Are there any additional benefits I would gain from doing so?
5 replies
TTyphonJS
Created by Solidor on 8/14/2023 in #typhonjs-runtime
System Works in Dev Mode but not after build
After updating to 0.1.1, I noticed something odd happening. The TITAN system now seems to work when I run in dev mode. But when I run a built version, there is nothing. It's just the base foundry system. Some debugging shows me that the init hook is not getting called, and I have no idea why. Any idea what could cause this?
14 replies
TTyphonJS
Created by Solidor on 8/6/2023 in #typhonjs-runtime
Error building after updating to TRL 0.1.1
Recently updated the TITAN system to TRL 0.1.1, but when I npm run build it errors out. Not sure why.
[commonjs--resolver] Missing "./svelte/store" specifier in "@typhonjs-fvtt/runtime" package
error during build:
Error: Missing "./svelte/store" specifier in "@typhonjs-fvtt/runtime" package
at e (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:21416:25)
at n (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:21416:627)
at o (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:21416:1297)
at resolveExportsOrImports (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28708:20)
at resolveDeepImport (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28727:31)
at tryNodeResolve (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28415:20)
at Object.resolveId (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28176:28)
at file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/rollup/dist/es/shared/node-entry.js:25356:40
at async PluginDriver.hookFirstAndGetPlugin (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/rollup/dist/es/shared/node-entry.js:25256:28)
at async resolveId (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/rollup/dist/es/shared/node-entry.js:23931:26)
[commonjs--resolver] Missing "./svelte/store" specifier in "@typhonjs-fvtt/runtime" package
error during build:
Error: Missing "./svelte/store" specifier in "@typhonjs-fvtt/runtime" package
at e (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:21416:25)
at n (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:21416:627)
at o (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:21416:1297)
at resolveExportsOrImports (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28708:20)
at resolveDeepImport (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28727:31)
at tryNodeResolve (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28415:20)
at Object.resolveId (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/vite/dist/node/chunks/dep-75f53616.js:28176:28)
at file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/rollup/dist/es/shared/node-entry.js:25356:40
at async PluginDriver.hookFirstAndGetPlugin (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/rollup/dist/es/shared/node-entry.js:25256:28)
at async resolveId (file:///C:/FoundryVTT/Dev/foundryuserdata/Data/systems/titan/node_modules/rollup/dist/es/shared/node-entry.js:23931:26)
6 replies
TTyphonJS
Created by Solidor on 4/11/2023 in #typhonjs-runtime
Blur on moving elements
No description
14 replies
TTyphonJS
Created by Solidor on 2/26/2023 in #typhonjs-runtime
Backspace doesn't work on TJSProseMirror components if content is blank when edit button is clicked
No description
8 replies
TTyphonJS
Created by Solidor on 2/25/2023 in #typhonjs-runtime
TJSProseMirror for arrays?
Question about the TJSProseMirror component. I am trying to pass a fieldname belonging to an object in an array like so: fieldName={system.rulesElement[${idx}].message} However, what this ends up doing is creating a new key in my document "rulesElement[0]": How would I pass it a fieldname with an array index?
3 replies