-
Notifications
You must be signed in to change notification settings - Fork 30.6k
[@hotwired/turbo] Add missing types, update for 8.0.23 #74439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[@hotwired/turbo] Add missing types, update for 8.0.23 #74439
Conversation
Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
@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
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": 74439,
"author": "myabc",
"headCommitOid": "ba96c855b542ce5fa44d377a2bed7809d43ad53e",
"mergeBaseOid": "a6d66513a05f41189f993c63eefbf6326b5640a3",
"lastPushDate": "2026-01-31T23:20:00.000Z",
"lastActivityDate": "2026-02-02T02:43:46.000Z",
"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": "stale",
"reviewer": "G-Rath",
"date": "2026-02-01T00:57:22.000Z",
"abbrOid": "2117629"
}
],
"mainBotCommentID": 3829572796,
"ciResult": "unknown"
} |
|
🔔 @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 <[email protected]>
G-Rath
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
|
@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? |
- 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 <[email protected]>
|
@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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@G-Rath I've pushed an additional commit that adds typings for |
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.