[@hotwired/turbo] Add missing types, update for 8.0.23#74439
Conversation
|
@myabc Thank you for submitting this PR! This is a live comment that I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 74439,
"author": "myabc",
"headCommitOid": "6bcb9b9b84b62c11541a91e6561d6e729c688dd8",
"mergeBaseOid": "66d4b7d2fced2e4451c633615cdeef79e3ef2525",
"lastPushDate": "2026-01-31T23:20:00.000Z",
"lastActivityDate": "2026-02-03T08:35:08.000Z",
"mergeOfferDate": "2026-02-03T08:33:39.000Z",
"mergeRequestDate": "2026-02-03T08:35:08.000Z",
"mergeRequestUser": "myabc",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "hotwired__turbo",
"kind": "edit",
"files": [
{
"path": "types/hotwired__turbo/hotwired__turbo-tests.ts",
"kind": "test"
},
{
"path": "types/hotwired__turbo/index.d.ts",
"kind": "definition"
}
],
"owners": [
"G-Rath",
"lukeify",
"myabc"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "G-Rath",
"date": "2026-02-03T00:19:30.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 3829572796,
"ciResult": "pass"
} |
|
🔔 @G-Rath @lukeify — please review this PR in the next few days. Be sure to explicitly select |
Error TypeErrorDangerfile |
There was a problem hiding this comment.
Pull request overview
This pull request enhances the type definitions for the @hotwired/turbo library by adding comprehensive typings for configuration, navigation, caching, and browser adapter functionality.
Changes:
- Added new interfaces for BrowserAdapter, Navigator, Cache, DriveConfig, FormsConfig, and TurboConfig
- Exposed additional exports including
start(),navigator,cache,config, andsession - Added
templateElementandtemplateContentproperties to StreamElement - Added
adapterproperty to TurboSession - Added deprecation notices for
setProgressBarDelayandsetConfirmMethod - Added comprehensive test coverage for new functionality
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| types/hotwired__turbo/index.d.ts | Added 6 new interfaces (BrowserAdapter, Navigator, Cache, DriveConfig, FormsConfig, TurboConfig), 2 new StreamElement properties, 1 new TurboSession property, and 4 new top-level exports with deprecation notices for legacy methods |
| types/hotwired__turbo/hotwired__turbo-tests.ts | Added comprehensive tests for all new exports, properties, and configuration options including type assertions and read-only verifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@G-Rath Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
@G-Rath Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
@G-Rath Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
@G-Rath Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
Add new APIs and types introduced in Turbo 8.0.21: - StreamElement: add static renderElement(), removeDuplicateTargetSiblings() - StreamSourceElement: new custom element class - FormsConfig: add submitter property with SubmitterConfig interface - New functions: registerAdapter, setFormMode (deprecated), morphElements, morphChildren, morphBodyElements, morphTurboFrameElements - MorphOptions interface for morph function configuration - New morph events: turbo:morph, turbo:before-morph-element, turbo:morph-element, turbo:before-morph-attribute, turbo:before-frame-morph - TurboGlobal: add StreamActions, stream functions, and morph functions - TurboElementTagNameMap: add turbo-stream-source element Tested against OpenProject frontend with Turbo 8.0.23. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix comment: confirm method defaults to (not replaces) window.confirm - Add tests for config.drive.enabled assignment - Add tests for config.drive.unvisitableExtensions Set modification - Add test for config.forms.confirm assignment Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ba96c85 to
6bcb9b9
Compare
|
🛂 Hi @myabc, I can't accept a pull request until all of the checks in the "Status" section of this comment are green. I will let you know once that happens. Thanks, and happy typing! |
|
Ready to merge |
Patch release includes multiple type fixes. See DefinitelyTyped/DefinitelyTyped#74439
… update for 8.0.23 by @myabc Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Patch release includes multiple type fixes. See DefinitelyTyped/DefinitelyTyped#74439
Patch release includes multiple type fixes. See DefinitelyTyped/DefinitelyTyped#74439
Patch release includes multiple type fixes. See DefinitelyTyped/DefinitelyTyped#74439
Patch release includes multiple type fixes. See DefinitelyTyped/DefinitelyTyped#74439
Patch release includes multiple type fixes and improvements. See related upstream Pull Requests: - DefinitelyTyped/DefinitelyTyped#74439 - DefinitelyTyped/DefinitelyTyped#74614 - DefinitelyTyped/DefinitelyTyped#74615 - DefinitelyTyped/DefinitelyTyped#74616
Patch release includes multiple type fixes and improvements. See related upstream Pull Requests: - DefinitelyTyped/DefinitelyTyped#74439 - DefinitelyTyped/DefinitelyTyped#74614 - DefinitelyTyped/DefinitelyTyped#74615 - DefinitelyTyped/DefinitelyTyped#74616
Patch release includes multiple type fixes and improvements. See related upstream Pull Requests: - DefinitelyTyped/DefinitelyTyped#74439 - DefinitelyTyped/DefinitelyTyped#74614 - DefinitelyTyped/DefinitelyTyped#74615 - DefinitelyTyped/DefinitelyTyped#74616
Patch release includes multiple type fixes and improvements. See related upstream Pull Requests: - DefinitelyTyped/DefinitelyTyped#74439 - DefinitelyTyped/DefinitelyTyped#74614 - DefinitelyTyped/DefinitelyTyped#74615 - DefinitelyTyped/DefinitelyTyped#74616 - DefinitelyTyped/DefinitelyTyped#75046
Patch release includes multiple type fixes and improvements. See related upstream Pull Requests: - DefinitelyTyped/DefinitelyTyped#74439 - DefinitelyTyped/DefinitelyTyped#74614 - DefinitelyTyped/DefinitelyTyped#74615 - DefinitelyTyped/DefinitelyTyped#74616 - DefinitelyTyped/DefinitelyTyped#75046
Patch release includes multiple type fixes and improvements. See related upstream Pull Requests: - DefinitelyTyped/DefinitelyTyped#74439 - DefinitelyTyped/DefinitelyTyped#74614 - DefinitelyTyped/DefinitelyTyped#74615 - DefinitelyTyped/DefinitelyTyped#74616 - DefinitelyTyped/DefinitelyTyped#75046
Patch release includes multiple type fixes and improvements. See related upstream Pull Requests: - DefinitelyTyped/DefinitelyTyped#74439 - DefinitelyTyped/DefinitelyTyped#74614 - DefinitelyTyped/DefinitelyTyped#74615 - DefinitelyTyped/DefinitelyTyped#74616 - DefinitelyTyped/DefinitelyTyped#75046
StreamMessage and BrowserAdapter were declared as exported classes, but @hotwired/turbo does not export either at runtime (neither appears in the dist export surface), so value imports compiled but resolved to undefined. Introduced in DefinitelyTyped#74439. Convert both to interfaces: StreamMessage keeps its instance shape (fragment) for renderStreamMessage(); BrowserAdapter now extends Adapter, keeping progressBar and the members it makes non-optional. Tests assert both names are no longer usable as values. Fixes DefinitelyTyped#75207
Please fill in this template.
pnpm test <package to test>.If changing an existing definition:
Turbo.configobject, added in Turbo 8.0.6. Adds deprecation warnings accordingly.If this PR brings the type definitions up to date with a new version of the JS library, update the version number in theUnfortunately, Turbo doesn't seem to use semantic versioning, introducing breaking API changes in patch versions.package.jsonThis pull request expands the test coverage for the Turbo TypeScript types, ensuring that more of the public API is exercised and type-checked. The changes include importing additional Turbo modules, adding tests for various Turbo features and configuration options, and verifying correct type inference and error handling.
Expanded Turbo API coverage:
cache,config,connectStreamSource,disconnectStreamSource,navigator,renderStreamMessage,session,start,StreamMessage, andStreamSourcetohotwired__turbo-tests.ts.start(),session.adaptermethods,navigator.submitForm, andcachemethods to verify correct usage and type inference.config.driveandconfig.forms, including assignments, type checks, and error scenarios for configuration options.Stream handling and message rendering:
StreamElement.templateElementandtemplateContentproperties.