Skip to content
Draft
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
2 changes: 1 addition & 1 deletion core/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default async function RootLayout({ params, children }: Props) {
const privacyPolicyUrl = rootData.data.site.settings?.privacy?.privacyPolicyUrl;

return (
<MakeswiftProvider siteVersion={siteVersion}>
<MakeswiftProvider locale={locale} siteVersion={siteVersion}>
<html className={clsx(fonts.map((f) => f.variable))} lang={locale}>
<head>
<SiteTheme />
Expand Down
2 changes: 0 additions & 2 deletions core/app/api/makeswift/[...makeswift]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const defaultVariants: Font['variants'] = [

const handler = MakeswiftApiHandler(process.env.MAKESWIFT_SITE_API_KEY, {
runtime,
apiOrigin: process.env.NEXT_PUBLIC_MAKESWIFT_API_ORIGIN ?? process.env.MAKESWIFT_API_ORIGIN,
appOrigin: process.env.NEXT_PUBLIC_MAKESWIFT_APP_ORIGIN ?? process.env.MAKESWIFT_APP_ORIGIN,
getFonts() {
return [
{
Expand Down
1 change: 0 additions & 1 deletion core/lib/makeswift/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ strict(process.env.MAKESWIFT_SITE_API_KEY, 'MAKESWIFT_SITE_API_KEY is required')

export const client = new Makeswift(process.env.MAKESWIFT_SITE_API_KEY, {
runtime,
apiOrigin: process.env.NEXT_PUBLIC_MAKESWIFT_API_ORIGIN ?? process.env.MAKESWIFT_API_ORIGIN,
});

export const getPageSnapshot = async ({ path, locale }: { path: string; locale: string }) =>
Expand Down
9 changes: 3 additions & 6 deletions core/lib/makeswift/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ import '~/lib/makeswift/components';

export function MakeswiftProvider({
children,
locale,
siteVersion,
}: {
children: React.ReactNode;
locale: string;
siteVersion: SiteVersion | null;
}) {
return (
<ReactRuntimeProvider
apiOrigin={process.env.NEXT_PUBLIC_MAKESWIFT_API_ORIGIN}
appOrigin={process.env.NEXT_PUBLIC_MAKESWIFT_APP_ORIGIN}
runtime={runtime}
siteVersion={siteVersion}
>
<ReactRuntimeProvider locale={locale} runtime={runtime} siteVersion={siteVersion}>
<RootStyleRegistry enableCssReset={false}>{children}</RootStyleRegistry>
</ReactRuntimeProvider>
);
Expand Down
4 changes: 4 additions & 0 deletions core/lib/makeswift/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fetch } from '@makeswift/runtime/next';
import { registerBoxComponent } from '@makeswift/runtime/react/builtins/box';
import { registerDividerComponent } from '@makeswift/runtime/react/builtins/divider';
import { registerEmbedComponent } from '@makeswift/runtime/react/builtins/embed';
Expand All @@ -10,12 +11,15 @@ import { registerVideoComponent } from '@makeswift/runtime/react/builtins/video'
import { ReactRuntimeCore } from '@makeswift/runtime/react/core';

const runtime = new ReactRuntimeCore({
apiOrigin: process.env.NEXT_PUBLIC_MAKESWIFT_API_ORIGIN,
appOrigin: process.env.NEXT_PUBLIC_MAKESWIFT_APP_ORIGIN,
breakpoints: {
small: { width: 640, viewport: 390, label: 'Small' },
medium: { width: 768, viewport: 765, label: 'Medium' },
large: { width: 1024, viewport: 1000, label: 'Large' },
screen: { width: 1280, label: 'XL' },
},
fetch,
});

// Only register necessary built-in components. Omitted components are:
Expand Down
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@conform-to/react": "^1.6.1",
"@conform-to/zod": "^1.6.1",
"@icons-pack/react-simple-icons": "^11.2.0",
"@makeswift/runtime": "^0.26.0",
"@makeswift/runtime": "https://pkg.pr.new/makeswift/makeswift/@makeswift/runtime@1259",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to be changed to a released runtime version before we can merge this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think we need Next 16 + React 19 in order to merge a new runtime version as well. @matthewvolk is tackling this right now.

Copy link
Member

Choose a reason for hiding this comment

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

The new runtime version should still work with Next 15 + React 18. The runtime uses Suspense instead of Activity when it's on React 18.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chanceaclark Just to clarify, we don't have to upgrade to Next 16 + React 19 at the same time; Makeswift runtime still supports React 18 and older Next.js versions all the way down to 13.4, so we can tackle the Next 16/React 19 upgrade to get the <Activity> performance improvements independently of upgrading Makeswift runtime to pull in other features/bug fixes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting 🤔 I've been going with the assumption that it's hand-in-hand, specifically to fix that performance issue with <Activity />. TIL that we should be good then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, we need runtime@0.26.3+, Next 16, and React 19 to get the <Activity /> performance improvements, but otherwise, these are not coupled. If we want to, we can upgrade to runtime@0.26.3 right now without forcing the Next 16 / React 19 upgrade.

"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.208.0",
"@opentelemetry/instrumentation": "^0.208.0",
Expand Down
74 changes: 37 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading