Skip to content

Feature/v14 migration#274

Merged
JulenBordonaba merged 31 commits intoAnimaBeyondDevelop:mainfrom
LarsLTS:feature/v14-migration
Apr 15, 2026
Merged

Feature/v14 migration#274
JulenBordonaba merged 31 commits intoAnimaBeyondDevelop:mainfrom
LarsLTS:feature/v14-migration

Conversation

@LarsLTS
Copy link
Copy Markdown
Contributor

@LarsLTS LarsLTS commented Apr 8, 2026

Lo siento @Julen-BZ como tengas que mirarte esto a mano.

Cambios para que funcione todo en foundry v14. Se mantiene la compatibilidad también con v13.
He comprobado con ambas versiones en local.

LarsLTS added 30 commits April 8, 2026 13:19
- inflateSystemFromTypeMarkers: guard against circular refs (WeakSet) and
  read-only properties (EmbeddedCollection#documentClass) to fix
  'Cannot assign to read only property' and stack overflow errors
- ABFActorSheet, ABFItemSheet: extend from foundry.appv1.sheets.* with
  fallback to global for v13 compatibility
- ABFActorDirectory: extend from foundry.applications.sidebar.tabs.ActorDirectory
  with fallback to global for v13 compatibility
- animabf.mjs: use foundry.applications.handlebars.loadTemplates with fallback
- Rename _ActorSheet/_ItemSheet/_ActorDirectory to PascalCase (ActorSheetV1,
  ItemSheetV1, ActorDirectoryV1) to satisfy @typescript-eslint/naming-convention
- Add root tsconfig.json (allowJs, noEmit) required by eslint-config-airbnb-typescript
- animabf.mjs: replace renderChatMessage hook with renderChatMessageHTML,
  rewrite jQuery DOM ops to native (querySelector, addEventListener, innerHTML)
- renderTemplates.js: use foundry.applications.handlebars.renderTemplate with
  fallback to global for v13 compatibility
- handlebarsPartials.js: use foundry.applications.handlebars.getTemplate with fallback
- animabf.mjs: use foundry.documents.collections.Actors/Items and
  foundry.appv1.sheets.ActorSheet/ItemSheet with fallbacks for sheet registration
- ABFFoundryRoll: strip deprecated 'async' option before passing to super.evaluate
- ABFAttackData: use foundry.applications.handlebars.renderTemplate with fallback
- ABFAttackData: replace randomID() with foundry.utils.randomID()
getTargetToken throws when no target is selected, but the error was
propagating as an uncaught promise rejection. Wrap the call in a
try/catch and return early — the dialog prompt is already shown by
getTargetToken before throwing.
canvas.grid.measureDistance() was removed in v14 and replaced with
measurePath(). The token stored in modalData is a TokenDocument, which
does not have a .center property — that belongs to the canvas Token
object (tokenDocument.object). Use token.object?.center with a fallback
to token.center for compatibility.
Extract handler to _handleChatMessage and register renderChatMessageHTML
(v14, HTMLElement) or renderChatMessage (v13, jQuery) based on
game.release.generation at init time.
Use foundry.applications?.ux?.ContextMenu?.implementation ?? ContextMenu
fallback. Pass { jQuery: false } option only on v14. Normalize callback
target with instanceof HTMLElement guard.
Replace direct foundry.applications.ux.TextEditor.implementation calls
with (foundry.applications?.ux?.TextEditor?.implementation ?? TextEditor)
in prepareActor, TechniqueItemConfig, NoteItemConfig, SpellItemConfig,
and PsychicPowerItemConfig.
Replace target[0].dataset with (target instanceof HTMLElement ? target : target[0]).dataset
in SupernaturalShieldItemConfig and ElanItemConfig callbacks.
canvas.grid.measurePath was added in v14; fall back to
canvas.grid.measureDistance(a, b, { gridSpaces: true }) for v13.
@JulenBordonaba JulenBordonaba merged commit 1d27927 into AnimaBeyondDevelop:main Apr 15, 2026
@LarsLTS LarsLTS deleted the feature/v14-migration branch April 15, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants