Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-1.3.0 #88

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions source/_main_download.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
.offset1.span6
.row
.span6
%h3 Latest Version: 1.0.0 (September 4 2018)
%h3 Latest Version: 1.3.0 (November X 2022)
.row
.span6
%a.btn.btn-primary.btn-large.starter{:style=>'margin-right: 20px;', :href => "/downloads/CappuccinoStarter-1.0.0.zip"}
%a.btn.btn-primary.btn-large.starter{:style=>'margin-right: 20px;', :href => "https://github.com/cappuccino/cappuccino/wiki/node"}
%img{:alt => "Cloud", :src => "img/white-cloud.png"}
Starter Package
npm install -g @objj/cappuccino
.row
.span6
%ul.download-links
Expand All @@ -29,14 +29,6 @@
%a.scroller{:href => "/downloads.html#archive"}
Older Versions

.row
.span12
%p
Beyond the starter pack, Cappuccino comes with a number of tools to make it easy to create new applications. With or without the starter pack, you can install all of Cappuccino and accompanying tools with the following command:
%pre
%code
curl https://raw.githubusercontent.com/cappuccino/cappuccino/v1.0.0/bootstrap.sh >/tmp/cb.sh && bash /tmp/cb.sh

#what-next
.container
%h2.section_header
Expand Down
85 changes: 85 additions & 0 deletions source/blog/2022-11-14-cappuccino-1-3-is-announced.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: The release of Cappuccino 1.3 --- Full support for ECMAScript 2022 in Objective-J!
author: Martin Carlberg
date: '2022-11-14'
tags:
- cappuccino
- release
- update
categories:
- Uncategorized
---


#### Details

We are excited to announce the release of version 1.3 of the Cappuccino frameworks with full support for ECMAScript 2022 in Objective-J.

This includes support for Promises including async and await. You can now write code like this:

:::objj
- (async @action)doAction:(id)sender {
const { response, data, error } = await [CPURLConnection sendAsynchronousRequest:[CPURLRequest requestWithURL:@"http://cappuccino.dev"]];
if (error == nil) {
//do the stuff...
} else {
// Handle errors
}
}

Here is another hany use case of async / await:

:::objj
- (async CPView)getMyView {
var aView = await [self loadTopView];

if (aView) {
[self addViewAsTop:aView];
} else {
aView = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
}

return aView;
}

The new language features are very convenient to use Object Destructuring when working with CPPoint, CPRect and CPSize.

This will assign x and y with 12 and 13

:::objj
let { x, y } = CPPointMake(12, 13)

The variables can have their own names too. This will assign myX and myY with 12 and 13:

:::objj
let { x: myX, y: myY } = CPPointMake(12, 13)

This also works with more complex things like a CPRect.

:::objj
let { origin: { x: myX, y: myY }, size: { width: myWidth, height: myHeight } } = CPRectMake(20, 10, 100, 200)

The new Arrow Functions also make the code look a little bit cleaner.

:::objj
let array = [1,2,3,4,5,6,7,8,9]
let result = 0
[array enumerateObjectsUsingBlock:e => result += e]

This will add all numbers in the array and assign it to the variable result. The old code looked like this:

:::objj
let array = [1,2,3,4,5,6,7,8,9]
let result = 0
[array enumerateObjectsUsingBlock:function(e) { result += e }]

Another nice new feature is "for of". It works the way it should work and not like the old "for in"

:::objj
let array = [1,2,3,4,5,6,7,8,9]
for (const element of array) {
console.log(element) // prints the element
}

_- Martin Carlberg_

11 changes: 11 additions & 0 deletions source/cappuccino-release-notes.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ title: Cappuccino Release Notes
layout: markdown
---

## What's New in Cappuccino 1.3.0

*Release date: 2022-?-?*

Cappuccino 1.3.0 introduces full support for ECMAScript 2022 in Objective-J. This includes `async` and `await`.

Highlights in this release:

* Full support for ECMAScript 2022 in Objective-J.
* Many bugixes and minor improvements.

## What's New in Cappuccino 0.9.10

*Release date: 2017-07-11*
Expand Down