Skip to content
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

Certain modifier tags no longer included in json output since v0.25 #2802

Closed
ben-polinsky opened this issue Dec 5, 2024 · 4 comments
Closed
Labels
bug Functionality does not match expectation

Comments

@ben-polinsky
Copy link

ben-polinsky commented Dec 5, 2024

Expected Behavior

@alpha tags (tested @beta and @experimental tags with the same result) used to document types should be available in the modifierTags array of the corresponding node in json output produced by TypeDoc.

Actual Behavior

Since version 0.25, the above behavior is no longer the case.

Steps to reproduce the bug

Consider the following:

/**
 * No issues here, correctly has `@alpha` in modifierTags
 * (behavior is the same with beta or experimental tags)
 * @alpha
 */
export type AlphaOk = number | string;

/**
 * Now, no `@alpha`
 * (behavior is the same with beta or experimental tags)
 * @alpha
 */
export type AlphaNoGo = (arg: number | string) => void;

Will produce the following output in versions <0.26:
stackblitz link run npm run docs

	"id": 2,
	"name": "AlphaNoGo",
	"variant": "declaration",
	"kind": 2097152,
	"flags": {},
	"comment": {
		"summary": [
			{
				"kind": "text",
				"text": "Now, no "
			},
			{
				"kind": "code",
				"text": "`@alpha`"
			},
			{
				"kind": "text",
				"text": "\n(behavior is the same with beta or experimental tags)"
			}
		],
		"modifierTags": [
			"@alpha"
		]
	},

But the following output in versions >=0.26
stackblitz link run npm run docs

   "id": 2,
  "name": "AlphaNoGo",
  "variant": "declaration",
  "kind": 2097152,
  "flags": {},
  "comment": {
  "summary": [
	  {
		  "kind": "text",
		  "text": "Now, no "
	  },
	  {
		  "kind": "code",
		  "text": "`@alpha`"
	  },
	  {
		  "kind": "text",
		  "text": "\n(behavior is the same with beta or experimental tags)"
	  }
  ]
  },

Environment

  • Typedoc version: Tested failures with 0.26.0; 0.26.11; and 0.27.2
  • TypeScript version: various 5.x
  • Node.js version: 22; 20
  • OS: Mac; Ubuntu
@ben-polinsky ben-polinsky added the bug Functionality does not match expectation label Dec 5, 2024
@Gerrit0 Gerrit0 added the no bug This is expected behavior label Dec 6, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 6, 2024

Those tags are all modifier tags, so shouldn't appear in the blockTags array. They appear under the modifierTags property. https://typedoc.org/documents/Tags.html#modifier-tags

@ben-polinsky
Copy link
Author

Apologies. But the tags are nowhere - they aren't in any modifierTags property as you can see from my example and reproduction.

@ben-polinsky ben-polinsky changed the title Certain block tags no longer included in json output since v0.25 Certain modifier tags no longer included in json output since v0.25 Dec 6, 2024
@ben-polinsky
Copy link
Author

ben-polinsky commented Dec 6, 2024

The issue is with this commit which adds "cascading" modifierTags. If I remove the default modifierTags and specify an empty array in config, then all is well.

I have a workaround, but this does seem like a bug.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 6, 2024

Ah shoot, yes, this is a bug. Cascading tags shouldn't recurse into types, which is what's happening here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants