Question

How does version control and collaboration work with Amber?

When I created a new package I saw that three files were created:

  • js/MyPackage.deploy.js
  • js/MyPackage.js
  • st/MyPackage.st

Do I need to put all of them under version control? Can I merge changes into only the .st file and have the Amber server pick them up?

Was it helpful?

Solution

First a short explanation of the three files:

  • st/MyPackage.st: the Smalltalk source also known as fileout
  • js/MyPackage.js: the equivalent to the Smalltalk source compiled to JS (including metadata such as Smalltalk sourcecode)
  • js/MyPackage.deploy.js: equals the other .js file but does not contain metadata not needed in deployment

To run an Amber application one of the .js files is needed. Which one depends on the deploy mode but for development the one without .deploy in the name is used.

The .js files in turn can be generated from the .st files using the Amber commandline compiler (e.g. through Grunt.js) or by doing a file-in in the IDE and commiting the relevant package.

In general, we keep all three files under version control but for now the most crucial ones are the .st files since those are usually easier to merge than generated JS code.

However, keeping and merging only the .st files is not sufficient since those are not loadable by Amber. Nico for example uses a local git hook to recompile the .st files upon pulling the latest changes. See this message from the Amber mailinglist.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top