As the caramelised onions take quite long, we will start from there. Heat the vegetable oil in a pan. Slice the onions and add them into the pan.
The pan should be on medium-low heat. When making caramelised onions, you need to find a balance in between allowing the onions to cook without stirring them quite often so they can brown and release the sugars and stir them enough times so they don't stick to the pan.
When the onions start to soften, add sugar to speed the caramelising process.
Keep stirring every 5-7 minutes depending on the pan just making sure the onions are not burning or sticking to the bottom of the pan. Cook for about 40 minutes.
When the onions are caramelised, add balsamic vinegar, wine or water to deglaze the pan and stir one last time. Add salt to taste.
Preheat the oven to 200Cº.
Place pastry on a surface and roll out the puff pastry. Keep turning the dough while rolling. When using frozen puff pastry, leave it out and allow to thaw. Work while the pastry is still cold. Place pastry dough on surface and lightly dust it and the rolling pin with flour.
Transfer the puff pastry onto a baking tray and using a knife, score a border (about thumb-size) around the edge of the puff pastry sheet to create a crust. Whisk the egg and using a baking brush, brush the egg wash over the border.
Add evenly the caramelised onions covering the whole dough, except the egg-washed corners.
Wash the figs with cold water and cut into quarters. Add evenly on the tart. Using your hands, crumble the feta cheese and sprinkle on the top of the tart.
Add the thyme and bake for about 20-25 minutes or until the crust is golden. Before serving, you can add a little bit of honey on the top for extra sweetness and texture.