Is your feature request related to a problem? Please describe.
The following doesn't work
import xarray as xr
da = xr.DataArray([[1,2],[1,2]], dims=("x", "y"))
da.stack(flat=...)
Describe the solution you'd like
This could be equivalent to
I think using ds.dims it should be fine for datasets too.