Skip to content

Conversation

nikku
Copy link
Member

@nikku nikku commented Jun 13, 2025

Proposed Changes

Generates types with declaration maps, the recommended practice for library authors that ship source code.

Once generated, "Go to definition" (F12 in Sublime Text) will no longer jump to types, but to the actual source file:

capture 7xaQLT_optimized

Try out

  • git checkout generate-declaration-maps
  • npm run generate-types
  • Navigate within your IDE

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

Related to discussion

nikku added 2 commits June 13, 2025 12:53
Adjusted our use of @overlord to the new generation behavior (overloads are generated in definition order, not vice versa).

Relevant changelog entries:

* https://github.com/nikku/bio-dts/blob/main/CHANGELOG.md#0120
* https://github.com/nikku/bio-dts/blob/main/CHANGELOG.md#0130
Recommended practice for library authors (that ship source code with their modules, cf. microsoft/TypeScript#49003).
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Jun 13, 2025
@nikku nikku requested review from a team, Buckwich and jarekdanielak and removed request for a team June 13, 2025 11:31
Copy link
Contributor

@jarekdanielak jarekdanielak left a comment

Choose a reason for hiding this comment

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

I played with it a bit and it sometimes puts me in a wrong place in the file, which is still a lot better then being in the types file instead. Step in the right direction, I'm glad we're looking into developers' quality of life. 👍

Copy link
Member

@Buckwich Buckwich left a comment

Choose a reason for hiding this comment

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

At the moment the generated type maps have a worse quality than the heuristic Find source definition of TS server. I agree that it would be nice to ship at least something for users, but then we should make it opt-out for users that want better maps with the cost of worse performance. Alternative would be to adjust tooling to generate proper maps

@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review pending labels Jun 16, 2025
@Buckwich
Copy link
Member

Here are also some references:

  • JS/TS TSC Go to source definition: heuristically tries to find a source for a definition (slow)
  • JS/TS TSC declarationMap: defines where to find a source for a definition, if present it's the default for go to definition (relies on tooling to generate correct maps)
  • vscode "javascript.preferGoToSourceDefinition": true,: defaults to goto source, either heuristically or via declarationMap if available

@Buckwich
Copy link
Member

@jarekdanielak did you try this setting?

"javascript.preferGoToSourceDefinition": true,

@jarekdanielak
Copy link
Contributor

@Buckwich yeah, actually with that setting on I'm getting better results without the new types. 🤨

@nikku nikku added the backlog Queued in backlog label Jul 1, 2025 — with bpmn-io-tasks
@nikku nikku removed the in progress Currently worked on label Jul 1, 2025
@nikku
Copy link
Member Author

nikku commented Jul 1, 2025

This did not get consensus, I move it back to backlog.

@Buckwich
Copy link
Member

should we also mark this PR as draft?

@barmac barmac marked this pull request as draft July 22, 2025 11:43
@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed backlog Queued in backlog labels Jul 22, 2025
@barmac barmac added backlog Queued in backlog and removed in progress Currently worked on labels Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants