From b71e1d9aa2584bf4718c988a5b7556f0b32ee2d1 Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Wed, 22 May 2024 14:40:48 -0400 Subject: [PATCH] feat: mo.routes() (#1356) * feat: mo.routes() * lint * lazy/catch-all improvements * fixes * lint * fix test --- .github/PULL_REQUEST_TEMPLATE.md | 1 - .pre-commit-config.yaml | 2 +- configs/.markdownlint.yaml | 2 + docs/api/layouts/index.md | 2 + docs/api/layouts/routes.md | 41 +++++ docs/api/layouts/sidebar.md | 6 +- .../deploying/deploying_marimo_cloud.md | 3 +- docs/guides/deploying/deploying_ploomber.md | 2 +- docs/guides/deploying/index.md | 1 - frontend/package.json | 1 + frontend/pnpm-lock.yaml | 7 + frontend/src/plugins/layout/RoutesPlugin.tsx | 73 +++++++++ frontend/src/plugins/plugins.ts | 6 +- frontend/src/utils/__tests__/routes.test.ts | 46 ++++++ frontend/src/utils/routes.ts | 31 ++++ frontend/vite.config.mts | 10 +- marimo/__init__.py | 2 + marimo/_plugins/stateless/routes.py | 119 ++++++++++++++ marimo/_smoke_tests/routes.py | 152 ++++++++++++++++++ tests/_plugins/stateless/test_lazy.py | 2 + tests/_plugins/stateless/test_routes.py | 80 +++++++++ 21 files changed, 574 insertions(+), 15 deletions(-) create mode 100644 docs/api/layouts/routes.md create mode 100644 frontend/src/plugins/layout/RoutesPlugin.tsx create mode 100644 frontend/src/utils/__tests__/routes.test.ts create mode 100644 frontend/src/utils/routes.ts create mode 100644 marimo/_plugins/stateless/routes.py create mode 100644 marimo/_smoke_tests/routes.py create mode 100644 tests/_plugins/stateless/test_routes.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f718cfc1df9..7d69847f6f6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,6 @@ Provide a concise summary of what this pull request is addressing. If this PR fixes any issues, list them here by number (e.g., Fixes #123). --> - ## ๐Ÿ” Description of Changes