perf(movimento): vitrine e 3D mais leves, WebGL por software lembrado na sessão e suporte ao WebKit

This commit is contained in:
Evandro Fonseca Junior committed 2026-10-14 22:54:27 -03:00
1 parent 9fd1570426
commit 8903f3c57e
28 files changed
+854 -406

No files matched your search

@@ -15,12 +15,17 @@ jest.mock("next/link", () => ({
__esModule: true,
default: ({
children,
prefetch: _prefetch,
prefetch,
...props
}: { children?: React.ReactNode; prefetch?: unknown } & Record<
string,
unknown
>) => <a {...props}>{children}</a>,
>) => (
// o que o Link recebeu em `prefetch` aparece no atributo: false = nunca pré-carrega, null = o padrão do Next
<a data-prefetch={String(prefetch)} {...props}>
{children}
</a>
),
}));
const base = buildShowcaseItems(getFeaturedProjects(null)).find(
@@ -73,6 +78,30 @@ describe("ProjectActions sem grouped (a lista)", () => {
expect(container.querySelector("[tabindex]")).toBeNull();
});
it.each([
["without grouped", false],
["grouped (the pinned reel)", true],
])(
"path: 'Ver case' %s -> prefetches only when the visitor arrives at it (hover, focus or touch)",
(_name, grouped) => {
render(
<ProjectActions
item={withSite}
onExpand={jest.fn()}
grouped={grouped}
/>,
);
const anchor = link(/Ver case/);
// um por projeto, e na lista todos à vista: nenhum pedido de pré-carregamento na abertura da página
expect(anchor).toHaveAttribute("data-prefetch", "false");
fireEvent.mouseEnter(anchor);
expect(anchor).toHaveAttribute("data-prefetch", "null");
},
);
it("path: no onExpand (before the page mounts) and no site -> only 'Ver case'", () => {
render(<ProjectActions item={withoutSite} />);