

MacGap: Desktop WebKit wrapper for HTML/CSS/JS applications - maccman
https://github.com/maccman/macgap

======
zbowling
I'm building a framework some what like this but maybe better for some use
cases.

It's still a work in progress but it's part of my tinderbox application.

<https://github.com/zbowling/tinderbox>

It embeds a node.js server in the background (soon it will embed a custom Node
server were I forked libev to use libdispatch on the mac and run behind inside
a secure XPC server that launchd will manage on the Mac). Then using a Unix
socket, it serves up through a custom webkit protocol handler. Two way
communication to the frontend from a custom webserver written in Cocoa.

Instead of going down the road of trying to write Cocoa code with Javascript,
instead just surface what you need as you need to your own backend. It's
abstract so that it can be reused in other applications on other platforms in
the future. Node.js was a good solution because it offers sandboxing and
eventbased IO which for my first use case (Campfire) made prefect sense.

Doing this kind of binding with a generated kind of interface is always going
to keep fighting an abstraction. (Like fighting some C++ lib you wrapped and
are trying access through SWIG). My approach you just use the tool best suited
for the job and embrace both Cocoa and Javascript.

~~~
18pfsmt
I'm wondering what it would take to run your project on an old, jailbroken
iPhone with a static IP on my LAN. Have you tried this?

------
mceachen
Sitting next to the developer of MacGap (we both work at Twitter), the first
thing that I asked was "what about Fluid?" <http://fluidapp.com/> \-- and
Alex's first retort was that this was open source, and free.

~~~
tlrobinson
_"MacGap was forked/ported from Phonegap-mac. It's under the same license
(MIT)."_

I'm more curious why he forked Phonegap-mac?

~~~
maccman
It's a good point, but I felt that it was enough of a code change to fork -
and callback-mac wasn't getting that much love (or accepting pull requests).
However, it may be that that project gets merged back in, as I might be made
the official maintainer.

~~~
18pfsmt
I'm curious why Mozilla's Prism (XUL Runner) wouldn't be a candidate for
forking in a project like this since it would allow for cross-platform
(Windows/ Linux support)?

------
AshleysBrain
I've tried a lot of WebKit wrappers and the #1 problem is WebKit alone doesn't
have things like a hardware accelerated canvas, audio support, WebGL, etc.
etc. - basically a whole lot of stuff on the browser layer rather than the
layout layer. This makes them totally useless for HTML5 games!

~~~
maccman
It does, you just have to enable it (private interface). Just tell me what you
need that's not working, and I'll enable it.

------
taskstrike
LocalStorage seems broken on the mac which makes it a bad platform to develop
webkit apps in. (It does not persist across program runs)

In fact, if either websql or localstorage worked in cocoa webkit it would be
great.

~~~
maccman
Yes, this looks like just a bug. You can definitely get localStorage to
persist data between instantiations. I'll fix it.

~~~
maccman
Fixed now.

~~~
taskstrike
thanks a lot, I can finally get off Appcelerator!

------
sjs382
Does something like this exist for windows?

~~~
vena
appcelerator titanium, i'd guess - <http://www.appcelerator.com/>

~~~
kingofspain
Titanium desktop has the feel of being abandoned - even if not officially the
case. For anything non-trivial, you're entering a world of hurt.

------
oguz
Is there a demo that we can see all of this in action?

------
evanbarter
I've looked at callback-mac in the past with the idea of making a web app seem
native on OS X, however there was a few issues with the system level
integration, namely the system menu bar and right click menus. Any thoughts on
how to address these?

------
jvoorhis
I like this.

I started working on my own WebKit Mac app framework with a slightly different
take (a Heroku-style procfile and a pubsub backbone), but never released it.
I'm happy to see others getting traction with similar ideas.

------
sirvaliance
Tried to build and test, the app should mention it requires >= OSX 10.7

~~~
spicyj
It says quite clearly in the README: "Lion is required to build and run MacGap
applications."

------
hemancuso
Lots of alternatives listed in a similar story about a similar project here:
<http://news.ycombinator.com/item?id=3315931>

------
ra
I'd love to port away from Titanium, any plans to support headless apps with
system tray icons and menus?

(Which BTW are a PITA on Titanium)

~~~
wiradikusuma
Curious question, what are the problems of Titanium Desktop?

~~~
ra
IMHO shocking documentation, very poor developer support via their Q&A
stackoverflow clone and a somewhat flaky / buggy implementation (which could
be mitigated by better documentation + developer support) or (open sourcing
the framework) or (hiring someone to foster a developer community - none
exists right now).

Maybe their paid support is better, but based on what is publicly available, I
doubt it.

Incidentally, Titanium Developer (The build tool that compliments the
framework) has been deprecated in favour of Titanium Studio, which is based on
Aptana.

Many Titanium devs don't like Studio, and so have forked (the recently open
sourced) Titanium Developer to remove some annoying anti-features put there by
Titanium.

It's a shame; the Titanium tools are fundamentally good and are nearly there,
but IMHO are frustrating to work with due to inadequate testing and an
ineffective user feedback loop.

------
suyash
MacGap is a great project, thanks Alex for creating it and sharing!

