Does anyone know the origin of the name "dear-joy" (used, often perjoratively, by English people to denominate the Irish in the 18th century)?

Definitions of the Irish expression “Dear-Joy” are quite rare, the following sources refer to an obsolete expression but don’t give details about its origin:

Dear joy n. (also dear honey) from Green's Dictionary of Slang:

[SE dear joy! a supposedly favourite Irish expression] [late 17C–early 19C] an Irishman.

and

The The Routledge Dictionary of Historical Slang by Eric Partridge compares the expression with a similar one “dear knows”.

Dear Joy . An Irishman: coll: late C.17–20; ob. Ex a favourite Irish exclamation. cf. dear knows!: C.19–20: coll:

Northern Ireland and English provinces: abbr. the dear Lord knows! cf. quotations in Thornton.

It appears the expression has a jocular origin, probably made popular in London where “dear-joy” was used on stages to refer to Irish characters:

From Eighteenth Century Life:

This essay analyzes the Irish jokes that circulated in London in the 1680s, paying particular attention to those that emanated from the stage and from the two earliest Irish joke books, Bog Witticisms; or, Dear Joy’s Common-Places (1682) and Teagueland Jests, or Bogg-Witticisms (1690). Like ethnic jokes in general, these Irish jokes sought to stereotype and ridicule the population that they depicted, in this case, the London-Irish.

and as suggested by the following source,

“Dear-Joy” was a form of address associated with the Irish characters on the London Stage.

(Twas Only an Irishman's Dream: The Image of Ireland and the Irish in American Popular Song Lyrics)


Francis Grose, A Classical Dictionary of the Vulgar Tongue (1795) has this entry for the plural form of the term:

DEAR JOYS, Irish men, from their frequently making use of that expression.

Earlier instances of the slang term (without explanation of its origin) appear in A New Canting Dictionary (1725):

DEAR Joyes, Irishmen.

and in that book's predecessor, A New Dictionary of the Terms Ancient and Modern of the Canting Crew (1699):

Dear Joies, Irishmen.

As user159691's answer indicates, the slang sense of the term goes back to at least to the 1680s. In fact, "dear joys" occurs at least 10 times and "dear joy" several dozen times in the anonymous book, Teagueland Jests, or Bogg-Witticisms: In Two Parts: THE FIRST, Being a compleat Collection of the most Learned Bulls, Elaborate Quibbles, and Wise Sayings of some of the Natives of Teagueland, till the Year 1688. THE SECOND, Contains many Comical Stories, and Famous Blunders of those Dear Joys, since the late King James's landing amongst them (1690)—the vast majority of those occurrences being from Part One of the book and thus from 1688 or earlier. Here is a typical anecdote from this remarkably mean-spirited book:

A Dear Joy, that had the Reputation of a great Scholar among his Countrymen, because he could write and read ; passing the Streets of the City, hapened to read upon a Sign, Here are Horse to be Let, 1688. Now, bee Shaint Pautrick, I will be hanged (said he) but dere ish more Horshes in dish Town, dan ish in all de World beshides ; for dere ish almosht Two thoushand in dish Houshe, and how many musht dere be in all de Shitty, by dat Rule?

As user159691's answer notes, a periodical called Eighteenth Century Life provides an abstract of a 2015 journal article by Helen Burke titled "The Irish Joke, Migrant Networks, and the London Irish in the 1680s," which mentions a jokebook called Bog Witticisms; or, Dear Joy's Common-Places that it says was published in 1682, making it six years earlier than the earliest of the print sources I've been able find through Google Books searches. Other search matches put this book's publication date at ca. 1690 and 1694—but these may refer to later editions of a text that was indeed originally published in 1682.

Another fairly early Google Books match for "dear joys" is from Thomas Brown, Mr. Bays and His Religion (1688–1690) (1690) [combined snippets]:

Crites. Under favour Mr. Bays, how durst you hazard your self among any of that Nation, since you had put so gross an affront upon them, in a certain Oxford Prologue?

{First part of the Miscell.} Rogues, that like Cain, are handed with Disgrace,/ And wear the Country Stamp'd upon their Face.

Truly Sir, if I had said half so much of the Dear Joys as this amounts to, I should have been as loath to have trusted my self in Irish Company, as; I should be now to trust my only Bottle of Usquebah with an Irish Servant.

There are also two mentions of Dear-Joys in "The Irishmen's Prayers to St. Patrick, to make their peace with K. William and Q. Mary" (1689), reprinted in Verse in English from Eighteenth-century Ireland (1998):

Dat plash [place—namely, Londonderry] our army most sadly destroys/ Because all dats in it are Protestant boys;/ Der Canons against us do make such a noise,/ Dat dey kill all de French, and our Ierish Dear-joys.

And from another ballad of the same period, reprinted in The Pepys Ballads: 1689-1691. Nos. 254-341 [combined snippets]:

Adieu my sweet Lady of Royal Renown,/ I being resolv'd to pull Popery down;/ It is not a time any longer to stay,/ The Season's advanced, and I must away,/ To head a vast Army of Protestant boys,/ Who fears not the French nor the Tory Dear-Joys.

Nevertheless, even in the midst of the early vogue of the expression "dear joys" in its slang sense, the phrase continued to be used by non-Irish speakers in a literal sense, as we see in this instance from William Mountfort, Greenwich Park: A Comedy (1691):

Young Reveller. The Devil take me, if I know I did ; I fanci'd several for her, but as I hope to be reconcil'd to you, I did not to my knowledge see her ; and to make you amends, I won't see her this Week.

Dorinda. You'd sooner hang your self.

Young Reveller. Nay, if you won't believe ——

Dorinda. I have believ'd too much, and you have promis'd more than you can keep.

Young Reveller. By the dear Joys possess'd, I will be faithful.

Dorinda. And will you not marry Florelle?

Young Reveler. Buy Trouble so dear when I can have Pleasure so cheap.


Conclusion

Dictionaries seem confident that the slang term dear joys as a disparaging term for Irish people originated in reference to widespread use among Irish people during the late 1600s of "dear joy" in a literal sense. The slang meaning of the term became widely known and used during the 1680s, although it continued to appear in its literal sense as well. That much older literal sense appears, for example, in Beaumont & Fletcher's The Maid's Tragedy (1619):

Evadne. All the dear joyes here, and above hereafter/ Crown thy fair soul : thus I take leave of my Lord,/ And never shall you see the foul Evadne/ Till sh'ave try'd all honoured means that may/ Set her in rest, and wash her stains away.

The close linking of "dear joys" with venomous depictions of Irish people shows how even the most superficially neutral or even positive phrase can be made pejorative through malicious usage.