Unable to define custom node executors in v7

In v6, nodes each defined an execute method to handle execution. In v7 those have all seemingly been moved into one giant node executor function, which throws if an non-predefined node type is encountered.

The only way to add custom handlers would seem to be to wrap that entire function, detect the custom node(s) first and run the custom execution, falling back to the default node executor otherwise. That would be workable (if somewhat inefficient by adding overhead to every single node) however there doesn't seem to be any way to override the node executor when creating the environment object as it's loaded directly within template instance – not via anything defined on the environment.

The only workaround I could find was to wrap the environment.loadTemplate method, which for each loaded template wraps its template.execute method to set the options argument's nodeExecutor property, which works but feels brittle and undocumented:

import type { TwingEnvironment, TwingNodeExecutor } from 'twing';

export function hackilyReplaceNodeExecutor(
  environment: TwingEnvironment,
  nodeExecutor: TwingNodeExecutor,
): void {
  const originalLoadTemplate = environment.loadTemplate;
  environment.loadTemplate = async function patchedLoadTemplate(...args) {
    const template = await Reflect.apply(originalLoadTemplate, this, args);
    const originalExecute = template.execute;
    template.execute = async function patchedExecute(templateEnvironment, context, blocks, outputBuffer, options = {}) {
      options.nodeExecutor ??= nodeExecutor;
      return Reflect.apply(originalExecute, this, [templateEnvironment, context, blocks, outputBuffer, options]);
    };
    return template;
  };
}

Is there a recommended, supported approach for defining execution functions for custom nodes?