Skip to content

Commit

Permalink
New Release (#239)
Browse files Browse the repository at this point in the history
* Support float for pixel calculation

* Fix border:none

* Fix stretching images inside image buttons

* Fixing tableview inset bug

* Allow video inline play + auto play

* allow autoplay + inline play video for background html container

* Proper dimension handling for all

* Authenticated image fix for preloading

* Local variable should be set even before making a change to a form component

* Do not pre-render header and footer (Causes crash in some cases)

* Fixing header/footer render timing issue

* Bugfix for SDWebImageDownloader SDWebImage/SDWebImage#1209

* Fixing tabor extended layout problem

* Readme update

* Fix bottom padding on tab bar icons

* Render even if data is an empty object

* Fixing chat input glitch

* Fix for when hiding bottom input field

* Bottom tab bar should only load with white background when opening modal

* Cancel all currently running actions when transitioning away to a different tab

* Allow user interaction even when “loading: true” is set

* Null fix

* Local file support for buttons, images, menus

This allows users to use file:// prefix on what used to be all remote files for images within the Jasonette framework so that images files don’t have to be downloaded in cases where it’s static content for the mobile app.

* Use UIAlertController instead of a 3rd party library

* Use only “title” (not “description”)

* Return error values for $network.request

* Change NSMutableDictionary to NSDictionary

* Local JSON read refactor => moved to helper

* local $require support

* Local image support for body.style.background + layers.image

* Local image support for footer.input

* $global

* Annotation

* $audio.record fix

* Added data_uri

* $util.share expects NSURL, not NSString

* Proper stringified file_url for $media.camera and $media.picker

* Fix animated gifs in image components

* Animated GIF support for layers, buttons, and background

* Tinted image fix

* $env

* Revert tint to original approach

* Fix tinted image memory issue

* Added $env.device.language

* search bar fix

* error.json + loading.json support

* Handling cases where the key is a template expression

* Default loading:NO => use loading.json instead

* Fixing onLoad for loading offline JSON

* Exception handling for when $get, $params are not set.

* Clear stack&register before $back - see #228

* Tabbar should stick around during loading.json

* Remove tab switching delay

* Bugfix: loadViewByFile has two types: final and intermediate.

* Fix loading issue with header/footer + Diff-based Optimization

* Updated policy for $show and $load

* Trigger only if an action is not empty

* If coming back from a view with no tabs, force-reconstruct tabs

* Throw an error to the Jason client on bad URL

Any urls that contain bad variable names or other errors just crash the app right now. This would throw error message to the log and error handler.

* Handle empty string error for $network.request

* JASONResponseSerializer

* It’s not final until the view completely finishes loading

* Require should end with the same URL it started with

* Make sure network actions end with the same url as it started
  • Loading branch information
gliechtenstein authored Jul 14, 2017
1 parent 733ea1e commit 9453993
Show file tree
Hide file tree
Showing 58 changed files with 6,369 additions and 6,571 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ Create your own native iOS app with nothing but JSON. Then send it over the Inte

Looking for an Android version? [See here](https://www.github.com/Jasonette/JASONETTE-Android)

##★ Jasonette fetches this JSON markup from a server:
## ★ Jasonette fetches this JSON markup from a server:

![json](https://raw.githubusercontent.com/gliechtenstein/images/master/json.png)

##★ And self-constructs into the following native app, in realtime:
## ★ And self-constructs into the following native app, in realtime:

![instagram](https://github.com/Jasonette/Instagram-UI-example/blob/master/images/instagram.gif)

<br>

#Cool things about Jasonette
# Cool things about Jasonette

- **100% NATIVE**: Jasonette maps JSON into native components and native function calls. There is no gimmick. There is no magic.
- **App loads over HTTP**: Your app exists 100% as JSON, and loads from the cloud. No more hard-coding.
Expand Down Expand Up @@ -51,7 +51,7 @@ Try playing these on Jasonette and watch them turn into native apps in front of

# Technical Highlights

##1. One JSON to rule them all
## 1. One JSON to rule them all

Jasonette simplifies the entire app building process down to nothing more than:

Expand All @@ -69,7 +69,7 @@ This is possible because Jasonette came up with a way to **fit an entire app wor

<br>

##2. App-over-HTTP
## 2. App-over-HTTP
Until now, the only thing JSON could send over the Internet was raw data. Normally apps would fetch remote data from the server for a connected experience, but the actual app logic would be hard-coded on the client side. This makes it hard to update and extend apps.

But what happens when you can express an entire app logic as JSON?
Expand All @@ -80,13 +80,13 @@ But what happens when you can express an entire app logic as JSON?

<br>

##3. Designed to be extended or integrated
## 3. Designed to be extended or integrated
Currently Jasonette covers all the essential native APIs and components, which means you can build pretty much any app you can imagine. But Jasonette is very flexible.

###A. Extensible
### A. Extensible
If you don't see a feature you want, you can simply [extend Jasonette](https://jasonette.github.io/documentation/advanced/#extension-vs-integration). If it's useful for the general public, we can even merge it into the core.

###B. Integrate existing code
### B. Integrate existing code
You can even [integrate Jasonette with your existing iOS project](https://jasonette.github.io/documentation/advanced/#extension-vs-integration) if you want. This way you can use Jasonette for just a small part of your app without having to completely switch to a new way of programming.

<br>
Expand Down
46 changes: 33 additions & 13 deletions app/Jasonette.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

/* Begin PBXBuildFile section */
042852531E984B890081F742 /* NoPaddingButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 042852521E984B890081F742 /* NoPaddingButton.m */; };
043814161EF7455800CC4706 /* JasonGlobalAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 043814151EF7455800CC4706 /* JasonGlobalAction.m */; };
045C77E91F0278EA00F06598 /* loading.json in Resources */ = {isa = PBXBuildFile; fileRef = 045C77E81F0278EA00F06598 /* loading.json */; };
045C77EB1F02791D00F06598 /* error.json in Resources */ = {isa = PBXBuildFile; fileRef = 045C77EA1F02791D00F06598 /* error.json */; };
045C77F11F029BEC00F06598 /* parser.js in Resources */ = {isa = PBXBuildFile; fileRef = 045C77F01F029BEC00F06598 /* parser.js */; };
045E5F3D1E3661060088D5E6 /* JasonReturnAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 045E5F3C1E3661060088D5E6 /* JasonReturnAction.m */; };
0489E5CF1E7B3EF40046FFA5 /* parser.js in Resources */ = {isa = PBXBuildFile; fileRef = 0489E5CE1E7B3EF40046FFA5 /* parser.js */; };
04EEDCFE1E02F5180023114F /* demo.json in Resources */ = {isa = PBXBuildFile; fileRef = 04EEDCFC1E02F5180023114F /* demo.json */; };
04EEDCFF1E02F5180023114F /* hello.json in Resources */ = {isa = PBXBuildFile; fileRef = 04EEDCFD1E02F5180023114F /* hello.json */; };
04D947EB1F16ACF50063CC65 /* JASONResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 04D947EA1F16ACF50063CC65 /* JASONResponseSerializer.m */; };
5E09562D1DA33515007ADC78 /* JasonLabelComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E09562C1DA33514007ADC78 /* JasonLabelComponent.m */; };
5E0956301DA34D70007ADC78 /* JasonImageComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E09562F1DA34D6F007ADC78 /* JasonImageComponent.m */; };
5E0956331DA34EEA007ADC78 /* JasonButtonComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E0956321DA34EEA007ADC78 /* JasonButtonComponent.m */; };
Expand Down Expand Up @@ -78,11 +80,15 @@
/* Begin PBXFileReference section */
042852511E984B890081F742 /* NoPaddingButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoPaddingButton.h; sourceTree = "<group>"; };
042852521E984B890081F742 /* NoPaddingButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoPaddingButton.m; sourceTree = "<group>"; };
043814141EF7455800CC4706 /* JasonGlobalAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JasonGlobalAction.h; sourceTree = "<group>"; };
043814151EF7455800CC4706 /* JasonGlobalAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JasonGlobalAction.m; sourceTree = "<group>"; };
045C77E81F0278EA00F06598 /* loading.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = loading.json; sourceTree = "<group>"; };
045C77EA1F02791D00F06598 /* error.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = error.json; sourceTree = "<group>"; };
045C77F01F029BEC00F06598 /* parser.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = parser.js; sourceTree = "<group>"; };
045E5F3B1E3661060088D5E6 /* JasonReturnAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JasonReturnAction.h; sourceTree = "<group>"; };
045E5F3C1E3661060088D5E6 /* JasonReturnAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JasonReturnAction.m; sourceTree = "<group>"; };
0489E5CE1E7B3EF40046FFA5 /* parser.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = parser.js; sourceTree = "<group>"; };
04EEDCFC1E02F5180023114F /* demo.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = demo.json; sourceTree = "<group>"; };
04EEDCFD1E02F5180023114F /* hello.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hello.json; sourceTree = "<group>"; };
04D947E91F16ACF50063CC65 /* JASONResponseSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JASONResponseSerializer.h; sourceTree = "<group>"; };
04D947EA1F16ACF50063CC65 /* JASONResponseSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JASONResponseSerializer.m; sourceTree = "<group>"; };
1BD8E8486EE7AF4E4934685E /* Pods-Jasonette.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Jasonette.release.xcconfig"; path = "Pods/Target Support Files/Pods-Jasonette/Pods-Jasonette.release.xcconfig"; sourceTree = "<group>"; };
2F0FCC971E030AF932E421D4 /* Pods_Jasonette.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Jasonette.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5E025B471DE017EB0016786A /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -217,6 +223,15 @@
name = Pods;
sourceTree = "<group>";
};
043814171EF7455E00CC4706 /* $global */ = {
isa = PBXGroup;
children = (
043814141EF7455800CC4706 /* JasonGlobalAction.h */,
043814151EF7455800CC4706 /* JasonGlobalAction.m */,
);
name = $global;
sourceTree = "<group>";
};
045E5F3E1E36610B0088D5E6 /* $return */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -347,6 +362,7 @@
045E5F3E1E36610B0088D5E6 /* $return */,
5E3177AB1D1F297400D87778 /* $timer */,
5E3177AA1D1F296300D87778 /* $util */,
043814171EF7455E00CC4706 /* $global */,
);
name = Action;
sourceTree = "<group>";
Expand Down Expand Up @@ -404,7 +420,7 @@
isa = PBXGroup;
children = (
5E31769B1D1E411E00D87778 /* csv.js */,
0489E5CE1E7B3EF40046FFA5 /* parser.js */,
045C77F01F029BEC00F06598 /* parser.js */,
5E3176F41D1E411E00D87778 /* rss.js */,
);
name = Lib;
Expand Down Expand Up @@ -444,6 +460,8 @@
children = (
5E3176D11D1E411E00D87778 /* JasonNetworkAction.h */,
5E3176D21D1E411E00D87778 /* JasonNetworkAction.m */,
04D947E91F16ACF50063CC65 /* JASONResponseSerializer.h */,
04D947EA1F16ACF50063CC65 /* JASONResponseSerializer.m */,
);
name = $network;
sourceTree = "<group>";
Expand Down Expand Up @@ -506,9 +524,9 @@
5E3177AC1D1F2A8200D87778 /* file:// */ = {
isa = PBXGroup;
children = (
04EEDCFC1E02F5180023114F /* demo.json */,
04EEDCFD1E02F5180023114F /* hello.json */,
5E31777B1D1F199D00D87778 /* Images */,
045C77E81F0278EA00F06598 /* loading.json */,
045C77EA1F02791D00F06598 /* error.json */,
);
name = "file://";
sourceTree = "<group>";
Expand Down Expand Up @@ -727,17 +745,17 @@
5E3177781D1E414C00D87778 /* Media.xcassets in Resources */,
5E3840751D3A3D2200D1C421 /* placeholderr@2x.png in Resources */,
5E3177291D1E411F00D87778 /* csv.js in Resources */,
04EEDCFE1E02F5180023114F /* demo.json in Resources */,
5E31771E1D1E411F00D87778 /* JasonVerticalSectionItem.xib in Resources */,
5E31777A1D1E4A8E00D87778 /* settings.plist in Resources */,
0489E5CF1E7B3EF40046FFA5 /* parser.js in Resources */,
045C77F11F029BEC00F06598 /* parser.js in Resources */,
5E3177251D1E411F00D87778 /* JasonHorizontalSectionItem.xib in Resources */,
5E3177371D1E411F00D87778 /* icon-info.png in Resources */,
04EEDCFF1E02F5180023114F /* hello.json in Resources */,
5E3177531D1E411F00D87778 /* Next@2x.png in Resources */,
5E31773A1D1E411F00D87778 /* icon-success@2x.png in Resources */,
5E3177671D1E411F00D87778 /* rss.js in Resources */,
5E3177481D1E411F00D87778 /* LaunchScreen.storyboard in Resources */,
045C77E91F0278EA00F06598 /* loading.json in Resources */,
045C77EB1F02791D00F06598 /* error.json in Resources */,
5E3177361D1E411F00D87778 /* icon-error@2x.png in Resources */,
5E31775F1D1E411F00D87778 /* placeholder@2x.png in Resources */,
5E3177391D1E411F00D87778 /* icon-success.png in Resources */,
Expand All @@ -761,7 +779,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
4838282BA327C039BDB24767 /* [CP] Copy Pods Resources */ = {
Expand Down Expand Up @@ -833,6 +851,7 @@
5E0956421DA34F4D007ADC78 /* JasonSpaceComponent.m in Sources */,
5E3177701D1E411F00D87778 /* UIBarButtonItem+Badge.m in Sources */,
5E0956361DA34EFC007ADC78 /* JasonTextareaComponent.m in Sources */,
043814161EF7455800CC4706 /* JasonGlobalAction.m in Sources */,
5EF904361DD10F7000C8A94E /* JasonLogAction.m in Sources */,
5E3177A31D1F28C100D87778 /* JasonCacheAction.m in Sources */,
045E5F3D1E3661060088D5E6 /* JasonReturnAction.m in Sources */,
Expand All @@ -842,6 +861,7 @@
5E31774C1D1E411F00D87778 /* JasonMediaAction.m in Sources */,
5E3177241D1E411F00D87778 /* JasonHorizontalSectionItem.m in Sources */,
5E3177221D1E411F00D87778 /* JasonHorizontalSection.m in Sources */,
04D947EB1F16ACF50063CC65 /* JASONResponseSerializer.m in Sources */,
5E3177301D1E411F00D87778 /* JasonGeoAction.m in Sources */,
5E3177591D1E411F00D87778 /* JasonOauthAction.m in Sources */,
);
Expand Down
13 changes: 13 additions & 0 deletions app/Jasonette/JASONResponseSerializer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// JASONResponseSerializer.h
// Jasonette
//
// Created by e on 7/12/17.
// Copyright © 2017 Jasonette. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>

@interface JASONResponseSerializer : AFJSONResponseSerializer

@end
26 changes: 26 additions & 0 deletions app/Jasonette/JASONResponseSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// JASONResponseSerializer.m
// Jasonette
//
// Created by e on 7/12/17.
// Copyright © 2017 Jasonette. All rights reserved.
//

#import "JASONResponseSerializer.h"

@implementation JASONResponseSerializer
- (id)responseObjectForResponse:(NSURLResponse *)response
data:(NSData *)data
error:(NSError *__autoreleasing *)errorPointer
{
id responseObject = [super responseObjectForResponse:response data:data error:errorPointer];
if (*errorPointer) {
NSError *error = *errorPointer;
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
userInfo[@"responseObject"] = responseObject;
*errorPointer = [NSError errorWithDomain:error.domain code:error.code userInfo:[userInfo copy]];
}
return responseObject;
}

@end
6 changes: 5 additions & 1 deletion app/Jasonette/Jason.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
@property (strong, nonatomic) NSDictionary *data;
@property (strong, nonatomic) NSDictionary *options;
@property (strong, nonatomic) NSDictionary *rendered;
@property (strong, nonatomic) NSDictionary *global;
@property (strong, nonatomic) NSMutableArray *playing;
@property (nonatomic, assign) BOOL touching;
@property (nonatomic, assign) BOOL searchMode;
Expand All @@ -42,9 +43,12 @@
- (void)ok;
- (void)ok:(NSDictionary *)result;
- (void)finish;

- (void)error:(id)result withOriginalUrl:(NSString*)url;
- (void)error:(id)result;
- (void)error;

- (void)success:(id)result withOriginalUrl:(NSString*)url;
- (void)success:(id)result;
- (void)success;

Expand All @@ -64,6 +68,6 @@
- (void)onRemoteNotification: (NSDictionary *)payload;
- (void)onRemoteNotificationDeviceRegistered: (NSString *)device_token;

- (void)loadViewByFile: (NSString *)url;
- (void)loadViewByFile: (NSString *)url asFinal: (BOOL)final;
- (NSDictionary *)variables;
@end
Loading

0 comments on commit 9453993

Please sign in to comment.