Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Soundness for CONFIG properties #2984

Open
LukeAbby opened this issue Dec 18, 2024 · 1 comment
Open

Check Soundness for CONFIG properties #2984

LukeAbby opened this issue Dec 18, 2024 · 1 comment
Assignees

Comments

@LukeAbby
Copy link
Collaborator

In CONFIG we need to know how each object/array can be configured in order to help keep it safe.

For each object/array I'd like to know:

  1. Can properties be removed?
  2. Can properties be added?
  3. Can properties be modified?

As well as any cases where the current types are missing properties, overly restrictive, or not restrictive enough.

@JPMeehan
Copy link
Collaborator

JPMeehan commented Jan 9, 2025

Properties of CONFIG. Broadly speaking, you can add new properties to most places they just won't do anything (e.g. CONFIG.Actor.foo = 'bar') without further usage.

  • debug: Intended to be dynamic
  • compatibility:Intended to push to arrays & adjust mode
  • compendium: Intended to expand on uuidRedirects as Record<string, string>. Most likely to be used by modules.
  • DatabaseBackend: ...can replace, I guess?
  • Document namespaces (e.g. Actor)
    • sheetClasses, typeLabels filled in programatically
    • DataModel and document class configuration deserve special attention
    • Special areas for expansion as record/arrays
      • CONFIG.Cards.presets uses Card constructor data
      • CONFIG.Combat.sounds uses a unique interface
      • CONFIG.JournalEntry.noteIcons is actually for the Note placeable document
      • CONFIG.MeasuredTemplate.defaults cannot be meaningfully appended to
      • CONFIG.MeasuredTemplate.types is... a bad form of i18n support? Removed in v13
      • CONFIG.Token notes that the ring properties are initialized programatically
      • CONFIG.Wall.doorSounds is intended to be appended to
  • CONFIG.Dice
    • Many systems just slap their bare roll classes in here
    • CONFIG.Dice.rolls is how Foundry recreates rolls from serialized message data
    • Foundry typing here is surprisingly good for each individual piece, minus the enum vs. Record confusion
  • CONFIG.Canvas
    • Many properties that can be adjusted as colors or numbers
    • dispositionColors cannot be meaningfully appended to, but the colors can be changed (e.g. a color blind mode for deuteranopia)
    • groups and layers can be appended to and controls primary canvas rendering lifecycle
    • lightLevels cannot be meaningfully appended to
    • polygonBackends cannot be meaningfully appended to
    • gridStyles can be expanded and is fed into GridLayer#initializeMesh
    • lightAnimations can be expanded
    • darknessAnimations can be expanded
    • ping types needs to match with styles. pullSpeed can be adjusted as a number.
    • targeting.color is never set normally but acts as an override for the drawn targeting color on tokens
    • hoverFade cannot be meaningfully appended to
    • transcoders.basis is the only one that's used
    • visionModes & detectionModes are intended to be appended to
  • CONFIG.canvasTextStyle can be replaced
  • CONFIG.weatherEffects is intended to be appended to
  • CONFIG.controlIcons is intended to be appended to
  • CONFIG.fontDefinitions is intended to be appended to
  • CONFIG.statusEffects can be appended to, spliced, or replaced
  • CONFIG.specialStatusEffects can be appended to, spliced, or replaced
  • CONFIG.sounds cannot be meaningfully appended to, but a module might want to use the space for exposure
  • CONFIG.supportedLanguages is intended to be appended to
  • CONFIG.i18n cannot be meaningfully appended to
  • CONFIG.time cannot be meaningfully appended to, but a module might want to use the space for exposure
  • CONFIG.soundEffects is used by AmbientSound#effects
  • TinyMCE is on its way out the door (deprecated in v13)
  • CONFIG.TextEditor.enrichers is intended to be appended to
  • CONFIG.WebRTC is a bunch of properties/class references that can be replaced
  • CONFIG.ui is used by Game#initializeUI to create a bunch of singleton applications and can be appended to. It will construct the classes but not call render, so really any class can be put here.

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

No branches or pull requests

2 participants