We construct a family of PBWD (Poincaré-Birkhoff-Witt-Drinfeld) bases for the quantum loop algebras Uv(Lsln), Uv 1 ,v 2 (Lsln), Uv(Lsl(m|n)) in the new Drinfeld realizations. This proves conjectures of [HRZ, Z1] and generalizes the corresponding result of [Ne].The key ingredient in our proofs is the interplay between these quantum affine algebras and the corresponding shuffle algebras, which are trigonometric counterparts of the elliptic shuffle algebras of [FO1]-[FO3]. Our approach is similar to that of [E] in the formal setting, but the key novelty is an explicit shuffle algebra realization of the corresponding algebras, which is of independent interest. We use the latter to introduce certain integral forms of these quantum affine algebras and construct PBWD bases for them, which is crucially used in [FT2] to study integral forms of type A shifted quantum affine algebras. The rational counterparts provide shuffle algebra realizations of the type A (super) Yangians. Finally, we also establish the shuffle algebra realizations of the integral forms of [Gr, CP].