16 ms·
Isomorphic-git v1.0
- pyramation 7y agoI love this library! ;)
- dang 7y agoA thread from 2018: https://news.ycombinator.com/item?id=17083807 https://news.ycombinator.com/item?id=17083807
- mxcrossb 7y agoIt’s fun to see everyone in 2018 was arguing about Rust too
- grizzles 7y agoGreat library. Wish it worked with local urls tho.
- isomorphic 7y agoI'd like to comment on the name of this project, but fear my comment would be equivalent to an argument about semantics.
- aidos 7y agoThe term has been weirdly adopted by the dev community in a way that kinda makes sense if you squint a little but has always created a dissonance in my brain due to my maths background. But since we’re here! For those who don’t know the word from outside of the dev sphere, in maths it refers to having 2 way mappings between 2 structures. You can do it between totally seemingly unrelated parts of maths (you just need to show how to map between them). As a result, anything you’ve proved in one space holds true in the other. It can be useful if you have an intuition and understanding of one of the spaces but not the other. I’m trying to think of a nice example but I haven’t thought about this type of maths for a couple of decades now. Answers on a postcard please!
- a-saleh 7y agoI remember my mind being blown when in Discrete Math 101 we learned that natural numbers are isomorphic with whole numbers. Was it, you map 0 to 0, even n to n/2, odd n to -(n+1/2) and all of us were like whoa and the TA is like "wait till I tell you about diffrent cardinalities" :D
- jrh206 7y agoThis is just a bijection - for an isomorphism you need more structure. Roughly, having an isomorphism (which is a function) says: 0. I have two sets of things, and I can perform operations on each set 1. These two things are the same size (this is your example) 2. If I do operation A on elements (a, b) in set A, then perform the isomorphism on the result, this gives me the same thing as if I performed the isomorphism on a and b independently then performed operation B on their result 3. The isomorphism has an inverse with the same properties [There are various types of isomorphism depending on what part of maths you’re thinking about. But they all have roughly this idea of “same size” and “preserves something cool that I can do in each of the spaces”]
- throwaway_pdp09 7y agoHow do isomorphic, homomorphic and bijective differ, please?
- excerionsforte 7y agoFrom the project: "The "isomorphic" in isomorphic-git means that the same code runs in either the server or the browser. That's tricky to do since git uses the file system and makes HTTP requests. Browsers don't have an fs module. And node and browsers have different APIs for making HTTP requests!"
- mstade 7y agoI wonder how this compares to wasm-git[1], which is libgit2 compiled to wasm for use in both the browser and node. At face value it seems isomorphic-git has been around for longer, and wasm-git seems hot off the press, but the latter seems like maybe it's got more eyes on the prize given libgit2's developer base? (I have no affiliation with either project, just looking for options to use git in-browser and in node.) [1]: https://github.com/petersalomonsen/wasm-git https://github.com/petersalomonsen/wasm-git
- joshfarrant 7y agoI’d love to see some work put in to making this work with React Native. I spent a day trying to get this to work a few weeks ago with no joy, and I couldn’t find any indication that anyone else had managed to make it work either.
- worldsayshi 7y agoThis would seem like a workaround but it's possible to run node.js on Android and iOS and bundle it with your react native app so that might be a potential way forward: https://code.janeasystems.com/nodejs-mobile/ https://code.janeasystems.com/nodejs-mobile/
- yatsyk 7y agoI tried to run it in RN year ago with no luck, filled an issue [1]. Looks like they removed Buffer dependency in 1.0 which was one of the problems. [1] https://github.com/isomorphic-git/isomorphic-git/issues/698 https://github.com/isomorphic-git/isomorphic-git/issues/698 edit: fix link
- tomashubelbauer 7y agoI think you accidentally pasted a link to wasm-git instead of the Isogit issue link.
- yatsyk 7y agoThank you! fixed
- akdor1154 7y agoBut why? Aren't your users gonna be far better off if you used native git? Sorry, I know this comes off as a bit dickish, but I'm interested to know the circumstances that lead to this point of view :)
- yatsyk 7y agoMore or less same arguments as for choosing React Native for any other project: share some or all code on web/android/ios platforms. The other option could be compiling libgit2 to native code/wasm and use it in RN and web, but it will be harder then just import js-only npm.
- DrScientist 7y agoI can see how having git in javascript makes workflows with git in js based tools like webpack and rollup much more convenient to install and share. I'm having a failure of imagination on the browser side though - anybody got killer use cases running git in the browser?
- tomashubelbauer 7y agoI am personally using Isomorphic Git exclusively in my automation scripts (written in Node) where it is about infinity times more convenient than shelling out to Git and parsing its output (something which feels dirty to me even in scenarios where it works, like in VS Code's version control pane which does this), however I know a few folks are looking at online IDEs and various things with P2P - like using WebRTC to mesh up clients and using Git in a truly distributed fashion across this WebRTC mesh. The fact that you can supply your own fs implementation makes these kind of applications really easy.
- mattdesl 7y agoAn example would be Glitch or Codepen creating commits on each code change, to allow undo/redo of a project over a broader range of time. Glitch already has this feature although it’s currently a bit buggy. It may even be based on isomorphic git, not sure.
- mattdesl 7y agoFurther - I am using git commits to store hashes for code-created artworks, so that I can reproduce and remix the exported PNG at a later point. See here: https://github.com/mattdesl/canvas-sketch/blob/master/docs/exporting-artwork.md#git-commit--file-hashing https://github.com/mattdesl/canvas-sketch/blob/master/docs/e... Client side git would mean one less reliance on nodejs.
- Normal_gaussian 7y agogit backed personal wiki sites exist, though I don't know what they generally use. e.g. TiddlyWiki
- 7y ago
- nathias 7y agoplease devs stop using big words you don't understand
- Sammi 7y agoUsing this and Gitlab and Netlify you can make static pages that can edit themselves without having a backend anywhere. That is the holy grail of dynamic static. Or Naught Static Pages as I call them :) I'm not talking about making use of some "serverless" backend like Firebase or something. I'm talking about only using git hosting and static website hosting and in browser computation to make "dynamic" websites. What you do is: * You make a regular static page with whatever static web page framework or view template software you like that runs in the browser. I got Handlebars to work. (I'm looking at trying Choo next, because it is literally one hundredth of the size) * Make another "admin" page where the user can input the data. This page first checks out the current git repo. * When the user hits submit you use the newly edited data to build the static site in the browser and commit/push everything to git where it is automatically pushed to netlify. You first have to bootstrap this process on your own machine in the first commit. I've been holding on to this secret for over a year. Well the cats out of the bag now. I haven't run into someone doing something similar with Isomorphic-git yet. I've had it in production for an artist website for almost a year. I don't know if this is good or bad for Gitlabs or Netlifys business model.
- et2o 7y agoThis is a really cool idea. Could you perhaps post a minimal example?
- Sammi 7y agoI've been meaning to for over a year :) Maybe this will motivate me.
- radarsat1 7y agoReally confused about what this does or what advantages it brings.
- Sammi 7y agoDynamic page content without hosting a backend. Backend hosting can be enormously complicated when you just want to be able to edit a few fields in the page dynamically.