src/generators/dom/preprocess.js/preprocess
export default function preprocess ( generator, node ) {
	const block = new Block({
		generator,
		name: generator.alias( 'create_main_fragment' ),
		key: null,

		contexts: new Map(),
		indexes: new Map(),
		contextDependencies: new Map(),

		params: [ 'state' ],
		indexNames: new Map(),
		listNames: new Map(),

		dependencies: new Set()
	});

	generator.blocks.push( block );
	preprocessChildren( generator, block, node );
	block.hasUpdateMethod = block.dependencies.size > 0;

	// trim leading and trailing whitespace from the top level
	const firstChild = node.children[0];
	if ( firstChild && firstChild.type === 'Text' ) {
		firstChild.data = trimStart( firstChild.data );
		if ( !firstChild.data ) node.children.shift();
	}

	const lastChild = node.children[ node.children.length - 1 ];
	if ( lastChild && lastChild.type === 'Text' ) {
		lastChild.data = trimEnd( lastChild.data );
		if ( !lastChild.data ) node.children.pop();
	}

	return block;
}