Code versioning

Our repository will deal with Major and Minor versioning.

Minor versions will be retro-compatible with all components to their rightside on the namespace and to their initial API docs.

Major versions can create new APIs and break compatibility.

Rule: no Major versions will be created unless the APIs is broken.

The versioning is directly represented in the code repository and the server's URL paths.

Syntax

http://js.sapo.pt/SlashedNamespaceAndClass/[MAJOR[.MINOR]]/

For example:

http://js.sapo.pt/SAPO/
http://js.sapo.pt/SAPO/Widgets/0.2/
http://js.sapo.pt/SAPO/Widgets/Calendars/1/

NOTE: the ending slash in the URL is highly recomended to avoid useless 301 redirects from the server.

The public repository will have symbolic links to the latest Major and Minor versions of each component.

If you wish to get the latest Minor of the Major 0 of the "SAPO" component, you can get it from this URL:

http://js.sapo.pt/SAPO/0/

If you wish to get the latest Minor and the latest Major of the "Sapo" component, you can get it from this URL:

http://js.sapo.pt/SAPO/

So, in theory if you write a Calendar application your include code can look like this:

...
<script type="text/javascript" src="http://js.sapo.pt/SAPO/2/">
<script type="text/javascript" src="http://js.sapo.pt/SAPO/Widgets/2/">
<script type="text/javascript" src="http://js.sapo.pt/SAPO/Calendar/2/">
...

This ensures that you'll always fecth the latest minor versions from major 2 from each component from the SAPO::Widgets.Calendar namespace and Calendar class.

This schema is basically a server-side, easy solution for Javascript auto-updates on the network.

Samples

Each component can include sample code for it's latest version (Major and Minor) for easy understanding of their API.

Samples can be reached using this syntax:

http://js.sapo.pt/SAPO/sample/
http://js.sapo.pt/SAPO/Widget/Calendar/sample/

Documentation

API documentation for each component will be maintained in this Wiki. The sample files referred above may contain a link to the component's Documentation.

Foreign libs

Some SAPO JS lib components depend on foreign libs like  Yahoo's UI lib and  Prototype.

Other foreign libs are maintained in the repository for convenience.

These will be hosted in our SVN and in the public server under this URL:

http://js.sapo.pt/YUI/Major.Minor/
http://js.sapo.pt/Prototype/Major.Minor/