Have Helios commit a package to a different port

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Have Helios commit a package to a different port

Brian Brown
Hello All,

I'm doing work with CouchDB apps, and Amber. Everything serves up nicely as one would expect. Since the CouchDB app environment essentially acts as virtual filesystem for serving web applications, the application is packaged up as a JSON document and attachments such as js, css, html, images, etc. 

My thought is this: 

  1. Serve the amber application through CouchDB (on the local system).
  2. Run "amber serve" on port 4000
  3. Modify Helios so that the "Commit package" functionality posts to port 4000.
  4. Modify the "amber serve" so that after it completes the package commit, it triggers a "couchapp push". 

This would allow Helios to be used as normal on the web app served from CouchDB, and still be able to round-trip the packages back to the folder structure representing the couchapp, and push it up to the couch server.

This seems to me to be the simplest way to accomplish the task, and since both the amber server and the CouchDB instance are on the same host, CORs should not be an issue.

As far as accomplishing this, after tracing classes and methods between Helios-Infrastructure, Kernel-ImportExport, Helios-Command-Tools, and the finally looking at the index.html for helios, my first thought is to add a 'transport.alternativeCommitBase' in the amber.initialize call, and then plug that through until it can be accessed by the ajax call that posts the package st and js.

Does this seem reasonable, doable, and not too naive?

Any feedback would be wonderful!

Thanks,

- Brian

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Herby Vojčík
1. Can't couchdb just serve GETs and accept PUTs normally? That would mean no "amber serve" is needed at all. To remind you, the Amber development process is _not_ bound to amber serve. It can use any server. amber serve is just convenience one. That's why it is unlikely to complicate it with a bridge to couchdb.

2. Can't you just write simple nodejs process that would watch all files in deirectory and in case on their change, doing the counchdb push?

Herby

Brian Brown wrote:

> Hello All,
>
> I'm doing work with CouchDB apps, and Amber. Everything serves up
> nicely as one would expect. Since the CouchDB app environment
> essentially acts as virtual filesystem for serving web applications,
> the application is packaged up as a JSON document and attachments such
> as js, css, html, images, etc.
>
> My thought is this:
>
>  1. Serve the amber application through CouchDB (on the local system).
>  2. Run "amber serve" on port 4000
>  3. Modify Helios so that the "Commit pa
ckage" functionality posts to

>     port 4000.
>  4. Modify the "amber serve" so that after it completes the package
>     commit, it triggers a "couchapp push".
>
>
> This would allow Helios to be used as normal on the web app served
> from CouchDB, and still be able to round-trip the packages back to the
> folder structure representing the couchapp, and push it up to the
> couch server.
>
> This seems to me to be the simplest way to accomplish the task, and
> since both the amber server and the CouchDB instance are on the same
> host, CORs should not be an issue.
>
> As far as accomplishing this, after tracing classes and methods
> between Helios-Infrastructure, Kernel-ImportExport,
> Helios-Command-Tools, and the finally looking at the index.html for
> helios, my first thought is to add a 'transport.alternativeCommitBase'
> in the amber.initialize call, and then plug that through until it can
> be accessed by the ajax call that posts the package st and js.
>
> Do
es this seem reasonable, doable, and not too naive?

>
> Any feedback would be wonderful!
>
> Thanks,
>
> - Brian
>
> --
> You received this message because you are subscribed to the Google
> Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

drush66
On Friday, November 14, 2014 11:52:32 AM UTC+1, Herby wrote:
2. Can't you just write simple nodejs process that would watch all files in deirectory and in case on their change, doing the counchdb push? 

It would be even more fun if there would be version of amber, or even better plugin for it, that would save sources directly to couchdb. In early days there was a version that did that for some other document database.

davorin

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Herby Vojčík
You can implement different transport. If you want to retain .js files as they are today (AMD module), you would probable need to rewrite / write plugin for requirejs.

It seems easier to me to actually be able to serve those files from couchdb directly, by transforming data in/out (I faintly remember there is sometihng that is able to ransform data while serving them; I would presume there is something as well for accepting them via PUT/POST as well; something akin to updateable VIEWs in old SQL).;

Davorin Ruševljan wrote:

> On Friday, November 14, 2014 11:52:32 AM UTC+1, Herby wrote:
>
>     2. Can't you just write simple nodejs process that would watch all
>     files in deirectory and in case on their change, doing the
>     counchdb push?
>
>
> It would be even more fun if there would be version of amber, or even
> better plugin for it, that would save sources directly to couchdb. In
> early days there was a version that did that for some other document
> database.

>
> davorin
>
> --
> You received this message because you are subscribed to the Google
> Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Brian Brown
In reply to this post by Herby Vojčík


On Friday, November 14, 2014 3:52:32 AM UTC-7, Herby wrote:
1. Can't couchdb just serve GETs and accept PUTs normally? That would mean no "amber serve" is needed at all. To remind you, the Amber development process is _not_ bound to amber serve. It can use any server. amber serve is just convenience one. That's why it is unlikely to complicate it with a bridge to couchdb.

Absolutely it can, and that is the normal way to work with it. GET, POST, PUT, DELETE of JSON documents. I infer from what you say that the transformation of the Smalltalk code to JavaScript code happens in the client and then is simply written back to the filesystem via the webdav interface. I was thinking the translation happened in the node process, similar to using stitch to piece together coffeescript files.
 
2. Can't you just write simple nodejs process that would watch all files in deirectory and in case on their change, doing the counchdb push?

Sure, the only files we would be worried about being pushed are images, css, and html, so a watcher would handle that. I would have to pull the design document first to make sure it had the latest changes made by amber, but that should be a minor thing. 
 
Given this, what Package/Classes should I look at to create the transport I would need?

Thanks much!


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Brian Brown
In reply to this post by Herby Vojčík


On Friday, November 14, 2014 6:21:25 AM UTC-7, Herby wrote:
You can implement different transport. If you want to retain .js files as they are today (AMD module), you would probable need to rewrite / write plugin for requirejs.

Well, CouchDB has a few different mechanisms for changing / transforming documents coming out of the DB, but in terms of amd modules and javascript files you can simply treat it as a regular web server filesystem, so I don't believe changing the requirejs infrastructure would be necessary, but I'm not sure, either.  
 
It seems easier to me to actually be able to serve those files from couchdb directly, by transforming data in/out (I faintly remember there is sometihng that is able to ransform data while serving them; I would presume there is something as well for accepting them via PUT/POST as well; something akin to updateable VIEWs in old SQL).;

Which files are you referring to? If I create a design document, and attach a JavaScript file to it, then I can directly pull the JavaScript file as with a normal web server with a URL like:

http://couch.server.local:5984/mydb/_design/amberapp/cool.js

In this case the JSON design document is "amberapp" (you could have many in one database), and the "cool.js" is a JavaScript file that is attached to the design document. So currently, I can create a design document and put the contents of the sample amber application in it's "_attachments" node, and the amber app works flawlessly. What I have is a Single Page app that isn't interacting with any of the other CouchDB features such as views/shows/lists, but now any document in this database is a relative URL away, as are any views/shows/lists I create.

Once I have a round trip design document working, then I would want to come up with a strategy for editing the view/show/list (map and reduce functions). 

If you could give me a high level of how the transport commit infrastructure works, I will take a stab at all this :)

- Brian
 

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Herby Vojčík
In reply to this post by Brian Brown


Brian Brown wrote:

>
>
> On Friday, November 14, 2014 3:52:32 AM UTC-7, Herby wrote:
>
>     1. Can't couchdb just serve GETs and accept PUTs normally? That
>     would mean no "amber serve" is needed at all. To remind you, the
>     Amber development process is _not_ bound to amber serve. It can use
>     any server. amber serve is just convenience one. That's why it is
>     unlikely to complicate it with a bridge to couchdb.
>
> Absolutely it can, and that is the normal way to work with it. GET,
> POST, PUT, DELETE of JSON documents. I infer from what you say that the
> transformation of the Smalltalk code to JavaScript code happens in the
> client and then is simply written back to the filesystem via the webdav
> interface.

Yes.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Herby Vojčík
In reply to this post by Brian Brown


Brian Brown wrote:

>
>
> On Friday, November 14, 2014 6:21:25 AM UTC-7, Herby wrote:
>
>     You can implement different transport. If you want to retain .js
>     files as they are today (AMD module), you would probable need to
>     rewrite / write plugin for requirejs.
>
> Well, CouchDB has a few different mechanisms for changing / transforming
> documents coming out of the DB, but in terms of amd modules and
> javascript files you can simply treat it as a regular web server
> filesystem, so I don't believe changing the requirejs infrastructure
> would be necessary, but I'm not sure, either.
>
>     It seems easier to me to actually be able to serve those files from
>     couchdb directly, by transforming data in/out (I faintly remember
>     there is sometihng that is able to ransform data while serving them;
>     I would presume there is something as well for accepting them via
>     PUT/POST as well; something akin to updateable VIEWs in old SQL).;
>
> Which files are you referring to? If I create a design document, and
> attach a JavaScript file to it, then I can directly pull the JavaScript
> file as with a normal web server with a URL like:
>
>     http://couch.server.local:5984/mydb/_design/amberapp/cool.js
>

If you would be able to also push it here (that is, issue a PUT
/mydb/_design/amberapp/cool.js), than you need nothing else. It would
just work.

> If you could give me a high level of how the transport commit
> infrastructure works, I will take a stab at all this :)

Well, Kernel-ImportExport builds the .js and PUTs it.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Brian Brown
Thanks again for helping me understand this. 

If you would be able to also push it here (that is, issue a PUT
/mydb/_design/amberapp/cool.js), than you need nothing else. It would
just work.

So the issue winds up being that I'm updating the design document that the .js file is attached to, so I need to provide the current revision number of the design document in the PUT and it should work. Right now it does the post to the correct path, but CouchDB returns 409 Conflict error because there is no revision number in the data.
 
> If you could give me a high level of how the transport commit
> infrastructure works, I will take a stab at all this :)

Well, Kernel-ImportExport builds the .js and PUTs it.

Thank you, sir. 

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Hannes Hirzel
http://guide.couchdb.org/draft/documents.html

<citation>
The revision ID acts as a gatekeeper for writes to a document in
CouchDB’s MVCC system. A document is a shared resource; many clients
can read and write them at the same time. To make sure two writing
clients don’t step on each other’s feet, each client must provide what
it believes is the latest revision ID of a document along with the
proposed changes. If the on-disk revision ID matches the provided
_rev, CouchDB will accept the change. If it doesn’t, the update will
be rejected. The client should read the latest version, integrate the
changes, and try saving again.
</citation>


On 11/14/14, Brian Brown <[hidden email]> wrote:

> Thanks again for helping me understand this.
>
>>
>> If you would be able to also push it here (that is, issue a PUT
>> /mydb/_design/amberapp/cool.js), than you need nothing else. It would
>> just work.
>>
>> So the issue winds up being that I'm updating the design document that the
>>
> .js file is attached to, so I need to provide the current revision number
> of the design document in the PUT and it should work. Right now it does the
>
> post to the correct path, but CouchDB returns 409 Conflict error because
> there is no revision number in the data.
>
>
>> > If you could give me a high level of how the transport commit
>> > infrastructure works, I will take a stab at all this :)
>>
>> Well, Kernel-ImportExport builds the .js and PUTs it.
>>
>
> Thank you, sir.
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Brian Brown
Yes, that is what I mentioned, I need to provide the revision number :)

Thanks!

On Sat, Nov 15, 2014 at 8:03 AM, H. Hirzel <[hidden email]> wrote:
http://guide.couchdb.org/draft/documents.html

<citation>
The revision ID acts as a gatekeeper for writes to a document in
CouchDB’s MVCC system. A document is a shared resource; many clients
can read and write them at the same time. To make sure two writing
clients don’t step on each other’s feet, each client must provide what
it believes is the latest revision ID of a document along with the
proposed changes. If the on-disk revision ID matches the provided
_rev, CouchDB will accept the change. If it doesn’t, the update will
be rejected. The client should read the latest version, integrate the
changes, and try saving again.
</citation>


On 11/14/14, Brian Brown <[hidden email]> wrote:
> Thanks again for helping me understand this.
>
>>
>> If you would be able to also push it here (that is, issue a PUT
>> /mydb/_design/amberapp/cool.js), than you need nothing else. It would
>> just work.
>>
>> So the issue winds up being that I'm updating the design document that the
>>
> .js file is attached to, so I need to provide the current revision number
> of the design document in the PUT and it should work. Right now it does the
>
> post to the correct path, but CouchDB returns 409 Conflict error because
> there is no revision number in the data.
>
>
>> > If you could give me a high level of how the transport commit
>> > infrastructure works, I will take a stab at all this :)
>>
>> Well, Kernel-ImportExport builds the .js and PUTs it.
>>
>
> Thank you, sir.
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to a topic in the Google Groups "amber-lang" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Hannes Hirzel
Hello Brian

Are you just serving the deployed Amber app out of couchdb only (works
fine for me)?

Or do you have as well the Amber IDE served out of couchDB by now?

--Hannes

On 11/17/14, Brian Brown <[hidden email]> wrote:

> Yes, that is what I mentioned, I need to provide the revision number :)
>
> Thanks!
>
> On Sat, Nov 15, 2014 at 8:03 AM, H. Hirzel <[hidden email]> wrote:
>
>> http://guide.couchdb.org/draft/documents.html
>>
>> <citation>
>> The revision ID acts as a gatekeeper for writes to a document in
>> CouchDB’s MVCC system. A document is a shared resource; many clients
>> can read and write them at the same time. To make sure two writing
>> clients don’t step on each other’s feet, each client must provide what
>> it believes is the latest revision ID of a document along with the
>> proposed changes. If the on-disk revision ID matches the provided
>> _rev, CouchDB will accept the change. If it doesn’t, the update will
>> be rejected. The client should read the latest version, integrate the
>> changes, and try saving again.
>> </citation>
>>
>>
>> On 11/14/14, Brian Brown <[hidden email]> wrote:
>> > Thanks again for helping me understand this.
>> >
>> >>
>> >> If you would be able to also push it here (that is, issue a PUT
>> >> /mydb/_design/amberapp/cool.js), than you need nothing else. It would
>> >> just work.
>> >>
>> >> So the issue winds up being that I'm updating the design document that
>> the
>> >>
>> > .js file is attached to, so I need to provide the current revision
>> > number
>> > of the design document in the PUT and it should work. Right now it does
>> the
>> >
>> > post to the correct path, but CouchDB returns 409 Conflict error
>> > because
>> > there is no revision number in the data.
>> >
>> >
>> >> > If you could give me a high level of how the transport commit
>> >> > infrastructure works, I will take a stab at all this :)
>> >>
>> >> Well, Kernel-ImportExport builds the .js and PUTs it.
>> >>
>> >
>> > Thank you, sir.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "amber-lang" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [hidden email].
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "amber-lang" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [hidden email].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Brian Brown

Hello Hannes,

I'm serving Helios as well, and can currently save packages back to couchDB. I will be posting some questions about where this should live, and I hope to add the ability to create and edit shows, views, and lists, but for now it does what I wanted.

- Brian

On Nov 29, 2014 5:39 AM, "H. Hirzel" <[hidden email]> wrote:
Hello Brian

Are you just serving the deployed Amber app out of couchdb only (works
fine for me)?

Or do you have as well the Amber IDE served out of couchDB by now?

--Hannes

On 11/17/14, Brian Brown <[hidden email]> wrote:
> Yes, that is what I mentioned, I need to provide the revision number :)
>
> Thanks!
>
> On Sat, Nov 15, 2014 at 8:03 AM, H. Hirzel <[hidden email]> wrote:
>
>> http://guide.couchdb.org/draft/documents.html
>>
>> <citation>
>> The revision ID acts as a gatekeeper for writes to a document in
>> CouchDB’s MVCC system. A document is a shared resource; many clients
>> can read and write them at the same time. To make sure two writing
>> clients don’t step on each other’s feet, each client must provide what
>> it believes is the latest revision ID of a document along with the
>> proposed changes. If the on-disk revision ID matches the provided
>> _rev, CouchDB will accept the change. If it doesn’t, the update will
>> be rejected. The client should read the latest version, integrate the
>> changes, and try saving again.
>> </citation>
>>
>>
>> On 11/14/14, Brian Brown <[hidden email]> wrote:
>> > Thanks again for helping me understand this.
>> >
>> >>
>> >> If you would be able to also push it here (that is, issue a PUT
>> >> /mydb/_design/amberapp/cool.js), than you need nothing else. It would
>> >> just work.
>> >>
>> >> So the issue winds up being that I'm updating the design document that
>> the
>> >>
>> > .js file is attached to, so I need to provide the current revision
>> > number
>> > of the design document in the PUT and it should work. Right now it does
>> the
>> >
>> > post to the correct path, but CouchDB returns 409 Conflict error
>> > because
>> > there is no revision number in the data.
>> >
>> >
>> >> > If you could give me a high level of how the transport commit
>> >> > infrastructure works, I will take a stab at all this :)
>> >>
>> >> Well, Kernel-ImportExport builds the .js and PUTs it.
>> >>
>> >
>> > Thank you, sir.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "amber-lang" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [hidden email].
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "amber-lang" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [hidden email].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to a topic in the Google Groups "amber-lang" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Hannes Hirzel
Hello Brian

Thanks for the answer. As of now I do not need the ability to create
and edit shows, views and lists for couchDB.

I am interested in loading Helios into a couchDB instance and saveing
a Smalltalk package back to couchDB. This is what you have done
successfully.

May I suggest that you post your findings in the ReadMe of your fork
of Helios (pull request), or in the wiki of the Helios project.

For example how did you load Helios into couchDB? I realize that in
the Helios project
   amber deploy
does not work and thus I do not get a single the.js file which I could
load easily into couchDB.

--Hannes

On 11/29/14, Brian Brown <[hidden email]> wrote:

> Hello Hannes,
>
> I'm serving Helios as well, and can currently save packages back to
> couchDB. I will be posting some questions about where this should live, and
> I hope to add the ability to create and edit shows, views, and lists, but
> for now it does what I wanted.
>
> - Brian
> On Nov 29, 2014 5:39 AM, "H. Hirzel" <[hidden email]> wrote:
>
>> Hello Brian
>>
>> Are you just serving the deployed Amber app out of couchdb only (works
>> fine for me)?
>>
>> Or do you have as well the Amber IDE served out of couchDB by now?
>>
>> --Hannes
>>
>> On 11/17/14, Brian Brown <[hidden email]> wrote:
>> > Yes, that is what I mentioned, I need to provide the revision number :)
>> >
>> > Thanks!
>> >
>> > On Sat, Nov 15, 2014 at 8:03 AM, H. Hirzel <[hidden email]>
>> wrote:
>> >
>> >> http://guide.couchdb.org/draft/documents.html
>> >>
>> >> <citation>
>> >> The revision ID acts as a gatekeeper for writes to a document in
>> >> CouchDB’s MVCC system. A document is a shared resource; many clients
>> >> can read and write them at the same time. To make sure two writing
>> >> clients don’t step on each other’s feet, each client must provide what
>> >> it believes is the latest revision ID of a document along with the
>> >> proposed changes. If the on-disk revision ID matches the provided
>> >> _rev, CouchDB will accept the change. If it doesn’t, the update will
>> >> be rejected. The client should read the latest version, integrate the
>> >> changes, and try saving again.
>> >> </citation>
>> >>
>> >>
>> >> On 11/14/14, Brian Brown <[hidden email]> wrote:
>> >> > Thanks again for helping me understand this.
>> >> >
>> >> >>
>> >> >> If you would be able to also push it here (that is, issue a PUT
>> >> >> /mydb/_design/amberapp/cool.js), than you need nothing else. It
>> >> >> would
>> >> >> just work.
>> >> >>
>> >> >> So the issue winds up being that I'm updating the design document
>> that
>> >> the
>> >> >>
>> >> > .js file is attached to, so I need to provide the current revision
>> >> > number
>> >> > of the design document in the PUT and it should work. Right now it
>> does
>> >> the
>> >> >
>> >> > post to the correct path, but CouchDB returns 409 Conflict error
>> >> > because
>> >> > there is no revision number in the data.
>> >> >
>> >> >
>> >> >> > If you could give me a high level of how the transport commit
>> >> >> > infrastructure works, I will take a stab at all this :)
>> >> >>
>> >> >> Well, Kernel-ImportExport builds the .js and PUTs it.
>> >> >>
>> >> >
>> >> > Thank you, sir.
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "amber-lang" group.
>> >> > To unsubscribe from this group and stop receiving emails from it,
>> >> > send
>> >> > an
>> >> > email to [hidden email].
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >> >
>> >>
>> >> --
>> >> You received this message because you are subscribed to a topic in the
>> >> Google Groups "amber-lang" group.
>> >> To unsubscribe from this topic, visit
>> >> https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
>> >> To unsubscribe from this group and all its topics, send an email to
>> >> [hidden email].
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "amber-lang" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [hidden email].
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "amber-lang" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [hidden email].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

sebastianconcept
In reply to this post by Brian Brown

On Nov 14, 2014, at 5:52 AM, Brian Brown <[hidden email]> wrote:

My thought is this: 

  1. Serve the amber application through CouchDB (on the local system).
  2. Run "amber serve" on port 4000
  3. Modify Helios so that the "Commit package" functionality posts to port 4000.
  4. Modify the "amber serve" so that after it completes the package commit, it triggers a "couchapp push". 

This would allow Helios to be used as normal on the web app served from CouchDB, and still be able to round-trip the packages back to the folder structure representing the couchapp, and push it up to the couch server.


Hi Brian, I’m curious about the motivation to do something like this.

What do you win by having code in couchdb (or any other json db) instead of just files?

 

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

Brian Brown

Hi Sebastian,

The motivation is recapturing some of the benefits of the Smalltalk image. Since the couchapp concept of CouchDB creates a self contained web application, and also efficiently serves the site, once you have Helios installed with your app, concerns about the filesystem, WebDAV, etc, go away. You also can take advantage of the built in replication to send not only the app, but it's data as well to any other couch installation.

On Jan 9, 2015 7:05 PM, "sebastian" <[hidden email]> wrote:

On Nov 14, 2014, at 5:52 AM, Brian Brown <[hidden email]> wrote:

My thought is this: 

  1. Serve the amber application through CouchDB (on the local system).
  2. Run "amber serve" on port 4000
  3. Modify Helios so that the "Commit package" functionality posts to port 4000.
  4. Modify the "amber serve" so that after it completes the package commit, it triggers a "couchapp push". 

This would allow Helios to be used as normal on the web app served from CouchDB, and still be able to round-trip the packages back to the folder structure representing the couchapp, and push it up to the couch server.


Hi Brian, I’m curious about the motivation to do something like this.

What do you win by having code in couchdb (or any other json db) instead of just files?

 

--
You received this message because you are subscribed to a topic in the Google Groups "amber-lang" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Have Helios commit a package to a different port

sebastianconcept
ah you want it to store not just declarative code but instances!

Thats interesting

I remember the guys on Dart wanting to reify state with that technique

sebastian

o/

On 10/01/2015, at 15:10, Brian Brown <[hidden email]> wrote:

Hi Sebastian,

The motivation is recapturing some of the benefits of the Smalltalk image. Since the couchapp concept of CouchDB creates a self contained web application, and also efficiently serves the site, once you have Helios installed with your app, concerns about the filesystem, WebDAV, etc, go away. You also can take advantage of the built in replication to send not only the app, but it's data as well to any other couch installation.

On Jan 9, 2015 7:05 PM, "sebastian" <[hidden email]> wrote:

On Nov 14, 2014, at 5:52 AM, Brian Brown <[hidden email]> wrote:

My thought is this: 

  1. Serve the amber application through CouchDB (on the local system).
  2. Run "amber serve" on port 4000
  3. Modify Helios so that the "Commit package" functionality posts to port 4000.
  4. Modify the "amber serve" so that after it completes the package commit, it triggers a "couchapp push". 

This would allow Helios to be used as normal on the web app served from CouchDB, and still be able to round-trip the packages back to the folder structure representing the couchapp, and push it up to the couch server.


Hi Brian, I’m curious about the motivation to do something like this.

What do you win by having code in couchdb (or any other json db) instead of just files?

 

--
You received this message because you are subscribed to a topic in the Google Groups "amber-lang" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/amber-lang/rh9heest5ZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.