[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[tns8] Embedding S8 environment in your app

Steps to include your snapshot in your app

  1. Add a new folder to host your s8 module under the ./app folder
  2. Copy your default.snapshot.js file to the ./app folder
  3. Edit the default.snapshot.js file adding the following lines at end
    exports.smalltalk = smalltalk;
    exports.nil = nil;

    Note: Use TextEdit app for editing the snapshot file, because Xcode editor is unusable for big source files.
  4. Create a package.json file in the ./app folder
  5. Edit the package.json file to contain
    {
    	"name" : "s8",
      	"main" : "s8",
    	"nativescript": {}
    }
  6. Add a require expression to use your image. e.g. in your app.js file you can add
    var s8 = require("./s8");
    
    after require("Application"); // to ensure the javascript app is ready to run