[idiomorph] Add initial type definitions#75209
Conversation
|
@myabc Thank you for submitting this PR! This is a live comment that I will keep updated. 1 package in this PRCode ReviewsThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 75209,
"author": "myabc",
"headCommitOid": "072defd54343aaaf4f02ae67c10f8b09e81fea31",
"mergeBaseOid": "e2580e07bfb619bbaa80a31c6e9d0e2ec35fea22",
"lastPushDate": "2026-07-04T20:06:30.000Z",
"lastActivityDate": "2026-07-04T20:06:30.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"tooManyCommits": false,
"tooManyReviews": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "idiomorph",
"kind": "add",
"files": [
{
"path": "types/idiomorph/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/idiomorph/htmx.d.ts",
"kind": "definition"
},
{
"path": "types/idiomorph/idiomorph-tests.ts",
"kind": "test"
},
{
"path": "types/idiomorph/index.d.cts",
"kind": "definition"
},
{
"path": "types/idiomorph/index.d.ts",
"kind": "definition"
},
{
"path": "types/idiomorph/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/idiomorph/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [],
"addedOwners": [
"myabc"
],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [],
"mainBotCommentID": 4883627767,
"ciResult": "pass"
} |
|
🔔 @myabc — you're the only owner, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...) |
|
@G-Rath would you consider reviewing this? |
There was a problem hiding this comment.
Pull request overview
Adds a new @types/idiomorph package to DefinitelyTyped, providing initial TypeScript declarations for the Idiomorph DOM-morphing library (including an idiomorph/htmx entrypoint) plus dtslint tests.
Changes:
- Introduces
index.d.tstypings forIdiomorph.morph, configuration options, and callback hooks. - Adds an
idiomorph/htmxsubpath declaration and corresponding test import. - Adds standard DT scaffolding (
package.json,tsconfig.json,.npmignore) andidiomorph-tests.ts.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| types/idiomorph/tsconfig.json | Adds strict DT tsconfig for compiling the new typings and tests. |
| types/idiomorph/package.json | Defines the new @types/idiomorph package metadata and export map. |
| types/idiomorph/index.d.ts | Declares the public API surface for Idiomorph (config, callbacks, morph function, defaults). |
| types/idiomorph/idiomorph-tests.ts | Adds dtslint coverage for main and idiomorph/htmx entrypoints and key typing behaviors. |
| types/idiomorph/htmx.d.ts | Declares the idiomorph/htmx entrypoint types. |
| types/idiomorph/.npmignore | Ensures only declaration files are published. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Idiomorph is a small JavaScript library for DOM morphing — it updates the DOM to match a new HTML fragment while preserving element state (focus, input values, etc.) wherever possible, rather than blindly replacing nodes. It's commonly paired with htmx and Turbo/Hotwire for server-rendered UI updates without full page reloads.
pnpm test <package to test>..d.tsfiles generated via--declarationdts-gen --dt, not by basing it on an existing project.tsconfig.jsonshould havenoImplicitAny,noImplicitThis,strictNullChecks, andstrictFunctionTypesset totrue.These type definitions would become obsolete if bigskysoftware/idiomorph#153 is merged.