Skip to content

fix: Porting Ratel to Vite. #382

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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

Conversation

MichelDiz
Copy link
Contributor

@MichelDiz MichelDiz commented Apr 19, 2025

Description

TL;DR: Modernizing Ratel — now running on Vite with updated tooling and recent NPM support. No more being stuck in the past.

PS. I need help with this vercel stuff. No idea what it expects from me.

Man, this took a lot of work.
I finally mustered the courage and (partially) finished porting Ratel to Vite. There's still a lot to do, but it's a start.

My goal here is to bring Ratel back to life. I've been trying to do that for years, but it was just too complex. so much legacy config, so much going on. I gave up at least eight times. But I finally got it working with ViteJS.
I considered other tools and even using TypeScript, but that path was getting messy again. That said, I think we’ve landed on a solid solution here.

I'm asking you all to take a look and help me smooth out the rough edges. There are still a bunch of minor UI bugs to address, but overall, it's functional.

A few things to keep in mind:
I removed a lot of stuff that I didn’t fully understand or seemed unnecessarily complex. Just to simplify things. My thinking is: if it’s really essential, someone will either add it back in or come up with something better than a five-year-old, unmaintained piece of code, right?

One last note: the library that connects to Dgraph via HTTP isn’t compatible with Vite. That’s something that needs to be addressed in their repo if folks still want to use it. I just switched over to good old fetch.

Checklist

  • [+/- ] Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable
  • For public APIs, new features, etc., PR on
    docs repo staged and linked here

…uration

- Cleaned up HTML structure in loader.html for better readability by removing unnecessary line breaks and spaces.
- Simplified JavaScript in loader.js by removing trailing commas and unnecessary line breaks.
- Introduced a new Vite configuration file (vite.config.js) to set up the project with React and path aliases for easier imports.
- Deleted `graph.js`, `graph.test.js`, `helpers.js`, `queryVars.js`, and `utils.js` as they are no longer needed.
- Removed `backup.js`, `cluster.js`, `connection.js`, `frames.js`, `index.js`, `query.js`, and `ui.js` reducers to streamline the codebase.
- Cleaned up associated imports and references throughout the project.
- Added GraphParser class to handle graph data processing and node management.
- Introduced helper functions for cookie management, server latency calculation, and URL sanitization.
- Created reducers for backup, cluster, connection, frames, query, and UI state management.
- Added tests for graph processing functionality (currently commented out).
- Implemented query variable extraction utility.
- Established main entry point for the application with React rendering.
Copy link

vercel bot commented Apr 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ratel ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2025 4:47pm
ratel (stage) ❌ Failed (Inspect) May 11, 2025 4:47pm

Copy link

vercel bot commented May 9, 2025

@MichelDiz is attempting to deploy a commit to the Hypermode Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants