-
Notifications
You must be signed in to change notification settings - Fork 2
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
Port the tool to React #1
Comments
Current plan:
|
I think it's quite likely that the |
My React implementation is close to parity in terms of functionality (plus some extras!), but I haven't done anything with the CSS yet.You can demo it here, and the code is here. Heads up, the paper's contents are only half-there because it was a lot of effort to manually construct the data structure. If you make a I'll write a few bullet points in the PR explaining the main points about React (and Redux, the state-management library), and where in the codebase different things can be found. I'll also point one or two commits which are good examples of how to add functionality to the codebase (e.g. adding the pin icon to the citations in the related panel). |
I've invited you to the repo. Feel free to make a branch but please don't merge yet. I think you're probably right that we need to move to a more sustainable method, but I have to say looking at the react code makes my heart sink a bit. It's such a step up in complexity. Is there a way to run such code statically without having to have an active server like in your example? I'd like to be able to offer people a way to locally host them on their own static html websites, etc. |
Thanks, I'll make sure it stays in a separate branch.
Here's an idea: to avoid losing your momentum, you could just continue prototyping ideas in the vanilla-js version for as long as you want to, and I can continue re-implementing them with more polish in the React branch. I'll make sure to keep commits clean and self-contained so that I can point you towards specific commits which demonstrate how a specific feature is implemented in React (e.g. this commit which adds the pin icon and click-to-expand functionality). Then if you ever find the time to run through a couple of React tutorials you should be in a good position to make the switch over to the React codebase. What do you think?
Yeah, I think so. We could build this as an Electron app, which is a runtime for making desktop apps in Javascript (e.g. VS Code is built using Electron). That would allow us to build this as a desktop app which consumes a local folder of documents. We can't do that with Javascript running in the browser though, it's running in a sandbox and can't access the OS or filesystem. We'd need to choose one path or the other though, either an app which consumes local documents, or a website which is backed by a "global" database of documents. |
This all sounds good to me. I'd like to learn React and Electron, it's just hard to find the time. Would you be available to go through the setup with me by video call at some point? That might help get everything installed and running nicely at least. Maybe not necessary - there are probably good tutorials online I can follow. I'd like there to be a common code base that would allow us to do web-driven and local if possible, since there should be a lot of shared / overlapping functionality I assume? How about static HTML? It reads in a latex/docx/pdf file and it dumps out an html/css/js like the way it works at the moment? Then people can just upload to their own web servers. Might be the best way of getting traction quickly, especially if we can host that converter in a website so nobody needs to download anything. I like your parallel development plan too. |
I think a call makes sense. Wednesday or Friday morning (pre-noon) works for me, or else any time this weekend.
In principle that should be possible. We could extract a good chunk of the functionality out into a library which can be hosted and installed from
I agree, that does sound like a great way to drive early traction (you'd make a good startup founder!). I think it would be even easier to adopt if people could just visit That gives us flexibility to start by converting the uploaded files to static HTML, and then later converting them to our intermediary format which can be rendered via React. We could even do both at the same time (in theory) at slightly different web addresses, e.g. upload a file on the homepage and then view it at Does the current converter work reliably on new papers, without manual intervention? If not, how close is it? |
Emailed you about call. The problem with server is that it has costs, which if this takes off could become substantial. If it's possible to run everything locally (pure js in the browser) that would be much better I think. But, in the short term having it hosted on a server is fine. Current converter works OK but not brilliantly. Problem is that latex has a lot of fiddly bits. It's not really the ideal format, but you have to work with what you've got. All papers pretty much written in Word or latex so... |
The spanner in the works here is that Javascript in the browser can't run (e.g.) I think we should just host a server though, and not let worries about costs get in the way. We can get a free server and database from AWS, and we end up getting enough traction to cost 10-20 per month then I don't mind covering that. If the project really takes off then that's a very good problem to have, and we could definitely find a way to get it funded. |
Fair points! I'd still like to be able to create local versions so that people can view offline or put on their own website, but the main thing can be a server indeed. |
For offline viewing, I think an Electron-based desktop app sounds like a good fit. You launch it and it reads files from your local drive and converts them on the fly using pandoc under the hood. We could even add a button in the app to convert a specific paper to HTML for self-hosting, and if we decided that we want to host it ourselves then we could do something like Obsidian Publish which does exactly that, with Markdown files. Either way, it looks like there's a lot of ways to skin this cat. I don't have particularly strong opinions beyond using scalable technology (i.e. React) and avoiding common architectural pitfalls. I'm happy to follow your intuition for the functionality since you know more than I do about what tools researchers want. It will be helpful for me if we could come up with a list of "things this tool should be, and should not be" at some point. E.g. it should be usable offline for viewing local files, and it should not be a text editor. Then I can help mapping that to a roadmap of some sort. |
It looks like interactivity is a key part of this concept, so vanilla Javascript will quickly become a painful experience. We should instead use tools that are built for that purpose - like React. It will be much easier to extend and scale.
The text was updated successfully, but these errors were encountered: