Khan / react-components

khan.github.io/react-components/
MIT License
1.01k stars 99 forks source link

Extract TeX component to separate repo #53

Open rgbkrk opened 8 years ago

rgbkrk commented 8 years ago

I'd love to rely on the TeX component as is, standalone and contribute to it alone.

sophiebits commented 8 years ago

What advantage is there to putting it in a separate repo?

rgbkrk commented 8 years ago

The current installation process is to bring the component in as a submodule. Which means I have to ensure all other developers collaborating with know how to do the submodule flow properly, even if this is only one requiring that flow (it is). This was an annoying barrier to folks back when ipython/ipython was all one monolithic repo with submodules for some of the static frontend assets. If it's npm installable, it's much easier for fresh developers to work with.

Perhaps I should just say that I'd love to see this as npm installable instead. As it currently stands, there are several other LaTeX and KaTeX react components available on npm and while looking around noticed this one too. If I choose to rely on this code, I have to introduce something outside of npm to rely on it.

I know you have been part of discussions on modularity shaming - this isn't that - I enjoy all of your work and would like to collaborate with you while enabling others to do the same. If you're really interested in my take on what advantages there are, I'll go ahead and list a few:

For a user it's being able to pin to a specific version of just that component along with semver, one focus for submitting issues and PRs, and knowledge of direction and development of the component without wading through the rest. I think it's fair to say that there is a decently sized body of people who want decent mathematical typesetting that aren't looking into this collection at large.

The advantages to collaborators on the repo are a single release cycle for one vein of focus and issues reported only as it relates as to how to use KaTeX (and/or MathJax as <TeX> does) in their React setup.

ariabuckles commented 8 years ago

I think this is a good idea too. react-components' installation process is messy and that's not likely to change anytime soon (that said, just npm installing it was supposed to work in theory--but not one has tested that in ages and it's probably not maintained). I think one of the problems with this repo is that it contains components of varying levels of maturity. While I'm not 100% for single-component repos in general (I think there are use cases for libraries), I think this would be improved by having a standalone repo, as the TeX component is quite mature.

Ideally, the TeX component repo should pull in KaTeX from npm or github too so that this is trivial to install and use.

sophiebits commented 8 years ago

Yeah, you should be able to install via npm then do require('react-components/tex'). I guess it requires katex and MathJax are globals though. We should probably update the docs/website to recommend npm.

kevinbarabash commented 8 years ago

We might also look at adding a separate npm package within react-components that packages just the files needed for <TeX>. babeljs does this for all of their presets and plugins, see https://github.com/babel/babel/tree/master/packages.

ariabuckles commented 8 years ago

Neat @kevinbarabash! I didn't know that was possible. If we seriously fixed up the packaging system for react-components, that could work :). Though I still think this repo isn't succeeding at it's goal of making components easy to use/find/etc. and would be better split out the stable+reusable components into their own repo + package. There's very little tying these together right now other than "built by Khan Academy".

If we actually figure out how to get this repo to live up to that promise, I might change my opinion. (I think a standard library of sorts for react components would be really useful. But that would require more than the smattering-together of components we have here--see all the src/components we end up having in perseus that are really building up its own standard library--and significant effort into everything's APIs, etc..)

joelburget commented 8 years ago

Agreed with Aria on all points. I originally hoped people would find reusable components all over the place and put them here. Obviously that hasn't happened, so I have no qualms with abandoning / iterating on this experiment.

For what it's worth, the main advantage I saw to this repo was code sharing between all KA frontend repos. If I remember right, webapp and perseus both use components from this repo, but we don't use it elsewhere.

ariabuckles commented 8 years ago

@joelburget correct on code sharing! I'd forgotten about that, and yeah is why we pulled a lot of things in here originally :).

rgbkrk commented 8 years ago

Any word on this? I can go ahead and create a fork if necessary (in the true forking spirit) to kick it off.

I'm also totally cool with this approach:

We might also look at adding a separate npm package within react-components that packages just the files needed for . babeljs does this for all of their presets and plugins, see https://github.com/babel/babel/tree/master/packages.

As long as I can install it from npm, super happy here.