Been meaning to write an update on this for a while...
I set the challenge for a couple of the guys in our team to start playing with some of these new ideas for Hammer. @rkolpakov and @bulbozaur took up the challenge wholeheartedly, I'm pleased to say and have already made great progress.
Electron, though not the perfect solution, gave us the ability to rapidly prototype the UI for Mac, Linux and Windows platforms simultaneously. Electron also gives us a node.js runtime, of sorts, so we don't need to worry (we thought) about accessing global node.js as a dependency.
In this regard, it's pretty similar to the existing Hammer for Mac app architecture, where we have a native Mac client and a ruby based compiler engine.
We've now got to the point where we have both of these core elements developed sufficiently and brought together to validate the architecture, though it wasn't without some difficulties. The Electron JS runtime is all well and good, but super difficult to debug issues with.
We are considering whether it wouldn't make more sense to instead use node.js outside of Electron and bundle it as an executable, like we did with our early Coinstash app version, using the pkg binary compiler. Still deliberating...
To start with, we're not thinking about the UI at all, so we've just kind of used the existing Hammer app design as a basis and have worked to get the fundamentals of the existing Hammer app in place.
Here's what we've done so far...
As you can see, the app looks pretty familiar and already, the main features have been realised...
Create New Project
Edit Project details
Assign Existing Directory to new Project
Drag and Drop sort Projects List
Create project from Template
Present Project directory
Select Text Editor
Present Build Directory
List Project files
Project File filters
Hammer Ignore options
Todos List Filter
Ignored Files List Filter
Errors List Filter
Open File from list in Browser
Reveal file in Finder / Explorer
Open File from list in Text Editor
Export, Deployments & Hosting
Hammr.co preview service
Forge production hosting service
Export Build directory as .zip archive
Select Text Editor
New Feature - GIT Built In
One of the things I am very keen to enable, in pursuit of better collaboration options for teams and improved workflows all round, is a simple GIT interface within Hammer.
We've been working on a technical proof of concept, again to reiterate, without much attention to the UI just yet.
Here's a look at how the flow might work in the new Hammer app.
Clicking on the GIT icon in the Projects list, you can access the GIT view for your specific site.
No GIT repository initialised
So to initialise our Project with GIT, we just hit the
Now we can see our Project's files listed in the
Stage area, ready to be added to a commit.
I can select all of the files by clicking the
Not Added button, or select individual files. I've added all of them with one click.
Now it's time to make my first commit on the Project, adding all of these files. Click the
Commit button and add a message like
Having Committed these files, the Master branch is automatically created and selected for us.
Stage tab is now clear as there are no changes to files and so nothing further to commit for now... If I click on the
Log tab, however...
We can see our initial commit has been made.
Now we want to make further changes...
Time to create a new Branch...
I then can open my text editor and make my changes. In this case I've made a simple text change in
index.html. When I save this file, I can see that
index.html is now visible in the
stage tab, ready to be committed.
I have selected the
index.html then head to
Commit button and add my message like before...
And voila, my latest commit to the new
features/new-feature branch is successfully logged.
Next, I may want to Merge this into Master... and for now this is where our journey ends, as we're still working on some of the more advanced GIT commends
But what do you think so far?? Pretty neat, huh?
Everything you saw above was all screenshot from my Macbook Pro. Yawn. Hammer's always been Mac. That's not new...
Well, what about this?
A sneak peak of Hammer running on my Windows 10 Machine.
The features don't end there, my friends! We haven't even talked about the new Webpack-based Engine.
Aside from the initial focus on the actual architecture and getting the Engine to play nice inside the client app / Electron environment, @rkolpakov and @bulbozaur have been busy adding initial support for all the baseline Hammer features.
<!-- @include _header.html -->
Clever Paths e.g.
<!-- @path icons.png -->
<!-- $foo bar --> <p><!-- $foo --></p>
Auto-reload - this is now enabled by default!
<!-- @todo Rewrite all of this -->
Image Placeholders e.g.
<!-- @placeholder 300x400 -->
<!-- @stylesheet normalize main -->
Existing Hammer for Mac supports, in addition to the default HTML, the popular ruby-based templating languages HAML and Slim.
What about all my old Hammer projects written in Slim and Haml?
Good question! Well, the good old JS community has created Webpack loaders for Slim and Haml, so we're including them too. There's a bit of a question mark about the long term support of these libraries, but they seem to work ok and I'm keen on ensuring backwards compatibility.
Of course the plan is to support the existing SASS and Coffeescript pre-compilers that existing Hammer provides. We're having some issues with cross-platform compatibility of lib-sass but I'll let @rkolpakov explain more about that if anyone is interested.
In theory, it also means that it would be more straightforward to also support Stylus, LESS etc. but we also like PostCSS and would be planning broad support for PostCSS going forward.
Overall it's been a really great start to some exploratory work for the future Hammer and I'm really excited to see where it leads. I'm very excited that the tool already looks to be a more effective options for teams that want to use the Hammer workflow and can do so regardless of which OS the individuals choose to use and with industry standard version control through GIT.
The team of myself, @rkolpakov and @bulbozaur, along with wider input from @boris know that this is just the tip of the iceberg and we've got some great new ideas that I'll be sure to share and explore in later posts...
We publish and share builds internally on a weekly basis, if you'd like to join the distribution list and get involved at this raw and early stage, helping with testing, debugging and ideas, let me know and I'll see how I can manage it...