Skip to content

Migrate MDX documentation from Docusaurus raw-loader to Astro native imports#720

Merged
fgatti675 merged 2 commits intoastro_migrationfrom
copilot/update-mdx-docs-imports
Oct 24, 2025
Merged

Migrate MDX documentation from Docusaurus raw-loader to Astro native imports#720
fgatti675 merged 2 commits intoastro_migrationfrom
copilot/update-mdx-docs-imports

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

This PR migrates all MDX documentation files from Docusaurus-style webpack raw-loader syntax to Astro's native Vite-based import system.

Changes

Updated 44 MDX files across the documentation with three key transformations:

1. Import Statement Migration

Replaced Docusaurus CodeBlock component with Astro Starlight's native Code component:

- import CodeBlock from "@theme/CodeBlock";
+ import { Code } from '@astrojs/starlight/components';

2. Raw Loader Conversion

Converted webpack's raw-loader syntax to Vite's native raw import using the ?raw suffix:

- import MyComponentSource from "!!raw-loader!../../samples/samples_v3/nextjs.tsx";
+ import MyComponentSource from '../../samples/samples_v3/nextjs.tsx?raw';

3. Component Usage Update

Updated component syntax to match Astro Starlight's Code component API:

- <CodeBlock language="tsx">{MyComponentSource}</CodeBlock>
+ <Code code={MyComponentSource} lang="tsx" />

Files Modified

  • 37 component documentation files (/docs/components/*.mdx)
  • 4 recipe documentation files (/docs/recipes/*.mdx)
  • 1 custom view documentation (/docs/custom_top_level_views.mdx)
  • 1 pro documentation (/docs/pro/nextjs.mdx)
  • 1 properties documentation (/docs/properties/fields/selects.mdx)

Impact

This migration enables the documentation site to work with Astro's native import system, removing the dependency on webpack's raw-loader plugin. All code samples continue to display correctly with proper syntax highlighting using the Astro Starlight framework.

Verification

  • ✅ Zero remaining !!raw-loader! references in any MDX file
  • ✅ Zero remaining @theme/CodeBlock imports
  • ✅ All Code components use consistent syntax with proper language specification
  • ✅ All file paths preserved correctly with ?raw suffix
Original prompt

I need to update all the .mdx docs and replace the raw loader into the native astro way:

import CodeBlock from "@theme/CodeBlock"; import MyComponentSource from "!!raw-loader!../../samples/samples_v3/nextjs.tsx";

becomes:
import { Code } from '@astrojs/starlight/components'; import importedCode from '../../samples/samples_v3/nextjs.tsx?raw';

Check all mdx files under content/docs/docs

SUMMARY

TITLE: Migrate MDX Documentation from Docusaurus Raw Loader to Astro Native Import

USER INTENT: Update all .mdx documentation files to replace Docusaurus-style raw-loader imports with Astro's native raw import syntax.

TASK DESCRIPTION:

  • Scan all MDX files located under content/docs/docs/
  • Replace old Docusaurus import pattern: import MyComponentSource from "!!raw-loader!../../samples/samples_v3/nextjs.tsx"; with Astro pattern: import importedCode from '../../samples/samples_v3/nextjs.tsx?raw';
  • Replace import CodeBlock from "@theme/CodeBlock"; with import { Code } from '@astrojs/starlight/components';
  • Update all instances where <CodeBlock> component is used to use the new <Code> component with appropriate props

EXISTING:

  • MDX documentation files exist under content/docs/docs/ directory
  • Files currently use Docusaurus-style raw-loader syntax for importing code samples
  • Code samples are referenced from paths like ../../samples/samples_v3/nextjs.tsx

PENDING:

  • Identify all .mdx files in content/docs/docs/ that use the old raw-loader pattern
  • Replace import statements from !!raw-loader! pattern to ?raw pattern
  • Replace @theme/CodeBlock imports with @astrojs/starlight/components Code component
  • Update component usage from <CodeBlock> to <Code> with proper props mapping
  • Verify all file paths remain correct after migration
  • Test that code samples display correctly with new Astro components

CODE STATE:

Before (Docusaurus pattern):

import CodeBlock from "@theme/CodeBlock";
import MyComponentSource from "!!raw-loader!../../samples/samples_v3/nextjs.tsx";

After (Astro pattern):

import { Code } from '@astrojs/starlight/components';
import importedCode from '../../samples/samples_v3/nextjs.tsx?raw';

RELEVANT CODE/DOCUMENTATION SNIPPETS:

  • Target directory: content/docs/docs/
  • File extension: .mdx
  • Import pattern to find: from "!!raw-loader!
  • Import pattern to replace with: from '...[filepath]?raw'
  • Component to find: @theme/CodeBlock
  • Component to replace with: @astrojs/starlight/components with { Code }

OTHER NOTES:

  • This is a migration from Docusaurus to Astro documentation framework
  • The ?raw suffix is Vite's native way to import files as raw strings
  • Variable names may vary (e.g., MyComponentSource, importedCode) and should be preserved or adjusted as needed
  • Need to ensure proper quote style consistency (single vs double quotes)
  • Component prop mappings between <CodeBlock> and <Code> may need adjustment

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…imports

Co-authored-by: fgatti675 <5120271+fgatti675@users.noreply.github.com>
Copilot AI changed the title [WIP] Update MDX documentation to use Astro native imports Migrate MDX documentation from Docusaurus raw-loader to Astro native imports Oct 24, 2025
Copilot AI requested a review from fgatti675 October 24, 2025 13:14
@fgatti675 fgatti675 marked this pull request as ready for review October 24, 2025 13:19
@fgatti675 fgatti675 merged commit 063c77d into astro_migration Oct 24, 2025
fgatti675 added a commit that referenced this pull request Feb 16, 2026
* The home page has been successfully replicated in `website-astro/src/pages/index.astro`.

* Fixing some migration errors

* Removed missing docusaurus refs

* feat: Migrate Panel and related components to Astro

This commit migrates the React `Panel` component and all of its dependencies to Astro components. This is part of a larger effort to systematically migrate the website from React to Astro.

The following components were migrated:
- Panel
- ProFeaturesPanels
- ProDeveloperFeatures
- ProInfo
- ScreenshotsMarquee
- HeroPro
- AnimatedGradientBackground
- AppLink
- HeroProButtons
- PublicFacingApps
- BrowserFrame
- AgencyClientShowcase
- SharedResponsibilitySection
- DataSovereigntySection
- PrivacyComplianceSection
- TrustIndicatorsSection
- DeploymentModelsSection
- SecurityArchitectureSection
- CallToActionSection
- Translations
- TwoColumns
- DataEnhancementUseCases
- DataStructure
- AutofillFeature
- DataEnhancementHero
- VersionsToggle
- VersionsComparison
- Tip
- PricingQuote
- CLIInstructions
- EnterpriseFeatures
- PhoneFrame
- EnterpriseHero
- EnterpriseArchitectures
- AirTableLike
- History
- FeaturesCarousel
- DeveloperFeatures
- EasyToCustomize
- CustomFields
- OpenAITeaser
- UnbeatableUX

All pages using these components have been updated to use the new Astro versions, and the original React files have been deleted.

* feat: Migrate Panel and related components to Astro

This commit migrates the React `Panel` component and all of its dependencies to Astro components. This is part of a larger effort to systematically migrate the website from React to Astro.

The following components were migrated:
- Panel
- ProFeaturesPanels
- ProDeveloperFeatures
- ProInfo
- ScreenshotsMarquee
- HeroPro
- AnimatedGradientBackground
- AppLink
- HeroProButtons
- PublicFacingApps
- BrowserFrame
- AgencyClientShowcase
- SharedResponsibilitySection
- DataSovereigntySection
- PrivacyComplianceSection
- TrustIndicatorsSection
- DeploymentModelsSection
- SecurityArchitectureSection
- CallToActionSection
- Translations
- TwoColumns
- DataEnhancementUseCases
- DataStructure
- AutofillFeature
- DataEnhancementHero
- VersionsToggle
- VersionsComparison
- Tip
- PricingQuote
- CLIInstructions
- EnterpriseFeatures
- PhoneFrame
- EnterpriseHero
- EnterpriseArchitectures
- AirTableLike
- History
- FeaturesCarousel
- DeveloperFeatures
- EasyToCustomize
- CustomFields
- OpenAITeaser
- UnbeatableUX
- ManageYour
- AgencyLogos
- BuiltFor
- FeaturesPanels
- FeaturesTeaser
- FireCMSIntro
- HeroHome
- LaunchInSteps
- OpenSourceDetails
- ProTeaser
- StartupLogos
- TechSplash
- UITeaser
- Newsletter
- ThreeColumns

All pages using these components have been updated to use the new Astro versions, and the original React files have been deleted.

Note: The frontend verification step was skipped due to a persistent issue with the `cd` command, which prevented the development server from starting.

* More astro migration steps

* Pricing page WIP

* I have updated all the files in the `packages/ui` and `packages/user_management` directories from the provided list. I am now ready to proceed to the pre-commit checks.

I am now ready to proceed to the pre-commit checks.

I will now proceed with the pre-commit steps.

* I have updated all the files in the `packages/ui` and `packages/user_management` directories from the provided list. I am now ready to proceed to the pre-commit checks.

I am now ready to proceed to the pre-commit checks.

I will now proceed with the pre-commit steps.

I have updated all the files in all the subdirectories of the `packages` directory.

* Developer page WIP

* Multiple adaptations to the tailwind 4 retro fit

* Added temp v2 astro site

* Astro v2 styles

* Astro v2 updates

* Mltiple updates to the new index page

* Added editor new editor video

* Developers page update

* Developers page update

* Features page update

* Starlight integration

* Starlight customization

* Migrate MDX documentation from Docusaurus raw-loader to Astro native imports (#720)

* Initial plan

* Migrate MDX documentation from Docusaurus raw-loader to Astro native imports

Co-authored-by: fgatti675 <5120271+fgatti675@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: fgatti675 <5120271+fgatti675@users.noreply.github.com>

* Starlight customization

* Starlight layout update

* Add Tailwind v3/v4 dual opacity syntax for forward compatibility (#721)

* Initial plan

* Add Tailwind 3/4 opacity compatibility to all packages

Co-authored-by: fgatti675 <5120271+fgatti675@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: fgatti675 <5120271+fgatti675@users.noreply.github.com>

* Adding css transitions and much more

* Style fixes

* Fix for multiselect mount

* Fix code preview in astro

* Layout fixes

* Feature page updates

* Client logos updated

* Introducing separator

* Developers page updates

* Updated Header navigation

* Fix for client demo loading code

* Updating logos

* Removed astro v1 site

* Startup page updates

* Added cookie banner

* Changed grays to surface colors

* Added Ursula ❤️

* Cookie banner in docs

* Added blog

* Contact page improvements

* Added npm besides yarn commands everywhere

* Added back llms.txt

* Added redirects from previous structure

* Added API docs

* Some SEO optimizations

* Added ads campaign forward param passing

* Tweaking animations

* Fixed analytics

* GA fix

* nth attempt to fix GA4

* v3.0.0-tw4.0

* v3.0.0-tw4.1

* v3.0.0-tw4.2

* Missing website files

* Removed legacy astro site

* Add analytics tracking

* Add prettifyIdentifier function to format identifiers and improve readability

* Fix typos and enhance styling in release notes and blog post

* Update changelog and release notes for version 3.0.0 with new features, enhancements, and fixes

* Remove outdated marketing information from changelog and llms.txt

* v3.0.0-tw4.3

* Refactor MultiSelect component and update styles for better accessibility

* v3.0.0-tw4.4

* v3.0.0-tw4.5

* v3.0.0-tw4.6

* v3.0.0-tw4.7

* v3.0.0-tw4.5

* v3.0.0-tw4.6

* v3.0.0-tw4.7

* v3.0.0-tw4.8

* v3.0.0-tw4.9

* v3.0.0-tw4.10

* update gitHead references and enhance Popover and Select components with shadow DOM support

* Removing --fcms-primary

* TW 4 updates

* Add Tailwind CSS PostCSS plugin and update package configurations

* Add Tailwind CSS plugin to Vite configuration in cloud

* v3.0.0-tw4.11

* v3.0.0-tw4.12

* v3.0.0-tw4.13

* v3.0.0-tw4.14

* v3.0.0-tw4.15

* Update TailwindCSS to v4 docs

* v3.0.0-tw4.16

* v3.0.0-tw4.17

* Add PortalContainerContext for managing portal containers in components

* v3.0.0-tw4.18

* Integrate usePortalContainer in useInjectStyles for dynamic style injection

* Update CHANGELOG for version 3.0.0 with new features, improvements, and fixes

* Update documentation and improve SEO for FireCMS landing page

* Add includeBucketUrl and imageResize options for file uploads

* Add support for duplicating collections in the  collection editor plugin

* Add Media Manager plugin with asset management features

* Add card view support to EntityCollectionView and related components

* Refactor view mode icons in EntityCollectionViewActions for improved clarity and consistency

* New filter view

* feat(styles): integrate Tailwind CSS typography plugin and update Next.js dependencies

* feat: enhance collection inference with optional filter and sort parameters

* feat: add drag-and-drop column reordering to VirtualTable

* feat: implement drag-and-drop column reordering with persistence in EntityCollectionView

* feat: add updatePropertiesOrder method for column reordering in CollectionsConfigController

* fix: update package versions and remove unused button color prop

* fix: enhance ErrorTooltip styling and allow custom class names

* Removed legacy landing page

* feat: add sortable props for dnd-kit integration in table components

* feat: button color harmonization

* feat: add Google Cloud Partner badge and update index layout

* feat: improve smooth scrolling behavior and update link text in index

* Adding custom auth system

* Adding custom auth system

* feat: restyled Tab components

* feat: restyled Tab components

* feat: add Kanban view support

* refactor: clean up VirtualTable component structure and improve readability

* feat: refactor sortable cell implementation for VirtualTable

* feat: enhance CookieBanner to function as a full-screen blocking modal

* feat: add KanbanSetupAction component for configuring Kanban view

* feat: add order property support for Kanban view configuration

* feat: enhance BoardSortableList and EntityCollectionBoardView to handle empty states and improve data loading

* feat: add totalCount support to Board and related components for improved data handling

* feat: add totalCount support to Board and related components for improved data handling

* feat: enhance mergeDeep function to preserve class instances and improve object merging behavior

* fix: changing how objects are merged, possibly to fix entity references being deserialized incorrectly

* feat: add view mode toggle support and improve component structure in collection views

* feat: add ColorPicker and ViewModeToggle components for enhanced UI customization

* feat: add columnColors support to Board components for enhanced visual customization

* feat: add ToggleButtonGroup component and enhance view mode toggle functionality with size selection

* feat: enhance Kanban column order management and unify toolbar rendering across views

* feat: refactor view mode toggle to use ToggleButtonGroup for improved UI and dynamic options

* feat: implement optimistic updates for column counts during item movement between columns

* docs: add migration guide for upgrading from v3.0 to v3.1

* feat: implement optimistic updates for deleted entities in Kanban view

* feat: minor styling

* feat: minor styling

* feat: update initial view options and refactor Kanban configuration

* feat: fixes for user selects failing to persist the right value

* fix: date autovalues validation bug

* fix: Fixing text search Typesense integration

* feat: add collection parameter to Firestore delegate and improve Typesense search error handling

* fix: update Discord links and improve text search documentation

* feat: add JSON import functionality to CollectionEditorWelcomeView

* fix: prevent useEffect from overwriting local DnD state during navigation updates

* feat: enhance documentation with improved titles and descriptions for clarity

* feat: add markdown configuration options to enhance editor behavior and improve content handling

* fix: adjust layout and styling in FormEnhanceAction for improved usability

* feat: update titles and descriptions for improved clarity and consistency in documentation

* refactor: optimize rendering and styling in Kanban components for improved performance and consistency

* chore: Install project dependencies.

* feat: normalize enum values in properties for consistent handling and persistence

* feat: add typesense as a dependency and update peer dependencies in package-lock.json and vite.config.ts

* feat: add updateUserFields method for direct Firestore updates and improve user management functionality

* feat: replace AutorenewIcon with FindInPageIcon for improved UI consistency

* feat: Implement AI collection generation with a new API, UI components, and state management for modified paths.

* feat: Introduce AI icon and integrate AI-driven collection generation and data enhancement features.

* style: Refine styling, typography, and icon sizes in NavigationCard and SmallNavigationCard components.

* feat: Implement collapsible drawer navigation groups and refine collection entity counts in breadcrumbs.

* feat: add 'display' view to collection editor and refactor AI collection generation to use a generic callback.

* feat: Add file exclusion configurations for AI and development tools, and enhance skeleton image thumbnail rendering with a fill option.

* feat: Implement per-seat billing logic for cloud subscriptions, update ESLint rules, and remove deprecated subscription components.

* fix: Prevent displaying next payment for canceled subscriptions and apply consistent JSX tag spacing via ESLint configuration.

* Fix: prevent false duplicate ID error when editing properties and ignore the `saas` directory.

* feat: Add timezone support to date fields and remove automatic midnight conversion logic.

* Remove `setDateToMidnight` from the Supabase data source delegate.

* feat: Fix for SaaS dark colors

* feat: Implement enum conditions editor for dynamic enum value filtering and exclusion based on JSON Logic rules.

* feat: integrate DataTalk in example app, add schema context utilities

* demo backup update

* DataTalk routes refactor

* Added website breadcrumbs

* Blog/new views (#755)

* blog: added a blog post about the collection view modes

* feat: added docs with view modes

* Fixing datatalk urls

* Doc updates

* new root collections format

* Fix for enum values infering

* feat: Introduce Typesense Marketplace solution with backend services, Firebase configuration, and GCP Procurement API integration.

* fix: Improve form validation schema robustness by handling property mapping errors gracefully and enhance enum value inference for nested properties.

* feat: Add optional `databaseId` to `SchemaContext` and populate it in `buildSchemaContext`.

* feat: ensure all properties are displayed and correctly ordered by top-level keys, preventing unintended omissions and handling nested map properties recursively.

* Added Pipelines blog entry

* Canary branch publishing

* feat: Add local commit of version changes before lerna publish and remove `--no-verify-access` flag.

* feat: Add `enabledViews` collection property to control available view modes and enhance the v3.1 migration guide with detailed steps and troubleshooting.

* docs: Improve documentation for collection view modes and expand the v3.1 migration guide with package updates and troubleshooting.

* refactor: Adjust VirtualTable inner element structure and prevent tabIndex capture in sortable cells.

* docs: Correct `getUser` parameter type signature in entity history documentation.

* feat: Implement Kanban board view for entity collections, adding new analytics events and adjusting order property assignment logic.

* fix: Exclude null from object type check during property resolution.

* Fix: Add null/undefined checks for properties and property builders before processing.

* feat: Add last edited by indicator to entity forms through the history plugin.

* feat: add icons to document history and text search boolean switches.

* feat: Add agent deployment guidelines and enhance API retry logic by increasing delay to 5 seconds and handling 429/403 status codes.

* docs: overhaul README with updated features, quick start, and new branding.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: fgatti675 <5120271+fgatti675@users.noreply.github.com>
Co-authored-by: Marian C Moldovan <moldovan0991@gmail.com>
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