Both the Gospel of Matthew and the Didache present a very similar "Trinitarian baptismal formula":
“Therefore go and make disciples of all nations, baptizing them in the name of the Father and the Son and the Holy Spirit ...” (Matthew 28:19 - bolding added)
Having first recited all these things, baptize {in the name of the Father and of the Son and of the Holy Spirit} in living (running) water. (Didache, 7:2, trans. and ed., J. B. Lightfoot - bolding added)
The NET Bible translation appends this footnote to Matthew 28:19:
2tc Although some scholars have denied that the trinitarian baptismal formula in the Great Commission was a part of the original text of Matthew, there is no ms support for their contention. F. C. Conybeare, “The Eusebian Form of the Text of Mt. 28:19,” ZNW 2 (1901): 275-88, based his view on a faulty reading of Eusebius’ quotations of this text. The shorter reading has also been accepted, on other grounds, by a few other scholars. For discussion (and refutation of the conjecture that removes this baptismal formula), see B. J. Hubbard, The Matthean Redaction of a Primitive Apostolic Commissioning (SBLDS 19), 163-64, 167-75; and Jane Schaberg, The Father, the Son, and the Holy Spirit (SBLDS 61), 27-29.
La Bible de Jerusalem (2003), in its footnote c appended to the "trinitarian baptismal formula (see at p. 1730, @ archive.org) says:
c) Il est possible que cette formule se ressente, dans sa précision, de l'usage liturgique établi plus tard dans la communauté primitive. On sait que le Actes parlent de baptizer «au nom de Jésus». cf. Ac 1 5+, 2 38+. Plus tard on aura explicité le rattachement du baptisme aux trois personnes de la Trinité. Quoi qu'il en soit de ces variations possibles, la realité profonde reste la même. Le baptême rattaché a la personne de Jésus Sauveur; or tout son oeuvre de salut procède de l'amour du Père et s'achève dans l'effusion de l'Esprit.
(It is possible that this formula resonates, in its precision, with the liturgical usage established later in the primitive community. We know that Acts speak of baptizing "in the name of Jesus". cp. Acts 1 5+, 2 38+. Later the connection of baptism to the three persons of the Trinity would have been made explicit. Regardless of these possible variations, the underlying reality remains the same. Baptism associated with the person of Jesus the Savior; now all his work of salvation proceeds from the love of the Father and ends in the outpouring of the Spirit.)
Who came first? Matthew 28:19 or Didache 7:2? Did one use the other as a source? Or is it possible that they both adopted the "trinitarian baptismal formula" from a third 1st century source?
P.S. I was asked whether this, Was the text of Matthew 28:19 changed?^ answers my Question?
^ I presume, The Question itself and the Answers given to it.
The answer is NO, especially after Hold To The Rod edited it ("Did one use the other as a source?")