Preheat the oven to 350°F (175°C).
Grease and lightly flour a 9×13-inch baking pan.
In a large bowl, whisk together the flour, baking soda, and salt.
In another bowl, beat the eggs, sugar, and vanilla extract until smooth.
Stir in the crushed pineapple with its juice.
Fold the wet ingredients into the dry ingredients until just combined.
Fold in the chopped pecans if using.
Pour the batter evenly into the prepared pan.
Bake for 30–35 minutes or until a toothpick inserted into the center comes out clean.
Cool the cake completely before frosting.
Beat the cream cheese and butter until creamy.
Gradually add the powdered sugar and beat until fluffy.
Mix in the vanilla extract and pineapple juice.
Spread the frosting evenly over the cooled cake.
Sprinkle with toasted coconut.
Garnish with pineapple chunks, maraschino cherries, and chopped pecans if desired.
Slice and serve chilled or at room temperature.