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

Migrate /agent to Next App Router [DO-NOT-MERGE] #67

Closed
wants to merge 4 commits into from

Conversation

Strajk
Copy link
Contributor

@Strajk Strajk commented Aug 9, 2023

Not ready for merging!
Draft to discuss the approach.
More info on Discord 👋

@Strajk
Copy link
Contributor Author

Strajk commented Aug 10, 2023

  • improved file naming
    • app/_lib/supabase.tsx -> app/_lib/SupabaseProvider.tsx
    • app/_lib/posthog.tsx -> app/_lib/PostHogProvider.tsx
  • switched order of providers: PostHogProvider > SupabaseProvider to SupabaseProvider > PostHogProvider, to have access to user in PostHogProvider
  • dynamic loading of UI components in agent/.../setup to avoid hydration errors, more info in code comments
  • reverted components/Layout, i opted to avoid changing unrelated components in this PR
  • collocated all tracking (Posthog, GA) to template.tsx, as recommended in Next.js docs
  • added export const dynamic = "force-dynamic" to routes using reading cookies
  • got rid of default exports in favour of named exports, for consistency
  • added encoding package as dev dep, as recommended here examples: export force-dynamic from all dynamic routes vercel/next.js#52916
  • ran next build to check for errors
  • checked console for posthog tracking events, seems allrighty

@Strajk
Copy link
Contributor Author

Strajk commented Aug 11, 2023

Screen 2023-08-11 at 22 37 27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants