Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rasengan-dev/rasenganjs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: rasengan-dev/rasenganjs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: docs
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 6 commits
  • 54 files changed
  • 1 contributor

Commits on Mar 22, 2025

  1. Copy the full SHA
    89881f2 View commit details

Commits on Mar 28, 2025

  1. Copy the full SHA
    5641853 View commit details

Commits on Mar 29, 2025

  1. Copy the full SHA
    db5500c View commit details
  2. Copy the full SHA
    0b6354c View commit details

Commits on Mar 30, 2025

  1. Copy the full SHA
    38e65ca View commit details

Commits on Apr 1, 2025

  1. Copy the full SHA
    bc609cd View commit details
Showing with 2,904 additions and 140 deletions.
  1. +1 −1 docs/package.json
  2. +16 −0 docs/src/app/_404.tsx
  3. +17 −3 docs/src/app/app.layout.tsx
  4. +2 −0 docs/src/app/app.router.ts
  5. +19 −0 docs/src/app/docs/pages/home/api/api.group.ts
  6. +67 −0 docs/src/app/docs/pages/home/api/components/component.page.mdx
  7. +21 −0 docs/src/app/docs/pages/home/api/components/components.group.ts
  8. +369 −0 docs/src/app/docs/pages/home/api/components/layout-component.page.mdx
  9. +150 −0 docs/src/app/docs/pages/home/api/components/link.page.mdx
  10. +79 −0 docs/src/app/docs/pages/home/api/components/outlet.page.mdx
  11. +108 −0 docs/src/app/docs/pages/home/api/components/page-component.page.mdx
  12. +80 −0 docs/src/app/docs/pages/home/api/components/router-component.page.mdx
  13. +91 −0 docs/src/app/docs/pages/home/api/components/template.page.mdx
  14. +9 −0 docs/src/app/docs/pages/home/api/conventions/conventions.group.ts
  15. +91 −0 docs/src/app/docs/pages/home/api/conventions/layout.page.mdx
  16. +95 −0 docs/src/app/docs/pages/home/api/conventions/page.page.mdx
  17. +86 −0 docs/src/app/docs/pages/home/api/conventions/router.page.mdx
  18. +41 −0 docs/src/app/docs/pages/home/api/create-rasengan-cli.page.mdx
  19. +70 −0 docs/src/app/docs/pages/home/api/functions/define-config.page.mdx
  20. +83 −0 docs/src/app/docs/pages/home/api/functions/define-router.page.mdx
  21. +77 −0 docs/src/app/docs/pages/home/api/functions/define-routes-group.page.mdx
  22. +15 −0 docs/src/app/docs/pages/home/api/functions/functions.group.ts
  23. +45 −0 docs/src/app/docs/pages/home/api/functions/render-app.page.mdx
  24. +90 −0 docs/src/app/docs/pages/home/api/rasengan-cli.page.mdx
  25. +182 −0 docs/src/app/docs/pages/home/api/rasengan-config.page.mdx
  26. +4 −0 docs/src/app/docs/pages/home/core-concepts/core.group.ts
  27. +2 −2 docs/src/app/docs/pages/home/core-concepts/deploying/node.page.mdx
  28. +159 −0 docs/src/app/docs/pages/home/core-concepts/rendering/csr.page.mdx
  29. +15 −0 docs/src/app/docs/pages/home/core-concepts/rendering/prerendering.page.mdx
  30. +9 −0 docs/src/app/docs/pages/home/core-concepts/rendering/rendering.group.ts
  31. +133 −0 docs/src/app/docs/pages/home/core-concepts/rendering/ssr.page.mdx
  32. +4 −4 docs/src/app/docs/pages/home/core-concepts/routing/base-concepts.page.mdx
  33. +2 −2 docs/src/app/docs/pages/home/core-concepts/routing/redirecting.page.mdx
  34. +10 −10 docs/src/app/docs/pages/packages/introduction.page.mdx
  35. +18 −0 docs/src/app/root/pages/blog.page.tsx
  36. +186 −2 docs/src/app/root/pages/home.page.tsx
  37. +4 −2 docs/src/app/root/root.layout.tsx
  38. +3 −2 docs/src/app/root/root.router.tsx
  39. +9 −0 docs/src/assets/images/icons/folder.svg
  40. +9 −0 docs/src/assets/images/icons/lock.svg
  41. +9 −0 docs/src/assets/images/icons/speed.svg
  42. +12 −0 docs/src/assets/images/illustrations/blue-light.svg
  43. +22 −0 docs/src/components/atoms/badges/badge.tsx
  44. +20 −6 docs/src/components/atoms/buttons/button.tsx
  45. +67 −0 docs/src/components/atoms/buttons/copy-button.tsx
  46. +4 −2 docs/src/components/layout/footer.tsx
  47. +13 −2 docs/src/components/layout/navbar.tsx
  48. +102 −0 docs/src/components/molecules/editor.tsx
  49. +13 −11 docs/src/components/molecules/pagination.tsx
  50. +94 −10 docs/src/data/docs/index.tsx
  51. +57 −0 docs/src/styles/mdx.scss
  52. +1 −0 packages/rasengan/src/routing/index.ts
  53. +11 −13 playground/rasengan-v1-test/rasengan.config.js
  54. +8 −68 pnpm-lock.yaml
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"axios": "^1.8.3",
"lucide-react": "^0.477.0",
"motion": "^12.4.10",
"rasengan": "1.0.0-beta.61",
"rasengan": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwind-merge": "^3.0.2",
16 changes: 16 additions & 0 deletions docs/src/app/_404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Button from '@/components/atoms/buttons/button';
import { Link } from 'rasengan';

export default function NotFound() {
return (
<section className="flex flex-col items-center justify-center h-screen">
<h1 className="text-4xl mb-4 font-lexend-bold">Oops</h1>
<h2 className="text-2xl">404 - Page Not Found</h2>
<Link to="/">
<Button className="bg-primary text-primary-foreground mt-4 text-sm">
Back to Home
</Button>
</Link>
</section>
);
}
20 changes: 17 additions & 3 deletions docs/src/app/app.layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
import React, { useEffect } from 'react';
import { Outlet, LayoutComponent, Link } from 'rasengan';
import { useEffect } from 'react';
import { Outlet, LayoutComponent, Link, useLocation } from 'rasengan';
import { useTheme } from '@rasenganjs/theme';
import { twMerge } from 'tailwind-merge';
import { useNavigationStore } from '@/store/navigation';
import { motion, AnimatePresence } from 'motion/react';
import { NavigationData } from '@/data/docs';
import { X } from 'lucide-react';
import ThemeButton from '@/components/atoms/buttons/theme-button';
import Footer from '@/components/layout/footer';

const AppLayout: LayoutComponent = () => {
const { isDark } = useTheme();
const { isOpen, toggle } = useNavigationStore();

const location = useLocation();
const pathname = location.pathname;

// Scroll to the top on route change
useEffect(() => {
if (typeof window === 'undefined') return;

console.log('scroll to top');

window.scrollTo({
top: 0,
behavior: 'smooth',
});
}, [pathname]);

return (
<section
className={twMerge(
2 changes: 2 additions & 0 deletions docs/src/app/app.router.ts
Original file line number Diff line number Diff line change
@@ -2,11 +2,13 @@ import { RouterComponent, defineRouter } from 'rasengan';
import RootRouter from '@/app/root/root.router';
import AppLayout from '@/app/app.layout';
import DocsRouter from '@/app/docs/docs.router';
import NotFound from './_404';

class AppRouter extends RouterComponent {}

export default defineRouter({
imports: [RootRouter, DocsRouter],
layout: AppLayout,
pages: [],
notFoundComponent: NotFound,
})(AppRouter);
19 changes: 19 additions & 0 deletions docs/src/app/docs/pages/home/api/api.group.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineRoutesGroup } from 'rasengan';
import componentsGroup from './components/components.group';
import functionsGroup from './functions/functions.group';
import conventionsGroup from './conventions/conventions.group';
import RasenganConfigPage from './rasengan-config.page.mdx';
import CreateRasenganCliPage from './create-rasengan-cli.page.mdx';
import RasenganCliPage from './rasengan-cli.page.mdx';

export default defineRoutesGroup({
path: '/api-reference',
children: [
componentsGroup,
functionsGroup,
conventionsGroup,
RasenganConfigPage,
CreateRasenganCliPage,
RasenganCliPage,
],
});
67 changes: 67 additions & 0 deletions docs/src/app/docs/pages/home/api/components/component.page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
path: component
metadata:
title: Component
description: Component
toc: true
---

import Pagination from '@/components/molecules/pagination';
import { Link } from "rasengan";
import StepItem from '@/components/molecules/step-item';
import Tabs from '@/components/molecules/tab';

<span className="text-[12px] font-mono-regular text-foreground/60">
API REFERENCE
</span>
# Component

The `Component` React component is the main component provided by Rasengan.js to setting up all the routing system based on the `AppRouter` that it receives as a prop.

This component is used inside the `main.tsx` file (the entry point of the application) to set up the routing system.

## Usage

<Tabs tabs={[{ title: 'TypeScript' }, { title: 'JavaScript' }]} activeIndex={0}>
<Tabs.Item>
```tsx title="main.tsx" {5} showLineNumbers /Component/
import { type AppProps } from "rasengan";
import AppRouter from "@/app/app.router";

export default function App({ Component, children }: AppProps) {
return <Component router={AppRouter}>{children}</Component>;
}
```
</Tabs.Item>
<Tabs.Item>
```jsx title="main.jsx" {4} showLineNumbers /Component/
import AppRouter from "@/app/app.router";

export default function App({ Component, children }) {
return <Component router={AppRouter}>{children}</Component>;
}
```

</Tabs.Item>
</Tabs>

The `Component` component receives the `router` prop, which is the `AppRouter` class that contains all the routes of the application.
It will be responsible for setting up the routing system based on the routes defined in the `AppRouter` class.

## Props

The `Component` component accepts two props:

- `router`: The `AppRouter` class that contains all the routes of the application.
- `children`: The children of the `Component` component, which represents all the routing system of the application.

<Pagination
prev={{
href: '/docs/api-reference/components/outlet',
label: 'Outlet',
}}
next={{
href: '/docs/api-reference/components/template',
label: 'Template',
}}
/>
21 changes: 21 additions & 0 deletions docs/src/app/docs/pages/home/api/components/components.group.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineRoutesGroup } from 'rasengan';
import LinkPage from './link.page.mdx';
import OutletPage from './outlet.page.mdx';
import ComponentPage from './component.page.mdx';
import LayoutComponentPage from './layout-component.page.mdx';
import PageComponentPage from './page-component.page.mdx';
import RouterComponentPage from './router-component.page.mdx';
import TemplatePage from './template.page.mdx';

export default defineRoutesGroup({
path: '/components',
children: [
LinkPage,
OutletPage,
ComponentPage,
LayoutComponentPage,
PageComponentPage,
RouterComponentPage,
TemplatePage,
],
});
Loading