In a large mixing bowl, combine the flour, sugar, and salt. In another bowl, mix the warm milk, sourdough starter, and egg until well combined.
Pour the wet ingredients into the dry ingredients and mix until a shaggy dough forms.
Turn the dough onto a lightly floured surface and knead for about 5-7 minutes until smooth.
Place the dough in a lightly greased bowl, cover with plastic wrap, and let it rise at room temperature for 4-6 hours, or until doubled in size.
While the dough is rising, take the cold butter and place it between two sheets of parchment paper. Use a rolling pin to pound and roll it into an 8x8-inch square. Chill in the fridge while the dough rises.
Once the dough has risen, roll it out into a rectangle about 12x18 inches.
Place the chilled butter block in the center of the dough. Fold the sides of the dough over the butter, encasing it completely.
Roll the dough out to approximately 12x24 inches and perform a tri-fold (like folding a letter). Wrap in plastic wrap and refrigerate for 30 minutes.
Roll out and fold the dough two more times, chilling for 30 minutes between each fold.
Roll out the dough one final time to about ¼-inch thickness. Cut into squares (about 4x4 inches).
Make a small cut in each corner of the square, about 1 inch in from the edge, and gently fold the corners into the center to create a pocket.
In a bowl, mix the cream cheese, sugar, vanilla, and egg yolk until smooth. Place a spoonful of the cheese filling in the center of each danish. If using, add a dollop of strawberry rhubarb compote on top.
Brush the edges of the danishes with the beaten egg.
Place the shaped danishes on a lined baking sheet. Cover with a damp cloth and let them rise for 1-2 hours until puffy.
Preheat your oven to 375°F (190°C).
Bake the danishes for 20-25 minutes, or until golden brown.
Allow the danishes to cool slightly before serving.
