Make the rough puff pastry at least 2.5 to 3 hours ahead of time; start by combining flour and salt in a bowl. You can make this recipe much easier by using a sheet of storebought pastry, making sure to follow the instructions on the package for thawing!
Cube the butter and add it to the bowl with the flour and salt.
Gently press the butter together between your fingers to create flat pieces; you want to keep the butter pieces relatively large at this point! We do recommend doing this by hand to avoid the butter getting mixed too finely into the flour.
Add ice water, starting with three tablespoons, and start pressing the mixture together until if forms a very shaggy dough that just barely holds together. Add more water if needed a tablespoon at a time, but do not add too much; it's okay if it doesn't hold together perfectly at this stage!
Turn the dough out onto a floured surface and press into a rough rectangle.
Roll out until it is 12" long (width doesn't matter as much, but around 6 inches wide is fine).
Create a letter fold by folding down the top third of the dough over the middle third;
Then fold the bottom of the dough over the top and middle.
Wrap in plastic wrap and refrigerate for at least 2 hours.
While the dough is resting, we like to start the process of caramelizing the onions. You can also do this after you've finished the dough and it's resting for the last time in the fridge if you'd like!
Peel your onions and cut them in half. Slice all the halves.
Add the onions to a cast iron skillet, dutch oven, or a pot with a large base along with a few tablespoons of oil.
Cook on low-medium heat for around an hour, stirring occasionally. Add water as needed to stir up any bits that are sticking to the bottom of the pan.
Once the onions have become a deep golden color, stir in 1 tbsp of fresh thyme (or 1 tsp dried thyme) and add beef bouillon. We use "better than bouillon," the roasted beef version, to get that beef flavor of French onion soup. You can use whatever beef flavored bouillon/seasoning you like! Ours is plenty salty after this, but make sure to taste and add extra salt if needed!
Set the onions aside to cool slightly before using. You can also put them in the fridge if you're making them ahead of time.
After the dough has rested in the fridge, roll the dough out on a floured surface to about a 6" x 12" rectangle. You should turn the dough 90 degrees from how you rolled it out the first time (basically, roll out the long edge of the dough block to be the longest edge of the rectangle!)
Make another letter fold by repeating the same process, folding the top over the middle, then the bottom over the top.
Turn the dough 90 degrees and repeat the rolling to 6" by 12" rectangle, then repeat the letter fold.
Do this folding process two more times; you should have completed 5 total letter folds at this stage (including the one before the resting time in the fridge).
If the dough is ever getting tough to work with, you can wrap it up and let it rest for 30 minutes in the fridge before continuing.
After the last fold, wrap the dough and refrigerate for at least 30 minutes; you can also keep it in the fridge for up to 24 hours. If you didn't start caramelizing the onions before, follow steps #10-15 now!
Preheat your oven to 400F (204C).
Grate the gruyere cheese.
Once the dough has rested, roll it out on a floured surface to a rectangle measuring about 10" by 15".
Transfer the rectangle to a parchment lined baking sheet. We roll up the dough around the rolling pin, then unroll it over the parchment to transfer it easily.
Spread grated gruyere cheese across the dough, leaving at least a 1" border around all the edges.
Add caramelized onions in an even layer across the cheese; make sure the 1" border remains.
Fold up 1/2" of the dough around the edges to create a thicker crust.
Crimp with a fork to ensure that it doesn't unfold.
Egg wash the edges of the pastry. An egg wash is one egg with a little bit of water, whisked together in a bowl. Use a pastry brush to spread the mixture onto the pastry edges.
Bake the tart for around 30 minutes or until the pastry has puffed up around the edges, and is golden brown. Remove from the oven, transfer to a wire rack, and let cool for at least 15 minutes.
Add grated parmesan across the top of the tart (optional). Add fresh ground pepper to the top as well, along with some sprigs of fresh thyme (also optional).
Slice and enjoy! Store in the fridge for 2-3 days and reheat in the oven/toaster oven for best results.