How to Make It
Preheat the oven to 475° and line a baking sheet with parchment paper. On a lightly floured surface, roll out the puff pastry to a 12-inch square about 1/8 inch thick. Trim the edges to form a neat square. Cut a 1/2-inch-wide strip from each of the 4 sides of the pastry. Brush the pastry square lightly with the beaten egg, then arrange the strips along the edges to form a raised rim. Using a fork, prick the bottom of the crust all over. Bake the tart shell for 15 minutes, or until it is golden and the rim has risen; use a fork to flatten any bubbles.
Meanwhile, melt the butter in a large, deep skillet. Add the onions, cover and cook over high heat, stirring frequently, until softened and browned, about 10 minutes; add a few tablespoons of water as needed. Remove from the heat.
In a medium saucepan, bring the milk to a boil. Add the polenta and whisk until smooth. Cook over moderate heat, stirring, until thickened, about 5 minutes. Season with salt and pepper and stir in the onions, Fontina and 1 teaspoon of thyme. Spread the polenta in the crust and bake for 5 minutes, or until the top is lightly browned. Sprinkle with thyme and serve.
A crisp green salad.