Skip to content

[idiomorph] Add initial type definitions#75209

Open
myabc wants to merge 1 commit into
DefinitelyTyped:masterfrom
myabc:feature/idiomorph
Open

[idiomorph] Add initial type definitions#75209
myabc wants to merge 1 commit into
DefinitelyTyped:masterfrom
myabc:feature/idiomorph

Conversation

@myabc

@myabc myabc commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change.
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run pnpm test <package to test>.
  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

These type definitions would become obsolete if bigskysoftware/idiomorph#153 is merged.

Copilot AI review requested due to automatic review settings July 4, 2026 19:52
@typescript-automation

typescript-automation Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

@myabc Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

This 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

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Only a DT maintainer can approve changes when there are new packages added

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"
}

@typescript-automation typescript-automation Bot added the New Definition This PR creates a new definition package. label Jul 4, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

🔔 @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...)

@typescript-automation typescript-automation Bot moved this to Waiting for Code Reviews in Pull Request Status Board Jul 4, 2026
@myabc

myabc commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@G-Rath would you consider reviewing this?

@myabc myabc changed the title Add initial typings for Idiomorph [idiomorph] Add initial type definitions Jul 4, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Action in Pull Request Status Board Jul 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts typings for Idiomorph.morph, configuration options, and callback hooks.
  • Adds an idiomorph/htmx subpath declaration and corresponding test import.
  • Adds standard DT scaffolding (package.json, tsconfig.json, .npmignore) and idiomorph-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.

Comment thread types/idiomorph/idiomorph-tests.ts
Comment thread types/idiomorph/package.json
@typescript-automation typescript-automation Bot moved this from Needs Maintainer Action to Waiting for Code Reviews in Pull Request Status Board Jul 4, 2026
@myabc myabc force-pushed the feature/idiomorph branch from 9e56639 to 072defd Compare July 4, 2026 20:06
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Action in Pull Request Status Board Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Definition This PR creates a new definition package.

Projects

Status: Needs Maintainer Action

Development

Successfully merging this pull request may close these issues.

2 participants