Heat oven to 350°F. Grease a 9×13-inch pan and line the bottom with parchment.
Whisk flour, granulated sugar, brown sugar, baking soda, baking powder, salt, and cinnamon in a large bowl.
Beat eggs with oil and vanilla in a separate bowl until smooth. Stir in the crushed pineapple with its juice.
Combine wet and dry just until no dry streaks remain. Do not overmix.
Fold in nuts and coconut, if using.
Spread batter into the pan and smooth the top. Tap the pan once to release bubbles.
Bake 33–37 minutes, until golden and a toothpick in the center comes out clean.
Cool 15 minutes in the pan. Turn out to a rack, peel parchment, and cool completely.
Beat cream cheese and butter until fluffy, 2 minutes.
Add powdered sugar, vanilla, and salt. Mix on low, drizzling in milk until smooth and spreadable.
Spread frosting over the cooled cake. Top with chopped pecans, if desired. Chill 15 minutes to set before slicing.