-
Notifications
You must be signed in to change notification settings - Fork 370
Gitgraph.js v2 - The big remodelling!… and more #187
Comments
Thanks @fabien0102 for posting it. I added a WHY at the beginning 😉 This issue is open to public discussions, in case anyone want to step in. |
I really like the development of all this especially with the core separation. I am using Sphinx (reStructured text) for documentation a lot and I see possibility of a extension-plugin for this. Basically with above description v2 could enable this integration a bit more naturally. Any timeline on this? |
Hi! I'm just discovering your lib. I have the same needs that you. Draw a git history to explain workflow or use case easily. I think, It'll be cool to have 2 features.
Je n'avais pas vu que vous étiez français. En continuant mon worflow, j'avais besoin de montrer des cherry-pick. J'ai de nouveau cherché et j'ai trouvé ce plugin pour Latex : https://github.com/Jubobs/gitdags. |
First of all, sorry for the late, I was in vacations 😎 ^^ @Letme For the timeline, hard to said, @nicoespeon and me are little bit busy for now, so we trying to work on it but as a side project only 😉 BTW, if you want to work on an extension, we can maybe try to work in parallel (with a mock of gitgraph-core) it can be a good way to have the best design as possible of the gitgraph-core API @Turiok Nice ideas!
# My beautiful graph!
```gitgraph
git commit -m "initial commit"
git co -b "develop"
git commit -m "second commit"
git merge master
``` Something like this? |
Do you guys want to make this project into a TypeScript project? I can help with that It will help split the file up into smaller likes like... I can see the project has TypeScript support already, but it isn't true TypeScript Edit: nvm! I can see in the PR it has begun in gitgraph-core: E.g. I am still eager to contribute if needed |
I have noticed test files are under a What do you think about putting them on the same level as the class, and instead of |
Could we add https://github.com/prettier/prettier Just simply add |
Hello @dolanmiu For prettier, I have set ts-lint and it’s do the same job ^^ what is your pro about prettier instead of tslint? (prettier have a typescript checking?) |
Note: I want to have only one source a truth about lint rules ;) |
@fabien0102 prettier does a different job, but a similar job. In my projects, I use both tslint and prettier 😄 Read this: https://alexjoverm.github.io/2017/06/12/Use-Prettier-with-TSLint-and-be-happy/ Up to you, I like codebases which are super strict And if you use Yes, there is now two sources of truth, |
I like strict too ^^ I check this article ;) Thanks for yours suggestions :) |
Normally hunky and linted-stage done this (fix lint on pre-commit, you can check the package.json of gitgraph-core ;) ) and you have also a nice vscode-tslint extension that do the same ;) (I say normally because I failed yesterday ^^) |
How will you structure the rendering part?
Will it be a port of the current If it is a port, I can aid with the porting? |
I use From my knowledge, I don't believe it has a "fix all linting errors on save" functionallity (unless I am oblivious) 😂 |
I think that for a project that have css/js and ts, prettier is a good choice (same tool to format everything) but for just a ts project, I can do this job with tslint only (including the auto fix, and have a nice vscode xp) |
https://marketplace.visualstudio.com/items?itemName=eg2.tslint autofixonsave ;) |
For the rendering part, We plan to put all data into the core (x, y of each commit) and after to implement the render method into other packages (gitgraph-react for example) As you can see, the render method into gitgraph-cite is abstract (so a part of child implementation ;) ) (one time more, it’s quite experimental for now, just trying to find the best pattern ^^ ) And it's almost a rewriting, because we need to change the base modelisation, in the v1, it's just draw on each method, on the v2 we want to fit a bit more with the real git concept for storing the commit data to be able to import a real git repo or other requested features like that ;) |
What do you think about creating a I am thinking of creating an |
Wow didn't know about this |
mmm need to think about that ^^ My original idea is to have a "all inclusive" |
@dolanmiu BTW if you want to take care of the angular part, be my guest! (I'm more a react guy now ^^) But yes, you should wait a little bit, the api is really in an alpha version, but I can poke you when it become more stable ;) |
Ok, I do think we should create a Otherwise there will be so much repeated code Sure! I will do the angular side |
For now the plan is to merge the |
I've just added a |
First, thanks for Gitgraph, it is awesome! Are commit messages planned for horizontal rendering in v2? Currently this: var gitgraph = new GitGraph({
orientation: 'horizontal-reverse',
template: new GitGraph.Template({
branch: { showLabel: true },
message: {
displayAuthor: false,
displayBranch: false,
displayHash: false,
}
})
});
var master = gitgraph.branch('master');
master.commit({message: 'something old'});
master.commit({message: 'something new'});
var develop = master.branch('develop');
develop.commit({message: 'something borrowed'});
develop.commit({message: 'something blue'});
var feature = develop.branch('feature');
feature.commit({message: 'and now something completely different'}); Gives this: No commit messages as you can see... also, first branch |
@mrts Hiding commits in horizontal mode was totally intentional due to the available space to display the commits. I've probably inverse the commits order in the v2 (I need to check) the problem is that is not right to left of left to right here, it's more "last commit first" vs "first commit first" but we can also think about a better naming here ;) |
#sorryIMisclicked 😉 P.S. I handled commit strokes for the BlackArrow theme 🎉 |
@fabien0102, perhaps something like this for displaying commit messages in horizontal orientation (the 'right' one in the picture): |
Hey everyone 👋 Great news: we released premajor versions of the new packages! You can start using The PR was merged into I created a project board to track all remaining work until everything is stable and complete: https://github.com/nicoespeon/gitgraph.js/projects/2 I keep this issue open so we can discuss about it, if necessary. Remaining work include:
|
Hi @FeynmanDNA and thanks for trying out 👋 Indeed, that's a good catch! The snippets in the issue description are incorrect. There were mostly brainstorm stuff, so we didn't tried them out. I'll update them 👌 You can have a look at the gitgraph-react README instead, it has a better snippet (which should work!) + few code examples you can try out. |
@nicoespeon hi thanks for your kind words! 👍 The gitgraph-react section of the repo also does not work for me. I git cloned this repo and
I am not familiar with type-script, and maybe this is something to do with type-script? |
@FeynmanDNA Oh, I think this might be a lerna thing. Can you try this:
I think it should solve your issue. Let me know, I'll enrich the contribution README so people know how to set up a local repo. Now, I also noticed that the published packages didn't get the correct dependency. I fixed that, but I forgot to re-publish new versions. I just did that. That means you should be able to use |
@nicoespeon yes now it works. Thanks for your advice and fix! |
@nicoespeon I'm still getting that issue when trying to
However, I would like branches to be labeled at their actual tip (#160) so I understand that the JS version isn't sufficient. So I tried figuring out how to set up the react version in a similar way. All I want is to see the storybook in my browser so that I can play with the examples, but I can't find any instructions anywhere for doing this. I've never used react before so I don't have an existing project that I can add this package to. I thought that installing npm and yarn, and following your instructions in the comment above, would let me follow the storybook README instructions, but I can't get gitgraph-react to build. Here's the output I get, after
I assume I'm doing something horribly wrong because of my react naivete. Any ideas on how I can proceed to play with the React examples? Your library seems really cool but I'm struggling a lot getting it working. Have you considered having a one-command build script that will install everything needed and build the project? (It's not clear to me why yarn doesn't do this already). Or a new section in this readme explaining what to do with the given code? I just want to create some screenshots of diagrams. |
Hey, I actually figured it out on my own! You have to Setup:
Then:
Whew! Please consider documenting this so that other people don't have to struggle with it too 😄 |
Hi @briangordon 👋 Sorry to learn you had to run into so many troubles! I've a couple information that you might find useful indeed:
But I really want to make it simpler. I'll also add more details into the |
Ah, that is a lot easier. I guess I was stumbling through a lot of stuff from not being familiar with the tool stack. Thanks for your response. Hopefully any other bumbling backend engineers will see this 😅 |
It will be simpler and documented. I will do once I'm done creating the |
I just released the stable versions of each public package. That officially closes this issue. From now on, these will be regular releases to implement new features and fix bugs on the library 🎉 |
Gitgraph.js v2
Project board to track completion: https://github.com/nicoespeon/gitgraph.js/projects/2
No timeline for a release yet. But…
@fabien0102 & @nicoespeon work at least 1h of remote pair-programming every week on this 👨🎤🎸
✏️ Todo
When everything else will be done
gitgraph-react
To fix for release
General
/packages/*
patterntslint --fix
as pre-commit hookGitgraph Core
templateExtend()
to easily create new templates from existing onesGitgraph React (rendering)
On render graph(we already provide the render callback)render()
callback to commits🎨 Nice-to-have
Gitgraph React (rendering)
Gitgraph node (rendering)
🧐 Why? What do we want to achieve?
This lib started as a POC to solve our need to draw git graphs easily for presentation − e.g blog posts, slides, trainings…
But now we're facing some challenges to maintain and evolve the lib:
Doing so, we may end up with breaking changes. We'll try not to, but we're planning for a major version release if necessary − thus the v2.
🥞 Stack
🗂 Repositories
packages/gitgraph-core
The idea is to extract the main logic, without the rendering.
All the API will be defined there: commit, branch, merge, etc. We'll embrace git semantics.
Every actions will produce an internal "state" that will look like the JSON output from git2json.
Ideally, we should consolidate this "state" with graphical information for rendering: column, row, color, message, x, y, onClick…
packages/gitgraph-js
The idea here is to never use
gitgraph-core
directly. We'll bundle it into different rendering engines.Gitgraph-js will work more or less with the same API than v1: it takes a selector or an
$el
and that's it. We may move from canvas to svg, or use a combination of both if relevant.Code snippet
packages/gitgraph-react
We could have an alternate rendering library. Here in React for example.
Code snippet
packages/gitgraph-node
We can even provide a rendering lib to display git graphs in the terminal.
Code snippet
🙀 Breaking changes
develop
inmaster
develop.merge(master)
master.merge(develop)
commitDotText
in commit optionsinnerText
in commit optionstooltipHTMLFormatter
in template optionstooltipFormatter
in commit options (doesn't handle HTML)The text was updated successfully, but these errors were encountered: