geoidesic
TTyphonJS
•Created by geoidesic on 10/15/2024 in #typhonjs-runtime
Is there any way to avoid 'game' is not defined lint error for vite build?
8 replies
TTyphonJS
•Created by geoidesic on 9/26/2024 in #typhonjs-runtime
TJSGameSettings doesn't respect `onChange` option?
So if I have a standard settings registration:
The alert will trigger.
However, if I wrap a setting via
TJSGameSettings
it won't trigger the onChange
hook. E.g.
Am I doing it wrong?3 replies
TTyphonJS
•Created by geoidesic on 8/10/2024 in #typhonjs-runtime
How can I respond to the _onDrop event in the shell?
I'm working with a SvelteApplication. I can edit the _onDrop method on the sheet but how do I react to it in the svelte shell?
30 replies
TTyphonJS
•Created by geoidesic on 8/1/2024 in #typhonjs-runtime
What's the best way to control default header items in a TJS application window?
27 replies
TTyphonJS
•Created by geoidesic on 7/24/2024 in #typhonjs-runtime
[vite] warning: Could not resolve import "#runtime/svelte/component/core"
I haven't seen this error before.
WelcomeAppShell.svelte
Foundry v12, developing a new system.
Any clues?18 replies
TTyphonJS
•Created by geoidesic on 6/28/2024 in #typhonjs-runtime
$actor.toObject() for a TJSDocument isn't reactive
I'm creating an actor in memory and assigning that to the TJSDocument on my application
Then to open the application:
PCAppShell does:
Then later in another componentI do this:
4 replies
TTyphonJS
•Created by geoidesic on 6/21/2024 in #typhonjs-runtime
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.
My svelte component looks something like this:
It might not precisely be to do with createFilterQuery
. I'm not sure yet why it's happening, but certainly, what was working in v11 is not working in v12.4 replies
TTyphonJS
•Created by geoidesic on 6/19/2024 in #typhonjs-runtime
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.:
26 replies
TTyphonJS
•Created by geoidesic on 6/15/2024 in #typhonjs-runtime
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?
E.g.
So this works if I run the dev server. It seems to find it via URL:
However, once built, the path it looks for changes, leaving out the module id and reporting a 404:
Even if I correct the ommssion in the URL manually I still see a 404
Any ideas?
22 replies
TTyphonJS
•Created by geoidesic on 6/10/2024 in #typhonjs-runtime
Can I use markdown with TJSProseMirror?
2 replies
TTyphonJS
•Created by geoidesic on 5/31/2024 in #typhonjs-runtime
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:
But I would like that CompendiumSourcesSubmenu
to be a svelte component, rather than the TypeScript / Handlebars extension to FormApplication
that it currently is (as it has been ported from an existing module)9 replies
TTyphonJS
•Created by geoidesic on 5/23/2024 in #typhonjs-runtime
dnd5e reactivity with race.advancement.byID
I'm having trouble when fetching a race
byUuid
with one particular reactive var:
Any ideas? Why adv
is undefined?
(The only special thing about byId
is that it's a getter)7 replies
TTyphonJS
•Created by geoidesic on 5/21/2024 in #typhonjs-runtime
Error in $doc.update()?
I'm not quite sure if I'm doing it wrong. The error I'm getting is:
Here's the component
Normally (e.g. in my system, as opposed to this module)
$doc.update()
just works for me. I haven't seen this _id
error before. It seems weird because update
is being called on $doc
, which is a TJSDocument
instance of the actor
, so it has the _id
already I would expect.5 replies
TTyphonJS
•Created by geoidesic on 5/11/2024 in #typhonjs-runtime
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 [email protected]: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?
Specifically I want to edit and debug in @typhonjs-fvtt/runtime/_dist/svelte/component/core/application/ApplicationShell
7 replies
TTyphonJS
•Created by geoidesic on 5/10/2024 in #typhonjs-runtime
importing from the runtime
I see this in the
template-svelte-esm
example:
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.5 replies
TTyphonJS
•Created by geoidesic on 5/10/2024 in #typhonjs-runtime
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:
... but no go33 replies
TTyphonJS
•Created by geoidesic on 5/7/2024 in #typhonjs-runtime
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?
2 replies
TTyphonJS
•Created by geoidesic on 9/19/2023 in #typhonjs-runtime
How to get rid of funky Prosemirror overlap
14 replies
TTyphonJS
•Created by geoidesic on 7/10/2023 in #typhonjs-runtime
Update to ChatMessage outside of Svelte doesn't trigger reactivity on linked TJSDocument
I'm a bit confused about this...
1. When I render a ChatMessage via svelte, in the chat message svelte component I do:
2. At various points in the workflow I save updates to the chat message using:
Which works reactivly.
3. However, I then have a class, which is not a svelte component because it represents shared logic. In that class I also update the chat message like so:
These changes are not however picked up within
foundryChatMessageDocument
reactively.
I assume that is expected. However, is there a way I can make the update to the chat message in point 3 be reactively picked up by the TJSDocument?9 replies
TTyphonJS
•Created by geoidesic on 7/6/2023 in #typhonjs-runtime
How do I get the elementRoot of a ChatMessage?
SvelteApplication provides
elementRoot
prop to components that implement it, which is very useful. I'm looking to get something similar for my Svelte chat message templates.
I'm using this in index.js
SurgeRoll.svelte does this:
The svelte:component is the component in which I want to get hold of that root element. Specifically I want to be able to do something like:
... which I'm currently using successfully in my SvelteApplication ActorSheet component.7 replies