Skip to content

fix(website): link to external constructors #10869

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

Merged
merged 3 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions apps/website/src/components/ConstructorNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { VscSymbolMethod } from '@react-icons/all-files/vsc/VscSymbolMethod';
import { Code2, LinkIcon } from 'lucide-react';
import Link from 'next/link';
import { ENV } from '@/util/env';
import { Badges } from './Badges';
import { ExampleNode } from './ExampleNode';
import { ParameterNode } from './ParameterNode';
import { SeeNode } from './SeeNode';
Expand All @@ -20,11 +21,14 @@ export async function ConstructorNode({ node, version }: { readonly node: any; r
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group px-2 font-mono font-semibold break-all`}
id="constructor"
>
{/* constructor({parsedContent.constructor.parametersString}) */}
<Link className="float-left -ml-6 hidden pr-2 pb-2 group-hover:block" href="#constructor">
<LinkIcon aria-hidden size={16} />
</Link>
constructor({node.parameters?.length ? <ParameterNode node={node.parameters} version={version} /> : null})
<Badges node={node} />
<span>
{/* constructor({parsedContent.constructor.parametersString}) */}
<Link className="float-left -ml-6 hidden pr-2 pb-2 group-hover:block" href="#constructor">
<LinkIcon aria-hidden size={16} />
</Link>
constructor({node.parameters?.length ? <ParameterNode node={node.parameters} version={version} /> : null})
</span>
</h3>

<a
Expand Down
6 changes: 1 addition & 5 deletions packages/scripts/src/generateSplitDocumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,12 +690,8 @@ function itemParameters(item: ApiDocumentedItem & ApiParameterListMixin) {

function itemConstructor(item: ApiConstructor) {
return {
kind: item.kind,
name: item.displayName,
sourceURL: item.sourceLocation.fileUrl,
sourceLine: item.sourceLocation.fileLine,
...itemInfo(item),
parametersString: parametersString(item),
summary: item.tsdocComment ? itemTsDoc(item.tsdocComment, item) : null,
parameters: itemParameters(item),
};
}
Expand Down