react library
So far I've seen Vue 2, Vue 3, Alpine, and Svelte pulled into Foundry. No one has yet been crazy enough to try react. So in the name of science... Yolo?
As someone who works in react land, I think it is dramatically overkill for 99% of foundry use cases. Using react for small forms or dialogs would pull in way too much overhead.
I would consider react if I was making something complicated and multi-step like a character creator where state management matters a lot more.
But the biggest thing I have against any of these frameworks is that by using them you lock other people's modules out from modifying your thing. A lot of modules add a very small piece of functionality to something and do so by injecting DOM into existing forms for instance. My understanding of React is that it gets super mad when the DOM diverges from the virtual DOM, so this kind of injection would be a no go.
C
Calego•984d ago
Good call
UU
Unknown User•984d ago
C
Calego•984d ago
When I first started working on stuff that was my instinct as well.
It felt dirty to go back to jQuery after so long...
UU
Unknown User•984d ago
C
Calego•984d ago
But I've kinda gotten to the point where I like how simple this FE is. You can read and understand the Application class in like a day. And it's pretty elegant.
UU
Unknown User•984d ago
C
Calego•984d ago
Right, at that point you've done a lot of extra work for possibly no benefit
So if you do want to use react, I'd suggest doing so for things which no other module would want to modify
Do you have anything in mind that's heavy enough to warrant state management and the like?
UU
Unknown User•984d ago
C
Calego•984d ago
Instead of React, Preact might be an answer
UU
Unknown User•984d ago
C
Calego•984d ago
The fun part is getting data to and from Foundry's Database
linking foundry's mutating understanding of the world 'state' with a react component state
I don't have enough experience with working with React outside of a fully react project to really know how to start with that
UU
Unknown User•984d ago
C
Calego•984d ago
Kind of
for DocumentSheet, yeah, somehow the db updates call render(). But the default
Application
and FormApplication
don't have that wired up, which allows you to control when the application re-renders.UU
Unknown User•984d ago
C
Calego•984d ago
i.e. everyone calls
this.render
at the end of _updateObject
for a FormApplicationUU
Unknown User•984d ago
C
Calego•984d ago
does react have a utility thing which lets you like 'bind' a component to an external object to use as a prop?
UU
Unknown User•984d ago
C
Calego•984d ago
Stack Overflow
How to use external object in react?
A third party sent me this script. Basically,
include a script
call the object
onAuthorize will feedback data, then do something with data
Is it a way to integrate it with react? I think I need the
C
Calego•984d ago
Interesting
oh this is ancient
C
Calego•984d ago
Integrating with Other Libraries – React
A JavaScript library for building user interfaces
C
Calego•984d ago
So I guess yeah, using whatever data as a prop
the output of
getData
is what's usually fed into the template that an Application rendersUU
Unknown User•984d ago
Want results from more Discord servers?
More Postsweb componentsA comment @n1xx1 made over in #development-basics (https://discord.com/channels/732325252788387980/7UI element JS Classeshttps://discord.com/channels/732325252788387980/734922093967310910/882979923483037696
@wyrmisis
> Imid-milestone ping feedback@dnd5e **No Action Required**
Wanted to ping you to make you aware that the 1.5.0 milestone is >50%Hot ReloadingIs there a way to do something like hot module reloading/live reloading on change for Foundry?Tagger Code ReviewWould anyone be keen to code review Tagger? I'd like to git better 😄
https://github.com/Haxxer/Founsocket woesnot the socket firingpreUpdateSo for some reason ItemPF#_preUpdate changes aren't sticking.. what is PF1 doing that prevents this?mergeObject`mergeObject` is a beast of a function which lets you smash two objects together and that options arselect in sheetAlso, is the data actually saved on the actor? You can inspect the data in the console opened with FIC 5e DocsI'm not looking to ping about this but for anyone who sees this: I'm interested to know if anyone hecustom hud elementMaybe I'm missing something simple here. I'm making my own custom hud element (NOT based on a FoundrCover@badgerwerks how does the cover application for 5e helpers work?
I know you do black magic to calculGitpod WorkflowHas anyone figured out a codespaces workflow?Dynamically get Object property from user inputAnyone know how I can do this?
I have an Actor (`myactor`) and I'd like to have an input box which autopublishI'm trying to use @varriount's AutoPublish, but I keep getting this error. Any ideas?https://github.symlinking foundry.js and vscodeIs this something you were able to do with vscode? I'm trying right now with both WSL2 symlinks and Releases to ChangelogI just automatically made a Changelog by going to https://github.com/arcanistzed/scs/releases and rucodespacesGo to any github repository and press `.`
You'll get kicked over to a `github.dev` version of the reequipmentType bonus⚠️ Breaking Changes ⚠️
The `DND5E.equipmentTypes` type of `bonus` has been removed. Any in-world `Scroll Into View troublesAnyone know why `Element.scrollIntoViewIfNeeded()` is working, but `Element.scrollIntoView()` isn't?