Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: further reduce docs bundle size (#19927)

Kevin Grüneberg39092399618b
diff --git a/apps/docs/components/Frameworks.tsx b/apps/docs/components/Frameworks.tsx
deleted file mode 100644
index 11747b2477b..00000000000
--- a/apps/docs/components/Frameworks.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import ButtonCard from './ButtonCard'
-import { useTheme } from 'next-themes'
-
-const Frameworks = () => {
- const { resolvedTheme } = useTheme()
-
- const frameworks = [
- {
- name: 'Angular',
- logo: {
- light: '/docs/img/icons/angular-icon.svg',
- dark: '/docs/img/icons/angular-icon.svg',
- },
- href: '/guides/with-angular',
- },
- {
- name: 'Expo React Native',
- logo: {
- light: '/docs/img/icons/expo-icon-light.svg',
- dark: '/docs/img/icons/expo-icon.svg',
- },
- href: '/guides/with-expo-react-native',
- },
- {
- name: 'Flutter',
- logo: {
- light: '/docs/img/icons/flutter-icon.svg',
- dark: '/docs/img/icons/flutter-icon.svg',
- },
- href: '/guides/with-flutter',
- },
- {
- name: 'JavaScript',
- logo: {
- light: '/docs/img/icons/javascript-icon.svg',
- dark: '/docs/img/icons/javascript-icon.svg',
- },
- href: '/reference/javascript/installing#javascript',
- },
- {
- name: 'Kotlin',
- logo: {
- light: '/docs/img/icons/kotlin-icon.svg',
- dark: '/docs/img/icons/kotlin-icon.svg',
- },
- href: '/guides/with-kotlin',
- },
- {
- name: 'Next.js',
- logo: {
- light: '/docs/img/icons/nextjs-icon-light.svg',
- dark: '/docs/img/icons/nextjs-icon.svg',
- },
- href: '/guides/with-nextjs',
- },
- {
- name: 'React',
- logo: {
- light: '/docs/img/icons/react-icon.svg',
- dark: '/docs/img/icons/react-icon.svg',
- },
- href: '/guides/with-react',
- },
- {
- name: 'RedwoodJS',
- logo: {
- light: '/docs/img/icons/redwoodjs-icon.svg',
- dark: '/docs/img/icons/redwoodjs-icon.svg',
- },
- href: '/guides/with-redwoodjs',
- },
- {
- name: 'SolidJS',
- logo: {
- light: '/docs/img/icons/solidjs-icon.svg',
- dark: '/docs/img/icons/solidjs-icon.svg',
- },
- href: '/guides/with-solidjs',
- },
- {
- name: 'Svelte',
- logo: {
- light: '/docs/img/icons/svelte-icon.svg',
- dark: '/docs/img/icons/svelte-icon.svg',
- },
- href: '/guides/with-svelte',
- },
- {
- name: 'Vue',
- logo: {
- light: '/docs/img/icons/vuejs-icon.svg',
- dark: '/docs/img/icons/vuejs-icon.svg',
- },
- href: '/guides/with-vue-3',
- },
- {
- name: 'refine',
- logo: {
- light: '/docs/img/icons/refine-icon.svg',
- dark: '/docs/img/icons/refine-icon.svg',
- },
- href: '/guides/getting-started/tutorials/with-refine',
- },
- ]
- return (
- <div className="grid md:grid-cols-12 gap-4 not-prose">
- {frameworks.map((x) => (
- <div key={x.name} className="col-span-3">
- <ButtonCard
- layout="horizontal"
- to={x.href}
- title={x.name}
- icon={resolvedTheme?.includes('dark') ? x.logo.dark : x.logo.light}
- />
- </div>
- ))}
- </div>
- )
-}
-
-export default Frameworks
diff --git a/apps/docs/components/FunctionsExamples.tsx b/apps/docs/components/FunctionsExamples.tsx
deleted file mode 100644
index d9326121c34..00000000000
--- a/apps/docs/components/FunctionsExamples.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import ButtonCard from 'components/ButtonCard'
-
-const examples = [
- {
- name: 'With supabase-js',
- description: 'Use the Supabase client inside your Edge Function.',
- href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts',
- },
- {
- name: 'Type-Safe SQL with Kysely',
- description:
- 'Combining Kysely with Deno Postgres gives you a convenient developer experience for interacting directly with your Postgres database.',
- href: '/guides/functions/kysely-postgres',
- },
- {
- name: 'With CORS headers',
- description: 'Send CORS headers for invoking from the browser.',
- href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/browser-with-cors/index.ts',
- },
- {
- name: 'React Native with Stripe',
- description: 'Full example for using Supabase and Stripe, with Expo.',
- href: 'https://github.com/supabase-community/expo-stripe-payments-with-supabase-functions',
- },
- {
- name: 'Flutter with Stripe',
- description: 'Full example for using Supabase and Stripe, with Flutter.',
- href: 'https://github.com/supabase-community/flutter-stripe-payments-with-supabase-functions',
- },
- {
- name: 'Building a RESTful Service API',
- description:
- 'Learn how to use HTTP methods and paths to build a RESTful service for managing tasks.',
- href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/restful-tasks/index.ts',
- },
- {
- name: 'Working with Supabase Storage',
- description: 'An example on reading a file from Supabase Storage.',
- href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/read-storage/index.ts',
- },
- {
- name: 'Open Graph Image Generation',
- description: 'Generate Open Graph images with Deno and Supabase Edge Functions.',
- href: '/guides/functions/examples/og-image',
- },
- {
- name: 'OG Image Generation & Storage CDN Caching',
- description: 'Cache generated images with Supabase Storage CDN.',
- href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/og-image-with-storage-cdn',
- },
- {
- name: 'Get User Location',
- description: `Get user location data from user's IP address.`,
- href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/location',
- },
-]
-
-const FunctionsExamples = () => {
- return (
- <div className="grid md:grid-cols-12 gap-4">
- {examples.map((x) => (
- <div className="col-span-6">
- <ButtonCard to={x.href} title={x.name} description={x.description} />
- </div>
- ))}
- </div>
- )
-}
-
-export default FunctionsExamples
diff --git a/apps/docs/components/index.tsx b/apps/docs/components/index.tsx
index 567eb983fb9..05dbf458a23 100644
--- a/apps/docs/components/index.tsx
+++ b/apps/docs/components/index.tsx
@@ -4,12 +4,6 @@ import StepHikeCompact from '~/components/StepHikeCompact'
// Common components
import ButtonCard from './ButtonCard'
-// Page specific components
-import AuthProviders from './AuthProviders'
-import Extensions from './Extensions'
-import Frameworks from './Frameworks'
-import FunctionsExamples from './FunctionsExamples'
-
// Other components
import RefSubLayout from '~/layouts/ref/RefSubLayout'
import { Heading } from './CustomHTMLElements'
@@ -19,7 +13,6 @@ import QuickstartIntro from './MDX/quickstart_intro.mdx'
import SocialProviderSettingsSupabase from './MDX/social_provider_settings_supabase.mdx'
import SocialProviderSetup from './MDX/social_provider_setup.mdx'
import StorageManagement from './MDX/storage_management.mdx'
-import KotlinProjectSetup from './MDX/kotlin_project_setup.mdx'
import MigrationWarnings from './MDX/migration_warnings.mdx'
import { CH } from '@code-hike/mdx/components'
import RefHeaderSection from './reference/RefHeaderSection'
@@ -63,19 +56,14 @@ const components = {
CodeBlock,
GlassPanel,
Link,
- Frameworks,
- AuthProviders,
- FunctionsExamples,
QuickstartIntro,
DatabaseSetup,
ProjectSetup,
- KotlinProjectSetup,
MigrationWarnings,
SocialProviderSetup,
SocialProviderSettingsSupabase,
StepHikeCompact,
StorageManagement,
- Extensions,
Alert: (props: any) => (
<Alert {...props} className="not-prose">
{props.children}
diff --git a/apps/docs/pages/guides/auth.mdx b/apps/docs/pages/guides/auth.mdx
index 3f67d440365..151941810df 100644
--- a/apps/docs/pages/guides/auth.mdx
+++ b/apps/docs/pages/guides/auth.mdx
@@ -1,6 +1,5 @@
import Layout from '~/layouts/DefaultGuideLayout'
-
-import { useRouter } from 'next/router'
+import AuthProviders from '~/components/AuthProviders'
export const meta = {
id: 'auth',
diff --git a/apps/docs/pages/guides/database/extensions.mdx b/apps/docs/pages/guides/database/extensions.mdx
index ff16218d2df..d89058b02db 100644
--- a/apps/docs/pages/guides/database/extensions.mdx
+++ b/apps/docs/pages/guides/database/extensions.mdx
@@ -1,4 +1,5 @@
import Layout from '~/layouts/DefaultGuideLayout'
+import Extensions from '~/components/Extensions'
export const meta = {
id: 'extensions',
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-kotlin.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-kotlin.mdx
index a3260bc2bb3..9885de8eed0 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-kotlin.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-kotlin.mdx
@@ -1,4 +1,5 @@
import Layout from '~/layouts/DefaultGuideLayout'
+import KotlinProjectSetup from '~/components/MDX/kotlin_project_setup.mdx'
export const meta = {
title: 'Build a Product Management Android App with Jetpack Compose',