TyphonJS

T

TyphonJS

Join the community to ask questions about TyphonJS and get answers from other members.

Join

typhonjs-runtime

packages

[vite] warning: Could not resolve import "#runtime/svelte/component/core"

I haven't seen this error before. WelcomeAppShell.svelte ```javascript import { ApplicationShell } from '#runtime/svelte/component/core';...

Correct way to have inputs show other data?

```js {#if updates.data.measureTemplate.color} <label for="colorOverride">{localizeFull("PF1.CustomColor")}</label> <div class="form-fields"> <input...

$actor.toObject() for a TJSDocument isn't reactive

I'm creating an actor in memory and assigning that to the TJSDocument on my application ```javascript export default class PCApplication extends SvelteApplication { /**...

v12 seems to break item reactivity for createFilterQuery

I've been trying out my system on v12. Something I notice is that some of my reactive components are no longer reactive. Specifically where I've used createFilterQuery. I don't get any errors but when the items in the wildcard list are changed, the view doesn't update. I mean the filter select still works reactively but if any of the values of the items in the list are altered, or if the core list changes (e.g. item is added or deleted from the original unfiltered list) those changes aren't reactively rendered. I don't understand why that might be but I've tested the same code in both v11 and v12 and it's working in v11....

How to avoid Foundry Globals from causing vite build warnings?

I'm getting a lot of warnings from vite-plugin-svelte for foundry globals like TextEditor.enrichHTML(item.system.description.value || '') . Any idea how I can make it ignore those or register them? E.g.: ``` 1:00:29 PM [vite-plugin-svelte] /Users/me/path/ItemGrant.svelte:35:153 'TextEditor' is not defined ...

Dynamic Imports work on dev server but not in build?

I'm having something weird. I'm doing dynamic async imports for certain dynamic components. It's working just find when run via a dev server (e.g. npm run dev) but once I build it, then the imports break. From the error message it seems that the import is done via URL, rather than via code. The URL exists and is browsable in the dev server, but not once built. Am I doing it wrong? Or are dynamic imports not available to the build?...

Can I use markdown with TJSProseMirror?

I.e. https://github.com/prosemirror/prosemirror-markdown and https://prosemirror.net/examples/markdown/ I notice that the text node in my journal's pages collection documents has a markdown key which is undefined. This suggests to me that it's supported – although I don't know how to enable it?...
No description

What's the TJS way to extend FormApplication?

Specifically I want a custom type to register a component via game.settings.register e.g. a multi-select or checkbox list. E.g. I currently have this: ```javascript game.settings.registerMenu(MODULE_ID, SettingKeys.SOURCES, {...

Global Arrays & Writable Stores

I currently have this set to use a settings array to use to pass data to the SanityApp and also check to see if the Application is live because the application is to close if the array is empty. It's "populating the app" part and checking if the array is empty part is working as intended, but the interval I have set up in the script of the SanityApp appears to not be working as it's not updating automatically. SanityApp and SanityApplication.js ```js import { SvelteApplication } from '#runtime/svelte/application'; import SanityApp from './templates/SanityApp.svelte'; import { FatesDescentRoll } from './FatesDescentRoll.js'; import { MODULE_ID } from './settings.js';...

dnd5e reactivity with race.advancement.byID

I'm having trouble when fetching a race byUuid with one particular reactive var: ```javascript const selectHandler = async (option) => { race = await fromUuid(option); console.log(source); //<-- works...

Application !Closing

Good day folk, first time Svelte app tinkerer here. I am having a little bit of an issue getting this app to close after either button is pressed. Any ideas where I am failing? ```html <script> import { createEventDispatcher } from 'svelte'; import { ApplicationShell } from '#runtime/svelte/component/core'; import { FatesDescentRoll } from '../FatesDescentRoll.js';...
No description

TRL `0.1.3` - v12 Hot Patch

Greets @FVTT ▹ Developer! I have just released a hot patch release that addresses the v12 Foundry update and fixes a few odds and ends. - Reactive embedded collections of TJSDocument continue to work on v12. - HMR for language files works again. - Default app position tweening reduced to 60ms....

Error in $doc.update()?

I'm not quite sure if I'm doing it wrong. The error I'm getting is: ``` foundry.js:13637 Uncaught (in promise) Error: You must provide an _id for every object in the update data Array. at #preUpdateDocumentArray (foundry.js:13637:32) at ClientDatabaseBackend._updateDocuments (foundry.js:13449:73)...

Rest & Recovery 5e

Just creating a forum post to chat about upgrading the Rest & Recovery 5e module to the latest TRL and future integration aspects w/ Tidy Sheets 5e. @Michael

local link of the runtime

Because the current runtime has some build issues and also because I am trying to debug something (i.e. application css overflow), I would like to be able to edit the runtime. I tried editing the runtime in node_modules but changes weren't seen (even after clearing vite-cache. Yarn offers yarn patch and yarn link which are potential solutions. However, when I tried to git clone git@github.com:typhonjs-fvtt-lib/typhonjs.git I got confused because it does not contain the same folders / files as in node_modules @typhonjs-fvtt/runtime. So the question is how do I get a local, editable copy of the runtime linked to my local module for debugging? ...

importing from the runtime

I see this in the template-svelte-esm example:
import { ApplicationShell } from '#runtime/svelte/component/core';
import { ApplicationShell } from '#runtime/svelte/component/core';
I'm not familiar with this syntax – i.e. the # here in the path. What does it mean and what enables it? I looked in vite.config.js and the # symbol doesn't appear in that file. I also couldn't find anything about that being standard sugar for ESM6 syntax....

lang localization in svelte template?

So far I've only managed to do this via data-tooltip, which picks up the localization string magically (presumably a FoundryVTT feature). What's the best way to use localization strings in a TJS-inspired svelte template directly? I tried this: ```javascript export const lang = game.i18n.localize;...

How can I use typescript with `template-svelte-esm`?

Is there a way to get the template-svelte-esm HMR working with typescript? I had a go but wasn't able. Like it builds but the URL doesn't work, can't serve the built index.js file for some reason. I'm guessing that HMR is not possible if I'm using typescript? So I'd have to build each time?...

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)....
Next