tbranyen/diffhtml

Formalize configuration handling

tbranyen opened this issue · 1 comments

Library configuration handling is always a pain. For diffHTML I think it should be possible to enable/disable configuration in a standard and formal way that is also flexible. Currently there are many configuration settings, such as the memory object size which needs an initialization value at execution time to fill the pool. If you wanted to change this right now, you'd be doing it after the fact that 10000 objects were created. If you wanted to set performance metrics imperatively you would not be able to, as it can only be enabled via config param.

Instead diffHTML should allow configuration in a number of ways:

  • Separate global configuration from Transaction-specific configuration:
    • A global config is something like Pool size or enabling perf metrics, transaction config are things like enabling scripts or string parser settings
  • Tagged template config should be global/scoped. For html tagged template calls, we should be able to configure this globally using ParserConfig
  • All configuration options should be globally mutable via query param, render function options (innerHTML/outerHTML), setting pre-initialization config defaults, and through DevTools.

This has landed in master as well.