TyphonJS

T

TyphonJS

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

Join

typhonjs-runtime

packages

TRL `0.2.0-next.X` Update Marathon

Greets @FVTT ▹ Developer, I am starting a new post to discuss / troubleshoot any problems or concerns you might have in regard to updating to the beta build of TRL 0.2.0-next.2 and beyond. The 0.2.x release series of TRL is all about hardening & streamlining the API taking a solid 2nd+ pass over everything. It represents "peak TRL" for Svelte 4. My goal is to ship 0.2.0 on Wednesday. It's API / feature complete, but receiving any early feedback and learning about any problems you have in updating will help me create a better official release video where I can mention aspects that will help others update. If you have time before Wednesday to start your effort now is appreciated. If you are having problems let me know here or get in contact directly. I can help out with a PR if necessary....

Is there any way to avoid 'game' is not defined lint error for vite build?

7:09:30 PM [vite-plugin-svelte] /Users/noeldacosta/code/foundryvtt-final-fantasy/src/components/organisms/item/shared/EffectsTab.svelte:172:768 'game' is not defined
170:
7:09:30 PM [vite-plugin-svelte] /Users/noeldacosta/code/foundryvtt-final-fantasy/src/components/organisms/item/shared/EffectsTab.svelte:172:768 'game' is not defined
170:
...

Injecting .svelte code into existing Foundry Document

okay, now that I've got my project set up with Svelte, how would I go about injecting the html from my .svelte file into existing html? In my existing code, I was able to use html.find('.sub-nav:not(.sub-sub-nav)').append('<a data-tab="subsystems" class="">Subsystems</a>') to add the subsystems tab in that top block, and I have an append statement prepped to get the rest of my html in the appropriate place as shown below: html.find('.container').append('<div class="tab" data-tab="subsystems" data-region="subsystems"> CODE HERE </div>')...
No description

Failed to resolve module specifier "#runtime/svelte/application"

Trying to set up a new module from the following repository. https://github.com/typhonjs-fvtt-demo/template-svelte-esm I followed all the instructions listed in the readme (though I did have to install Node.js separately, which wasn't specified) and everything seems fine except when I launch the world, I get this error. Any advice on how to resolve this? Did I not install something or install the wrong version? I downloaded Node.js 20.18.0...
No description

Discussion: TRL 0.2.0-next.1 Pre-release

Greets @FVTT ▹ Developer, I'd like to open a discussion prior to the initial 0.2.0-next.1 release to set expectations and address concerns. When released I recommend as many folks to upgrade as soon as possible to get a better testing pool. Like all of the TRL releases even the first "beta" release will be rock solid and production ready. The further next.X series of releases will mostly be refining types particularly new Foundry core types and other odds and ends. All of the major refactoring of sub-path exports will be present from the initial release as well as various fixes reported since v12 dropped and many other useful enhancements to TRL. The discussion below relates to 0.2.0 update concerns and not TRL 0.1.x. ...

TJSGameSettings doesn't respect `onChange` option?

So if I have a standard settings registration: ```javascript function dontShowWelcome() { game.settings.register(MODULE_ID, 'dontShowWelcome', { name: game.i18n.localize('GAS.Setting.DontShowWelcome.Name'),...

Derived Store - To use or not to use

From #dev-lounge - I'm thinking of rewriting my monolithic class-based stores in Item Piles to something more maintainable - when I create a derived store based on a value in another large store, is that faster/better than just creating multiple stores for the properties of the large store?

Separate components unintentionally updating one another

I don't know how I ended up here, but I have a bizarre bug where I have two windows open and one of them sends data to another. There is no code that shares state between the two.

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?

TJSGameSettings getStore not saving properly?

I have a bizzare interaction right now with TJSGameSettings.getStore / getWritableStore. It gets updated, I even see in the console through game.settings.get that the setting has been "updated" Then I refresh and the changes made disappear. What gives?...

ProseMirror UUID discussion

Hi @Jons. I'd be glad to continue the discussion here. I don't see anything immediately that is related to the TJSProseMirror component. The actual editor and such is the Foundry implementation underneath. There are additional plugins and such added, but it's not clear yet if what you are doing in regard to interaction would hit any of the aspects added by TJSProseMirror Can you more specifically outline the problem that you are seeing and perhaps put some console.log statements in foundry-esm.js to verify the UUID being parsed. The drag and drop of documents into the editor when active should be something completely controlled by the underlying Foundry implementation....

TJSDocumentProperty Prototype

So I implemented a prototype of a custom store implementation that wraps a TJSDocument instance that allows dynamic store access to property accessors. TJSDocumentProperty is a complete Writable instance allowing update to be used when more complex modification is required for the underlying property; IE pushing to an array or modifying a nested object. I included TJSDocumentProperty as an attachment to this post. Also is a demo Svelte component that can be copied to BasicDocAppShell in essential-svelte-esm. This demo is what is shown in the video preview. Note: That I'm using the internal 0.2.0 pre-release code and likely there are modifications necessary to get this to work with 0.1.3 which likely has slightly different context callback data. Also note that the core v12 changes for renderContext are not normalized yet. TJSDocument will receive a facelift for the 0.2.0 release and quite likely a solution related to TJSDocumentProperty will be available built-in to TJSDocument...

TinyTJS Enriched options

So for the tinymce editor https://github.com/typhonjs-fvtt-lib/svelte-standard/blob/main/src/component/standard/editor/tinymce/TJSTinyMCE.svelte the repo shows that you can pass in options.enrichOptions. But in the browser enrichOptions doesn't exist that file.
No description

What's the best way to control default header items in a TJS application window?

I tried the ESM example: ```javascript <svelte:options accessors={true} /> <script>javascript...
No description

[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?...
Next