TyphonJS (Michael)
TyphonJS (Michael)
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
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. As mentioned it's important to get on 0.2.0 as 0.3.0 will be out ASAP addressing Foundry v13 as early in the core dev release cycle as possible. There are many refinements / sub-path export changes to account for in the 0.2.0 release. I was able to update Automatic Animations (AA) from an really old alpha build of TRL (0.0.23!) in 3 hours. AA is a huge package. I spent another hour adding new 0.2.0 features to AA definitely improving it. See the attached video for more details on what was fixed in 0.2.0-next.2. I realize I didn't put out some release / update notes which will help somewhat in the process. There aren't many breaking changes, but a pertinent one for callbacks. You'll mainly have to watch out for app header buttons and any TJSDialog callbacks as now an object is passed back instead of an argument list. Here is the overview / notes: Package sub-path Changes: - Widely used change: localize is located in #runtime/util/i18n. - All "application shell" components are located in #runtime/svelte/component/application. - Several more sub-paths are refined in the runtime & standard library. Use API docs to find new sub-paths. This package overview page is handy too. Breaking Changes: - Runtime library - SvelteApplication - app header - onPress callback now takes an object { button, event }. To change the button icon / label on press modify button after destructuring. - To define Svelte components set the svelte property to a TJSSvelteConfig object. - SvelteApplication.state method name changes. If you are serializing / storing app positional state you need to update get() to current(). - get() to current() - getSave() to get() - TJSDialog - onClose & onPress callbacks take an object { application } - #runtime/svelte/store/fvtt -> gameState removed; use globalThis.game in templates instead. - All document CRUD dialogs moved to standard library #standard/application/dialog/document - Standard library: - Various components / mostly buttons -> onClickPropagate to clickPropagate - TJSMenu / TJSContextMenu onPress callbacks take an object { event, focusSource, item } --- Refinements: - TJSDocument / TJSDocumentCollection - Improved Foundry callback registration. No need to manually call destroy(). - TJSGameSettings - No longer checks for equality on game setting store update allowing objects to be stored. ------ These are many other refinements, but some of those above were concerns from various developers. Of course the breaking changes to look out for as well. Here is the 0.2.0-next.2 / AA update video: https://www.youtube.com/watch?v=tlaBOCmGBe8
9 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/3/2024 in #typhonjs-runtime
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. --- Repo and NPM package name changes. The main repo in typhonjs-fvtt-lib is now runtime instead of typhonjs. Likewise svelte-standard is now standard. I will be making a new NPM package release for the standard library: @typhonjs-fvtt/standard instead of svelte-standard and marking the older package as deprecated. --- This release is large and will require some package import refactoring depending on what parts of TRL you utilize in your projects. Please see the pre-release 0.2.0 API docs which have now been updated reflecting all of the sub-path changes. More or less a lot of these changes affect the standard component library as now instead of #standard/component the components are logically separated into associated groupings. like #standard/component/button for buttons, etc. The following changes will be the most likely: - All application shell components #runtime/svelte/component/core -> #runtime/svelte/component/application. - localize (helper function for i18n support): #runtime/svelte/helper -> #runtime/util/i18n. - Components from the standard library will now have more explicit groups / sub-paths. Expand the tree for #standard/components in the updated API docs. I was able to make tremendous progress in the last week cleanly separating all non-Foundry specific components from the FVTT standard library into a base standard component library that can be used anywhere. This significantly increases the timeline of the Svelte 5 transition because I can now iterate on the Svelte 5 conversion without involving Foundry itself. To facilitate this separation though the Vite config will need a small mod:
{
resolve: { conditions: ['import', 'browser'] }
}
{
resolve: { conditions: ['import', 'browser'] }
}
Adding the alias directive allows the generic components to compile against the FVTT runtime and not the "base runtime".
{
resolve: {
alias: { '#runtime/': '@typhonjs-fvtt/runtime/' },
conditions: ['import', 'browser']
}
}
{
resolve: {
alias: { '#runtime/': '@typhonjs-fvtt/runtime/' },
conditions: ['import', 'browser']
}
}
--- There is only one code / breaking change. In the past various callbacks whether for app header buttons, TJSDialog callbacks, or various components from the standard library that provide data defined callbacks took argument lists. Instead of a variable number of arguments a single object will be passed now. This allows flexibility in typing and further extension in the future without disruptive refactoring if those arguments would have changed. If you have a dialog callback for instance that previously was:
function onSomeButtonPress(application) { /* Do something */ }
function onSomeButtonPress(application) { /* Do something */ }
all you have to do is add {} to destructure:
function onSomeButtonPress({ application }) { /* Do something */ }
function onSomeButtonPress({ application }) { /* Do something */ }
That's the breaking change for 0.2.0. This does require naming the destructured properties correctly and being mindful that you need to find / replace all callbacks appropriately across your codebase. For most folks that might be TJSDialog usage and app header buttons. It's less likely folks are using the data defined callbacks from the components in the standard library.
104 replies
TTyphonJS
Created by TyphonJS (Michael) on 8/7/2024 in #typhonjs-runtime
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.
15 replies
TTyphonJS
Created by TyphonJS (Michael) on 8/6/2024 in #typhonjs-runtime
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 I'd be glad to get some feedback and certainly can help adjust this code to the current 0.1.3 release, but it clearly shows what is possible. Here is the video preview: https://www.youtube.com/watch?v=PPW7opFlS90
16 replies
TTyphonJS
Created by TyphonJS (Michael) on 7/4/2024 in #packages
Forien's Quest Log `0.8.0-beta.1`
Greets @FVTT ▹ Quest Log users, There is a public beta release available of the next FQL release (0.8.0-beta.1). It is v11 / v12 capable and is fully functional. It should be representative of the final release. You can install this immediately if you are waiting for FQL on v12. Your quest data is stored separately in journal documents, so you can install / uninstall this beta release. Check out this video for install and quick overview of new features: https://www.youtube.com/watch?v=cX8EbdRLJe8 I'll be making an actual release video for the public release later. To install the beta release: - Uninstall any existing FQL module. - Install the beta from this package link in the Foundry package manager: https://github.com/typhonjs-fvtt-scratch/foundryvtt-forien-quest-log/releases/latest/download/module.json For good measure when the official 0.8.0 release becomes available uninstall the beta release and reinstall FQL from the Foundry package manager. - Optional: Install latest Item Piles / 3.0.5 if your system is supported. --- There are no DB changes / migrations so this is a safe update. As always though please back up your data. New features: - Actor documents can be set as rewards (Item Piles / PF2e loot actors) - All rewards can have associated image changed. - Player notes If you are using dnd5e you can use the system text enrichment capabilities to create a custom reward using: [[/award 1000xp]] to distribute XP. See the beta release video above for brief demos of how to use Item Piles w/ FQL. --- The official release may happen next week. Do remember to uninstall the beta and re-install the official release as the beta repo / resources will be taken down after the official release is available.
4 replies
TTyphonJS
Created by TyphonJS (Michael) on 5/22/2024 in #typhonjs-runtime
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. ----- To check out HMR for language files add the following to your Foundry manifest:
{
"flags": {
"hotReload": {
"extensions": ["json"],
"paths": ["lang"]
}
}
}
{
"flags": {
"hotReload": {
"extensions": ["json"],
"paths": ["lang"]
}
}
}
For paths insert the language file directory. Then make sure to enable hot reloading of files in the main Foundry server settings page / GUI. Restart the server and fire up the dev server and when you make changes in the lang JSON files HMR should be triggered. Make sure the proxy settings of your Vite config properly forwards lang to the main server. You can check out template-svelte-esm for an example setup. Thanks @Nekro Darkmoon for the help in testing this hot patch!
11 replies
TTyphonJS
Created by TyphonJS (Michael) on 5/18/2024 in #typhonjs-runtime
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
19 replies
TTyphonJS
Created by TyphonJS (Michael) on 3/5/2024 in #typhonjs-runtime
TJSDocument discussion w/ VoodooFrog
Following up on this discussion from #dev-lounge from @VoodooFrog:
I have a TJSDocument for an actor in which I am creating an embedded store which filters out certain items on the actor. These are then each displayed with their own component which contains a select that sets some data. Now, I have created a new select control in the parent that sets all the items via an update to a given value, but upon doing so the child component is not reflecting the change in their own controls (and yes I am setting the selected value based on the data). Any ideas what might be happening or how I can fix it? I don't have the code in my repo yet, as I'm still working on it so I can't just link the source, unfortunately.
When you can commit something to take a look at that will help a lot.
37 replies
TTyphonJS
Created by TyphonJS (Michael) on 2/6/2024 in #typhonjs-runtime
Advanced Templates Module (PF1)
A thread to discuss Svelte and the Advanced Templates module.
40 replies
TTyphonJS
Created by TyphonJS (Michael) on 1/30/2024 in #typhonjs-runtime
Automated Animations
This is a forum post to track discussion on Automated Animations. When TRL 0.2.0 is released I plan to update AA to the latest. In the meantime this post also is for discussing AA and an attempt to provide feedback for those that are trying to add new system support to it.
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 12/1/2023 in #packages
Quest Log Permissions / Info
HI @larsvonawesome. You asked:
Trying to find more info on Forien's Quest Log; I'm having an issue where I as a GM can write in the description of a quest, but my players don't see that
Thanks for checking out the quest log. There are indeed a fair amount of options / settings that could be affecting this situation. Since I assume you might be new to using the quest log all quests start as "inactive" you have to make them "active" so that they become visible to players. Besides that there are ownership settings for quests, but quite likely you haven't touched that. This is where you can set the quests to be visible by particular players to make private quests. You'll have to provide more information in regard to what you are currently doing, but my guess is that perhaps you created a quest, but didn't make it active. There is a video tutorial series that covers all of the quest log features and more here that is useful to peruse. There are topic links in the description, so you can jump around to topics of interest: https://www.youtube.com/playlist?list=PLHslnNa8QKdD_M29g_Zs0f9zyAUVJ32Ne Let me know your particular situation and I'm sure it'll be resolved soon though.
12 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/24/2023 in #typhonjs-runtime
Setting up TRL / contributing to existing module (Item Piles)
Hi @Paith. I have started this forum post where we can continue to discuss setting up TRL and getting you on the path to potentially investigating / contributing to Item Piles. I'm going to include @Wasp as well who develops / maintains Item Piles. Lots to potentially discuss and I'm definitely keen to help. Check the pins in #welcome for an overview on TRL and various additional / demo resources that are available. Getting your developer setup via Node / NPM will be the first thing to make sure you have sorted.
9 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/22/2023 in #typhonjs-runtime
Reactivty and prepareDerivedData
From @Wasp
So I'm using prepareDerivedData to, well, derive some data for my items; some of them are tied to each other (ie, an "equipment" type item affects a "skill" type item's bonus). I was hoping that re-calling the derived data methods would cause the TJSDocuments to pick up the alterations, but since it's not a database operation, it doesn't appear to pick that up. Is there a good way allow one item to cause the reactivity of another without manually creating stores?
Moving discusion to forum post.
26 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/17/2023 in #typhonjs-runtime
Local Development w/ NPM Link
From @Gerark:
Hello! this is probably a base webdev question but I can't find a good reference for the issue I'm having atm. I'm working on a TyphonJS template project and I'm importing a custom svelte library ( basically a UI component library ). I'd like to use npm link to work a bit more effectively without having to publish to npm a new package over and over whenever I make changes to the custom library. Apart from the npm link command to call on both sides ( with different parameters ) is there anything I should take care of? [3:39 PM] I get a bunch of errors telling me I'm trying to import stuffs with a wrong path but I thought npm link was going to work seamlessly and that I shouldn't be forced into changing the way how path should be written when importing a component.
47 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/6/2023 in #typhonjs-runtime
TRL / Svelte based game systems
This post is a list of repos for game systems built with TRL / Svelte for Foundry. Please DM me if you'd like to add yours to the following lists. Released (available on Foundry package manager): - Level Up A5e: https://github.com/Pjb518/FoundryVTT-Level-Up-Official; @Nekro Darkmoon, @Phil Work in progress (Github repo / direct install): - Icon: https://github.com/whitespine/foundryvtt-icon; @WHITESPINE - Titan: https://github.com/Solidor777/Titan-VTTRPG; @Solidor More to come... Send me a DM to get added to this list. This post is locked and provides an index of links to various folks game system efforts.
1 replies
TTyphonJS
Created by TyphonJS (Michael) on 9/26/2023 in #typhonjs-runtime
Fabricate
@MisterPotts. Just starting a forum post to keep track of the conversation.
Fabricate doesn't maintain any of its own documents; it only records metadata in its settings. Do you think that would be a problem for TRL? For example, is there an assumption that applications are tied to documents? I would be surprised, but thought it worth asking up front
There are no particular data / document associations for TRL apps. Depending on where you are storing the metadata there are several reactive APIs available that could help out for game settings and web storage. You'll have to describe more about what you are doing currently from a data storage perspective and I can point you in the right direction. The first thing to do though is work out the TRL SvelteApplication extension and configuration through defaultOptions as it is different than what you came up with. The next thing is to use the ApplicationShell component as the outer wrapper for any of your components. With TRL the entire application shell is Svelte powered vs embedding components in the Foundry core app shell. Installing essential-svelte-esm and taking a look at the example code should give you an idea on how that works.
7 replies
TTyphonJS
Created by TyphonJS (Michael) on 9/25/2023 in #typhonjs-runtime
Svelte 5 TJSDocument Prototype
Greets @FVTT ▹ Developer. As some of you might have seen there is a bit of paradigm shift that is going to occur when Svelte 5 drops with a new way of defining reactive state. Please check some of the recent discussion in the #dev-lounge for links to the Svelte 5 blog post and a few other things. https://svelte.dev/blog/runes https://svelte-5-preview.vercel.app/docs/introduction I just worked up a potential prototype in the Svelte 5 REPL for what this could bring to TJSDocument for direct property access and reactive manipulation. The prototype simulates the Foundry document model update cycle. This demo is naive in many ways, so is bare bones code. What I'm curious about is how folks feel / think about how the new dynamic reactive properties should be exposed in the TJSDocument API. The demo adds a new behind the scene property state management that dynamically creates Svelte 5 $state instances for properties defined in a documents schema. I made this accessible from a new getter on the TJSDocument instance itself; $. In the demo the naive document has a name and count properties. You can reactively access them via doc.$.count / doc.$.name. You can drop those into wherever things can be bound and setting the values automatically will invoke update via the Foundry document model (this is simulated). This potentially addresses a way to dynamically access document properties in a fully reactive way that automatically updates the underlying document data transparently. This needs to be vetted in real world conditions once Svelte 5 drops! I have yet to think about how document flag access could be dynamically created. You can check out the demo on the Svelte 5 REPL here: https://tinyurl.com/tjsdocument-svelte5-2
7 replies
TTyphonJS
Created by TyphonJS (Michael) on 9/14/2023 in #packages
FQL / TextEditor enrichment issue
From @ooblekie:
can anyone give me a hand as to why the text keeps coming up as object promise in the quest log? it happens regardless of what text i put in and has only started to happen on my most recent foundry world. everything is up to date with the most recent version and i don't really know what else to try
6 replies
TTyphonJS
Created by TyphonJS (Michael) on 9/4/2023 in #typhonjs-runtime
TRL `0.1.2` - Fine Tuning release
Greets @FVTT ▹ Developer! I have just released a fine tuning release that brings a few more features, but really shores up a few things that slipped by initial testing of the beta release. I got in several small enhancements suggested by the dev community. There is one possible breaking change, but it is minor and I will discuss it after the release notes below. Do keep the conversation going and let me know about things that you encounter. The API docs are updated: https://typhonjs-fvtt-lib.github.io/api-docs/index.html - Fixed min window height / width for app shells (global vs script space variable access) - Fixed SvelteApplication render gating / force: false will short circuit properly when app not already rendered. - EmptyApplicationShell component can now be made resizable via setting the resizable app option. - Added closeOnInput prop to TJSGlassPane which fires close:glasspane event on pointer down event. - Added modalOptions.closeOnInput to TJSDialog data / close modal dialog on glasspane input. - Upgraded TJSDialogData adding reactive accessors for all standard data. New replace function instead of accessor setting of all data. - Update types for transition / modal options for TJSDialog. - Fixed application shell transition prop handling - defaultCloseAnimation option not taking when set to false w/ no transition defined. - separately defined in / out transitions works correctly. - DynReducerHelper.filters.regexObjectQuery - Can now take "accessor" strings to lookup nested properties. Simply provide a string separated by . for each depth. - An additional option is available accessWarn when set to true will log warnings when property lookups fail. Breaking Change: The potential breaking change is how dialog data is set in TJSDialog. There is a new replace method on the data field rather than directly setting an object to data. This change was due to that Typescript / creating declarations and API docs didn't like the types to differ for the getter and setter accessors. This likely doesn't actually cause any problems for folks as you'd have to explicitly set the data property in a custom dialog constructor. Instead of this.data = { ... } change things to this.data.replace({ ... }); New reactive data accessors: The TJSDialogData instance now has reactive accessors for all standard dialog data. For instance you can do this.data.content = 'New Content'; or this.data.content = { class: MySvelteComponent }; and the dialog will reactively update. Check out the API docs: https://typhonjs-fvtt-lib.github.io/api-docs/classes/_runtime_svelte_application.TJSDialog.html https://typhonjs-fvtt-lib.github.io/api-docs/interfaces/_runtime_svelte_application.TJSDialogData.html
1 replies
TTyphonJS
Created by TyphonJS (Michael) on 7/26/2023 in #typhonjs-runtime
Release `TRL 0.1.1` - Patch release
Greets @FVTT ▹ Developer! I have just released a patch / fix release that fixes a small oversight in the 0.1.0 release regarding the internally used ResizableHandle Svelte component for application windows via ApplicationShell. In the 0.1.0 release if you set width or height to auto and the app window is resizable an error occured. This was just a missed refactoring aspect to some internal code and I happened to not catch it in testing for the 0.1.0 release as it was data specific in how an app is setup. Another fix is passing the element as a JQuery element in the SvelteApplication hook invocation for closeApplication. Thanks @whitespine and @mouse0270 for providing some insight into getting things tip top again. Please do reach out if you see any issues as I'm certainly keen to make sure TRL is 100% bug / issue free. If you already have moved to TRL 0.1.0 you should just need to run npm install again to get the 0.1.1 patch. To be absolutely sure you get the TRL 0.1.1 release delete package-lock.json and node_modules directories and do a completely fresh install.
1 replies