Skip to content

Conversation

ScriptedAlchemy
Copy link
Collaborator

@ScriptedAlchemy ScriptedAlchemy commented Feb 4, 2025

This pull request primarily focuses on setting up a modern, full-stack React application template using React Router and Cloudflare. The changes include adding configuration files, setting up TypeScript, integrating TailwindCSS for styling, and ensuring server-side rendering. Here are the most important changes:

Cloudflare Example Project:

  • Set up a Cloudflare example project with a comprehensive .gitignore and README.md for guidance. (examples/cloudflare/.gitignore, examples/cloudflare/README.md) [1] [2]
  • Configured TailwindCSS and PostCSS for styling. (examples/cloudflare/app/app.css, examples/cloudflare/postcss.config.cjs, examples/cloudflare/tailwind.config.ts) [1] [2] [3]

React Router Integration:

  • Implemented server-side rendering with React Router and set up the application entry point. (examples/cloudflare/app/entry.server.tsx, examples/cloudflare/app/root.tsx) [1] [2]
  • Defined routes and components for the example project, including a welcome page. (examples/cloudflare/app/routes.ts, examples/cloudflare/app/routes/home.tsx, examples/cloudflare/app/welcome/welcome.tsx) [1] [2] [3]

Build and Deployment:

  • Configured rsbuild for development and production builds, including plugins for React and React Router. (examples/cloudflare/rsbuild.config.ts, examples/cloudflare/package.json) [1] [2]
  • Set up a server script for handling requests using React Router's server build. (examples/cloudflare/server/app.ts)

These changes collectively establish a robust foundation for developing and deploying a React application with modern tools and best practices.

- Completely rewrote README.md with comprehensive documentation
- Updated example project configuration and routes
- Improved dev server and plugin configuration handling
- Added more detailed styling and interactive elements to documentation pages
- Refined plugin options and configuration management
- Enhanced server-side rendering and custom server support
@kziemski
Copy link

kziemski commented Feb 5, 2025

@ScriptedAlchemy Is there any feedback/buy-in from the remix guys at the moment?

"@types/node": "^22.10.1",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"jiti": "^2.4.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jiti can be moved to dependencies, otherwise Rslib will bundle it..

let clientStats: Rspack.StatsCompilation | undefined;
api.onAfterEnvironmentCompile(({ stats, environment }) => {
if (environment.name === 'web') {
clientStats = stats?.toJson();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting all the stats in Rspack is quite slow, if we can specify options it will be faster.

see https://rspack.dev/config/stats#statsall

@chenjiahan chenjiahan merged commit c365eff into main Feb 11, 2025
@chenjiahan
Copy link
Member

Let's merge the code into the main branch so more people can see it and contribute 😄

@chenjiahan chenjiahan deleted the feat/plugin-impl branch February 11, 2025 02:47
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.

3 participants