Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to react router 7, typescript, and misc. refactoring #27

Open
wants to merge 65 commits into
base: master
Choose a base branch
from

Conversation

chrzrdx
Copy link
Contributor

@chrzrdx chrzrdx commented Oct 28, 2024

  • Migrate to React Router 7
  • Migrate to React 19 & Vite 6
  • Migrate to Typescript
  • Ignore etags for now
  • Load all content and cache parsed markdown on server start
  • Add a floating table of contents to the news articles
  • Refactor server code, and some components
  • Upgrade dependencies
  • Switch out custom express server for the react-router server

Pre-release steps (in dev and in prod):

  • Update node to 22+
  • Update bun to 1.1.36+ (bun upgrade)

Known issues:

  • Sometimes, the types for the Route module can get out of sync when developing. Run rm -rf .react-router && bun run dev to generate types again.

@chrzrdx chrzrdx marked this pull request as ready for review November 28, 2024 05:30
@chrzrdx chrzrdx changed the title Setup typescript, fix etags and misc. refactoring Migrate to react router 7, typescript, and misc. refactoring Nov 28, 2024
server/app.ts Outdated Show resolved Hide resolved
tsconfig.node.json Outdated Show resolved Hide resolved
@@ -1,10 +1,12 @@
import type { Config } from 'tailwindcss';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Holding off on migrating to tailwind 4 — good news is that it supports plugins like typography (which we use) using a pure css syntax, so that's great

server/app.ts Outdated
return next();
}

const script = `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider not doing this for bots — e.g. google crawlers - just return 0

return {
commits: commits.map((commit) => ({
...commit,
localDate: getPrettyDate(commit.timestamp, getClockOffset(request)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is for the service methods to be blind to the user's timezone — they're just responsible for fetching data, and we can transform it in the loaders

app/root.tsx Outdated Show resolved Hide resolved
app/components/news.tsx Outdated Show resolved Hide resolved
app/components/header.tsx Outdated Show resolved Hide resolved
app/.server/content.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
app/entry.server.tsx Outdated Show resolved Hide resolved
@chrzrdx
Copy link
Contributor Author

chrzrdx commented Dec 4, 2024

@sorokya did you get a chance to look at this yet?

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.

1 participant