Begin by making the pastry. Place the flour and butter in a food processor and process until the mixture resembles bread crumbs. Add the egg yolk and water and pulse until the mixture begins to come together to form a ball. Turn the mixture out onto plastic wrap and shape into a disc. Refrigerate for 30 minutes.
Remove the pastry from the refrigerator and roll out the pastry on a lightly floured bench or silicone baking mat until approximately 5mm thick. Line a 30cm loose bottomed tart tin with the pastry, making sure to press into the sides, and trim the excess. Refrigerate for 15 minutes.
Preheat the oven to 180 celsius (355 Fahrenheit) and line the tart with baking paper and fill with baking weights or beans. Bake for 10 minutes before removing the baking paper and weights and baking for a further 5 to 7 minutes or until the base is dry and lightly golden. Set aside to cool.
To make the caramelised onions, heat a large frying pan over a medium low heat and add the butter before adding the onions and reduce the heat to low. Cook for 10 minutes before adding the balsamic, 2 tsp of the thyme leaves and brown sugar. Cook for a further 10 minutes until caramelised. Set aside to cool.
In a bowl add the eggs and egg yolk along with the cream and milk and whisk to combine. Season to taste.
Place the onions in the base of the tart and spread evenly over the base. Sprinkle with the grated cheese before topping with the egg mixture. Finally, sprinkle with the remaining thyme leaves. Bake for 15 to 18 minutes or until the filling is just set.
For a professional finish on the tart base, run the rolling pin over the top of the tart tin to remove the excess. Feel free to replace the cheddar with the cheese of your choice.