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

[TIMOB-26015] Android/iOS: Refactored "app.js" launch handling #10112

Merged
merged 26 commits into from
Sep 19, 2018

Conversation

jquick-axway
Copy link
Contributor

@jquick-axway jquick-axway commented Jun 16, 2018

JIRA:

Summary:

  • Added a new "titanium_mobile/common/Resources" JavaScript folder.
    • Provides JS files/extensions intended to be shared by across all platforms.
  • Android/iOS now launch using new ti.main.js instead of app.js.
    • Used to load JS extension/bootstrap scripts that are shared on all platforms.
    • Loads app.js once finished loading everything.
  • Now logs app version and Titanium version on startup via ti.main.js instead of from native code.
    • New Message: <AppName> <AppVer> (Powered by Titanium <TiVer>.<TiBuildHash>)
  • TIMOB-26015 Added bootstrap script support.
    • All files named bootstrap.js or end with name *.bootstrap.js under the "Resources" directory will be automatically required-in before app.js gets loaded. This is a recursive search.
    • This is the CommonJS equivalent of native Android module's onAppCreate() or iOS module's load() method.
    • Bootstrap script can support optional exports.execute(finishedCallback) method intended to display UI to end-user. Will not load app.js until given callback is invoked.
  • TIMOB-26124 Fixed bug where Ti.buildHash always returned null on Android as of Titanium 6.0.0.
    • Was a typo in scons-build.js and scons-cleanbuild.js scripts.
    • Fix needed by new Titanium version logging on app startup. (Build hash needed to differentiate between RC and GA versions.)
  • TIMOB-26128 Modified Android build system to include asset directory names have a leading underscore '_'.
    • This was an intentional limitation in Google's aapt Android command line tool.
    • Solved by using appt command line argument --ignore-assets and omitting <dir>_* from filter list.
  • TIMOB-25899 Modified JS Error object to expose non-enumerable properties via JSON.stringify().
    • Was always returning "{}" on Android since none of the V8 Error object properties are enumerable.
    • Also modified to reveal stack property on iOS. (Not enumerable in JavaScriptCore.)
    • Solved by adding toJSON() method to Error object prototype. (See: ./common/Resources/ti.internal/extensions/Error.js)
    • Implementing this was not needed for this PR, but it's a proof of concept on how JS prototype can be extended on all platforms in Titanium's core JS code.
  • TIMOB-26144 Significantly improved Android's performance in accessing files/directories under the "Resources" directory.
    • The File.getDirectoryListing() performance is now about 20x faster. The isDirectory(), isFile(), and existence() calls have been improved too.
    • Now stores a hash table of all file/directory paths under the APK's "assets" folder for quick existence checks. Paths are now obtained by accessing APK as a zip file and fetching its zip entries, which is significantly faster than AssetManager.list() calls.
  • TIMOB-26217 iOS: Added missing Ti.Filesystem.File methods isFile() and isDirectory() when referencing an encrypted asset.
    • Was causing JS runtime errors in bootstrap recursive search.
  • TIMOB-16678 Modified Android File.read() to not return an empty string when referencing an encrypted asset.
    • Needed to access new bootstrap.json for device/production builds.

Notes:

  • I purposely did not document the new *.bootstrap.js handling in our API docs. We should dog-food it first to see how much we like it before setting it in stone. Plus we may want it to use Promises in the future (this feature is missing on iOS 9 at the moment).
  • We plan on having our ti.playservices module take advantage of the bootstrapping feature in 7.4.0. It's needed to check/install/update "Google Play Services" before loading the app.js.

Test:
Perform the below tests on the following:

  • Android device without LiveView (This tests encrypted asset handling.)
  • Android emulator (This tests APK's "assets" handling.)
  • iOS device
  • iOS emulator
  • iOS 8 (This tests oldest JavaScript engine version handling.)

Test procedure:

  1. Build and run the app with the below app.js and ui.bootstrap.js code. Note that the ui.bootstrap.js needs to be next to the app.js file under the Resources directory.
  2. On app startup, verify that an alert is displayed stating that it was launched by a bootstrap.
  3. Tap on the "OK" button.
  4. Next the app.js will have loaded, displaying a JavaScript Error object in JSON form. (This verifies that our core JS extensions have been loaded.)
  5. If running on iOS, verify that the displayed JSON contains a "stack" entry. (This used to be excluded on iOS.)
  6. If running on Android, verify that the displayed JSON is not an empty "{}". The JSON should display entries "message" and "stack".
  7. If running on Android, press the "Back" button and then restart the app. Verify that the bootstrap alert dialog (mentioned in step 2) is shown again.

app.js

var window = Ti.UI.createWindow({ fullscreen: true });
var scrollView = Ti.UI.createScrollView({
	layout: "vertical",
	showHorizontalScrollIndicator: false,
	shorVerticalScrollIndicator: true,
	width: Ti.UI.FILL,
	height: Ti.UI.FILL,
});
scrollView.add(Ti.UI.createLabel({
	text: "JSON.stringify(new Error('My error message'))",
	width: Ti.UI.FILL,
	top: "10dp",
}));
scrollView.add(Ti.UI.createLabel({
	text: JSON.stringify(new Error('My error message'), null, 4),
	width: "100%",
}));
window.add(scrollView);
window.open();

ui.bootstrap.js

exports.execute = function(finished) {
	var dialog = Ti.UI.createAlertDialog({
		title: 'Alert Dialog',
		message: 'This dialog was launched by a bootstrap script.',
		buttonNames: ['OK'],
		cancel: 0,
	});
	dialog.addEventListener('click', function(e) {
		finished();
	});
	dialog.show();
};

- Added a new "titanium_mobile/templates/core/Resources" JavaScript folder.
  * Provides JS files/extensions intended to be shared by all platforms.
- Android/iOS now launch using new "ti.shell.js" instead of "app.js"
  * Used to load JS extension/bootstrap scripts that are shared on all platforms.
  * Loads "app.js" once finished loading everything.
- Now logs app version and Titanium version on startup via "ti.shell.js" instead of from native code.
  * New Message: "<AppName> <AppVer> (Powered by Titanium <TiVer>.<TiBuildHash>)"
- [TIMOB-26015] Added bootstrap script support.
  * All files named "bootstrap.js" or end with name "*.bootstrap.js" will be automatically required-in before "app.js" gets loaded.
  * This is the CommonJS equivalent of native Android module's onAppCreate() or iOS module's load() method.
  * Bootstrap script can support optional "exports.execute(finishedCallback)" method intended to display UI to end-user. Will not load "app.js" until given callback is invoked.
- [TIMOB-26124] Fixed bug where "Ti.buildHash" always returned null on Android as of Titanium 6.0.0.
  * Was a typo in "scons-build.js" and "scons-cleanbuild.js" scripts.
- [TIMOB-26128] Modified Android build system to support including asset directory names have a leading underscore '_'.
  * Solved by using "appt" command line argument "--ignore-assets" and omitting "<dir>_*" from the filter.
- [TIMOB-26118] Added ES6 String methods to iOS 8.
  * Needed by new bootstrap script feature.
  * Implemented via new JS extensions feature. (See: ./templates/core/Resources/_ti/extensions/String.js)
- [TIMOB-25899] Modified JS "Error" object to expose non-enumerable properties via JSON.stringify().
  * Was always returning "{}" on Android since none of the V8 "Error" object properties are enumerable.
  * Also modified to reveal "stack" property on iOS.
  * Solved by adding toJSON() method to Error object prototype. (See: ./templates/core/Resources/_ti/extensions/Error.js)
Copy link
Contributor

@sgtcoolguy sgtcoolguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some general comments:

  • The location in the repo of these common JS files still feels odd to me. I'm not a fan of shoving it under a templates subfolder. If this is truly cross-platform public API, then it should probably be at a top-level folder as a sibling to iphone/android (i.e. titanium_mobile/common)
  • Also, the name of ti.shell.js feels off to me.
  • How do we handle errors in the bootstrapping? Looks like we don't really have any error-handling here, so I guess we basically blow up?
  • Is there a noticeable performance hit? I know that Node basically writes the js code in "core" into a C array to avoid file I/O to improve perf there (and that's what we do in Android for some situations, I believe?)
  • Do we anticipate platform-specific "bootstrap" code, or API extensions? Would they just get placed under platform specific sub-folders as in normal apps? We already have core JS code for Android, do we anticipate trying to incorporate that, or leaving it as-is?

I'm also concerned that we have multiple avenues of extending the app/API via common JS code - obviously there's CommonJS modules, but they wouldn't have the opportunity to be involved in the bootstrapping process right now. Is this expected to be limited to us SDK developers to be contributing these? It appears that a developer could potentially place files in a specific location in their app to play along.

}

@Override
public boolean isDirectory()
{
if (statsFetched) {
return this.exists && this.typeDir;
if (this.statsFetched == false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason there's a companions to false rather than typical !this.statsFetched?

fetchBootstrapScriptsFrom(resourceDirectory);

// Sort the bootstrap scripts so that they'll be loaded in a consistent order between platforms.
bootstrapScripts.sort();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some docs/help on what exactly the order will be? Obviously different OSes may sort differently naturally, so this is a potential point of confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about that too. I'm not quite sure if calling JavaScript Array.sort() without any arguments guarantees the order across platforms actually. I see that Mozilla describes it's sorted according to Unicode code point and Microsoft sorts it in ASCII character order, and ECMAScript spec says it orders according to ToString() comparison (Do they describe same thing? I'm not sure). Maybe we might want to place compareFunction explicitly to avoid confusion.

Copy link
Contributor

@infosia infosia Jun 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that we want to give scripts a chance to define order of the bootstrap script by exposing priority like exports.priority but for now I'm almost fine with current implementation. I think simply sorting files according to file names would work well for developers. For instance in case developer wants to bootstrap network scripts before UI scripts, just rename bootstrap files like

001.something_to_boot_Network.js
002.something_to_boot_UI_theme.js
003.google_play.js


// Fetches all "*.bootstrap.js" files under given directory and adds them to the "bootstrapScripts" array.
// The names stored in the array can be loaded via require() method.
function fetchBootstrapScriptsFrom(file) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move these function declarations out to top-level?

@jquick-axway
Copy link
Contributor Author

@sgtcoolguy, thanks for your feedback.

The location in the repo of these common JS files still feels odd to me.

I agree. Although after doing a packing/install, a "common" folder already exists and we've put a "simplejson" tool there (I don't agree with this; should be under a "bin" or "tools" folder). How about I put the shared JS files under "titanium_mobile/core"?

the name of ti.shell.js feels off to me.

The name seemed appropriate since Titanium is a JavaScript wrapper for the app and the OS' native APIs, similar to how a Unix shell provides a script interface to the OS' native APIs. The "ti.shell" wraps the "apps.js", controls how the app launches, and provides our own custom JS API extensions. I kind of like the name. Do you have another name in mind?

How do we handle errors in the bootstrapping?

We don't. This is intentional and makes it easier to debug the bootstrap script.

The bootstrap.execute() method is mostly intended to display UI to the end-user and it might be a very long operation. On Android, uses-cases would be to show UI to download/install Google Play Services and in the future Google Play Expansions files which can be up to 2 GB. Since this can be a long job, we should not impose any timeouts. And the bootstrap should be allowed to back/exit out of the app too without loading the "app.js" in case the end-user refused to do the download or is unable to (no Internet connection). Bootstraps like these need to guarantee that their job was completed before loading the "app.js" or else you'll run into other problems. And any bugs in a bootstrap script that causes the app to "blow-up" will need to be fixed.

Is there a noticeable performance hit?

Fair question. I'll do some more measurements/testing and get back to you on this.

As a quick summary for now, I have a test app that has about 160 JavaScript files in the root Resources directory. The amount of files in the directory listing is definitely a factor. The overhead is about 100 ms in the iOS Simulator and 140-1000 ms on various Android device. The 1 second overhead came from my slowest Android device that takes 10 seconds to start an app without my changes (I'm not happy about this). This can be optimized.

Do we anticipate platform-specific "bootstrap" code or API extensions?

Platform Specific:

  • The "String.js" extension I added to this PR adds the missing ES6 functions for iOS 8. It isn't needed on Android or Windows.
  • I plan on adding a bootstrap script to our Android-only "ti.playservices" module. (It's injected by the module, making it a non-issue.)

Shared:

  • The "Error.js" extension I added allows JSON.stringify(Error) to work in V8 and exposes the "stack" property in JavaScriptCore.
  • I plan on adding a bootstrap script to "ti.verify" so that it can do module verification in JavaScript instead of native code. (We can discuss this one offline.)
  • In the future, extend some of our core Titanium libraries and prototype in JavaScript by dog-fooding our own JS APIs.

I don't anticipate the "core/Resources" folder to be used for platform specific things except for core JS APIs that may have to do some if-android or if-ios types of things. It wouldn't be any worse than a CommonJS module. Ideally, we should keep platform specific code to a minimum.

I did see our Android specific JavaScript code/extension and was going to leave that be for the moment.

I'm also concerned that we have multiple avenues of extending the app/API via common JS code

The bootstrap concept is my JavaScript equivalent of our native Android module onAppCreate() and native iOS module load() method. I mostly anticipate it being used by CommonJS modules or hybrid modules. Such as with the "ti.playservices" module. I don't anticipate us using bootstraps in the core since the "ti.shell.js" can simply load what it wants on app startup before the "app.js". The one exception might be "ti.verify".

The "extensions" folder I created is a separate thing. This is only for us and is meant for us to add APIs to our core libraries/prototypes for all platforms. It's an opportunity for us to be more productive and improve parity. If a new feature can be 100% coded in JavaScript, then we should do it instead of implementing it natively on each platform we support. For example, if you want to extend "console" with new logging/performance APIs, then you can do it here and it'll just-work on all platforms.

@jquick-axway
Copy link
Contributor Author

Regarding startup performance, I've determined that the File.getDirectoryListing() API on Android is the biggest bottle-neck. Reading from the "Resources" directory doesn't involve file I/O and should be a lot faster than this. I'll look into optimizing it.

@garymathews said he may look into moving the "simplejson" tool that's kept under the Titanium "common" directory. If it's only for Android module builds, then it belongs under the Android directory. That way I can move the core JS code I've created under the root "common" directory without risk of collision. Or alternatively I can name the directory "commonjs" to be more specific on what it is.

@infosia
Copy link
Contributor

infosia commented Jun 19, 2018

I tried to integrate ti.shell.js on Windows, I made it working and the sample code ui.bootstrap.js works good locally. Looks good 👍

@jquick-axway
Copy link
Contributor Author

Thanks for your feedback @infosia.

Would you mind doing a quick performance test for me on Windows please? Add about 100 files to your project and then use the following "ti.shell.js" code to log how long it takes. Note that if your build script copies the core scripts to the "build" directory before copying over the project's scripts, then you don't have to modify the "ti.shell.js" under "titanium_mobile". You can override it by adding a "ti.shell.js" to your Titanium app project instead since it would overwrite it. I consider this a feature and I use it to quick testing of the core scripts I've made (particularly the extensions).

'use strict';

Ti.API.info(Ti.App.name + ' ' + Ti.App.version + ' (Powered by Titanium ' + Ti.version + '.' + Ti.buildHash + ')');

var startTime = new Date();
require('./_ti/extension.loader').load();
Ti.API.info("@@@ Extension Loader Duration: " + (new Date() - startTime));

startTime = new Date();
require('./_ti/bootstrap.loader').loadAsync(function () {
	Ti.API.info("@@@ Bootstrap Loader Duration: " + (new Date() - startTime));
	require('./app');
});

Ideally, I'd like to leave my bootstrap loader as-is and hunt down bootstrap files dynamically on startup... provided that the performance is fine on all platforms. Alternative solution is to modify our build tools to hunt down the bootstrap files when we do a build and store it to file for quick lookup on app startup instead, but I'm hoping to avoid that for the sake of simplicity.

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will we handle platform specific scripts?

Could we have platform directories?

- _ti
    - android
    - ios
    - windows

Could we modernize the JS a bit by using const and let where appropriate?

@@ -0,0 +1,80 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this anymore due to tidev/node-titanium-sdk#32

Unless this is for example purposes?

@infosia
Copy link
Contributor

infosia commented Jun 20, 2018

Is there any special reason to use leading underscore _ for the name of bootstrap folder (_ti)? On Windows it causes compiler warnings because Visual Studio tries to auto-generate Resources for the files when directory name has leading underscore. It doesn't stop the app building but I don't see special reason to stick with leading underscore when it tend to be treated specially on Windows as well as Android.

GENERATEPROJECTPRIFILE : warning PRI263: 0xdef01051 - No default or neutral resource given for 'Files/extensions/Error.js'. The application may throw an exception for certain user configurations when retrieving the resources.

@jquick-axway
Copy link
Contributor Author

@infosia, I'm using an _ti directory to help avoid name collision with the app developer's files/folders. Kind of like how C/C++ uses leading underscores to avoid name collisions. And I wanted to avoid using a leading period like .ti to avoid trouble on Unix-like systems.

On Android, only the "res" directory has character/name limitations since they're turned into Java constants. The Android "assets" directory (where we copy the app project's files) doesn't have any restrictions other than the filter list that is intended to exclude folders such as ".git", ".hg", ".svn", etc.

I wasn't aware of any special treatment of leading underscores in WinRT. I'm guessing we're not adding these files under its equivalent "assets" directory? If we were to ever add images under the _ti directory would we run into problems?

@infosia
Copy link
Contributor

infosia commented Jun 20, 2018

FYI Tried 100 bootstrap files on WindowsStore app (Intel Core i7-6700 CPU @ 3.40GHz, 16.0GB memory) and it took 14.5 seconds to load.

[INFO]  @@@ Bootstrap Loader Duration: 14672

@infosia
Copy link
Contributor

infosia commented Jun 20, 2018

How about using fully qualified name like Android packages? Such as com.axway.appcelerator.titanium.boostrap? Or, we could just use Titanium package-like name such as ti.app.bootstrap because we believe we are casually using this kind of package name to save app preferences globally like ti.ui.defaultunit.

@jquick-axway
Copy link
Contributor Author

@infosia, I'm sorry. I didn't mean for you to test 100 bootstrap files. I meant for you to add 100 other file types such as txt files. This is to test how fast (or slow) the recursive directory traversal is.

For example, my app project contains about 200 files. About 25% of them are image files and most of the rest are JS files (not bootstrap related). I only have 2 bootstrap files in my project. (On Android, the File.getDirectoryListing() and existence checks under the APK's Resources directory is slower than it is from storage when it shouldn't be and I'm resolving it now.)

Sorry for not being specific.

@infosia
Copy link
Contributor

infosia commented Jun 20, 2018

Interestingly File.getDirectoryListing() takes most of loading time on Windows (14sec). I also observed similar to Android, getting files under appx takes much time (10x slower) than getting files under normal directory. I'm curious how Android is going to take care of this.

@hansemannn
Copy link
Collaborator

If we let the developer place the bootstrap-files in an own directory (like we plan for the SDK itself as well), wouldn't that cut down the number of files to search ? Right now, the performance would be a huge blocker.

@infosia
Copy link
Contributor

infosia commented Jun 20, 2018

Ah I think I get it, Titanium CLI should be able to generate file lists of Resources directory beforehand at compile time (in JSON format?). That way we don't have to call File.getDirectoryListing() on runtime. Nice idea! 👍

…e in Resources directory.

- Also improves performance of exists(), isFile(), and isDirectory() checks under Resources.
@jquick-axway
Copy link
Contributor Author

I've just updated the PR to improve Android's "Resources" file/directory access performance. Recursive directory traversal under the "Resources" directory is now about 7x faster than before. And the getDirectoryListing() method is now about 20x faster than before for "Resources".

Here are the performance differences for startup times with my project having 200 files...

  • Pixel XL: 142 ms -> 84 ms (1.6x faster)
  • Amazon Fire HD 8: 389 ms -> 89 ms (4.3x faster)
  • Galaxy Nexus: 1187 ms -> 230 ms (5.1x faster)
  • Android 4.1 Emulator: 964 -> 58 ms (16.6x faster)

It's a pretty significant improvement and all Android devices (except Galaxy Nexus) now outperform iOS. The Galaxy Nexus is our slowest device in the office and takes about 10 seconds to launch an app normally (without this PR's changes), so, this is still a "win" on that device as well. Also, the emulator got the biggest performance gain because JS files are not encrypted and are instead dumped to the APK's "assets" directory which is what I just super optimized.

@infosia, I'm going to see about adding optional support for a JSON of JavaScript files that the "_build.js" can create and bundle with the app. And if the JSON file is not there, then fallback to my existing getDirectoryListing() code... which might need to keep for LiveView.

@hansemannn, we need to be able to find bootstrap files belonging to modules and each module is put under their own subdirectory. Because of this, a recursive lookup is required. My master plan is to add a ti.playservice.bootstrap.js file to our ti.playservices module.

@infosia
Copy link
Contributor

infosia commented Jun 21, 2018

@jquick-axway I did quick trial to store file list of Resources directory at compile time in JSON file on Windows, but I ended up finding it does not actually produce same result when compared to files in final application package...It is because Windows package manager stores additional files while creating application package, such as DLL dependencies and Windows metadata files. I would guess similar things could happen on Android so I think your current implementation (unzip package and store lists beforehand) is the better working solution now.

@@ -3987,6 +3999,7 @@ AndroidBuilder.prototype.packageApp = function packageApp(next) {
'-S', this.buildResDir,
'-I', this.androidCompileSDK.androidJar,
'-F', this.ap_File,
'--ignore-assets', '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a more complete list of things we ignore, check out https://github.com/appcelerator/titanium/blob/master/lib/config.js#L40-L41. It's probably overkill, but you did add picasa.ini for some reason.

Not sure if it helps, but you can get the regexes defined by those config settings by calling this.config.get('cli.ignoreDirs') and this.config.get('cli.ignoreFiles'). You'd need to convert it from a regex to that string with the negates which would be fun.

@jquick-axway
Copy link
Contributor Author

Updated PR:

  • Modified Android build to generate a "boostrap.json" file.
  • On iOS, added missing Ti.Filesystem.File methods isFile() and isDirectory() if file references an encrypted asset.
  • On Android, fixed File.read() to not return an empty string when referencing an encrypted asset.

@jquick-axway
Copy link
Contributor Author

Updated PR:

  • Modified iOS build to generate a "boostrap.json" file.
  • Modified iOS getFile() to support acquiring encrypted JSON files for test/production builds.

@hansemannn hansemannn modified the milestones: 7.4.0, 7.5.0 Aug 24, 2018
@garymathews
Copy link
Contributor

@jquick-axway @cb1kenobi @sgtcoolguy I want to use this functionality to load ACA on startup (TIMOB-25955)

What's the status of this? I'd rather we not make use of Promises just yet until we adopt Promise support with our Titanium APIs which we can do at a later date. There are too many complications to address by supporting Promises that are beyond the scope of this PR.

What's left to get this merged?

Copy link
Collaborator

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The iOS changes look good and I love the idea of this! If our benchmarking-tests regarding performance hits will allow this to be integrated, it will be a great addition to the platform.

@build
Copy link
Contributor

build commented Sep 13, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@sgtcoolguy
Copy link
Contributor

@jquick-axway @garymathews I'm good with the current state of the PR. The only change I could see would be to remove the unnecessary String extensions for ES6. (We'll be transpiling by default, polyfilling, and in 8.0.0 we're dropping iOS 8 support)

Josh, is it Ok to merge as-is?

@build
Copy link
Contributor

build commented Sep 18, 2018

Fails
🚫

Tests have failed, see below for more information.

Tests:

Classname Name Time Error
android.Titanium.Media.AudioPlayer #start, #stop 2.074 Error: timeout of 2000ms exceeded

Generated by 🚫 dangerJS

@jquick-axway
Copy link
Contributor Author

@sgtcoolguy, I'll get rid of the "String.js" extension. Especially since (after all of my changes) I'm only using its endsWith() function in one place now. Thanks.

@build
Copy link
Contributor

build commented Sep 18, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

- Titanium now supports polyfill. That is expected to be used instead.
@jquick-axway
Copy link
Contributor Author

PR updated:

  • Removed ES6 String extension. Setting "tiapp.xml" <transpile>true</transpile> now supports polyfill too. This is the preferred solution.
  • Internal use of String.endsWith() changed to String.search(). Only used by when a "bootstrap.json" not provided (slowest method) and is only used when debugging "titanium_mobile" via IDE.

@lokeshchdhry
Copy link
Contributor

Jenkins build fails. Can someone please take a look at it. Thanks !!

@hansemannn
Copy link
Collaborator

@jquick-axway

[ERROR] : �� �TiExceptionHandler: (main) [54,54] ti:/module.js:303
[ERROR] : �� �TiExceptionHandler: 	throw new Error('Requested module not found: ' + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?
[ERROR] : �� �TiExceptionHandler:  ^
[ERROR] : �� �TiExceptionHandler: Error: Requested module not found: ./ti.internal/extensions/String

@build
Copy link
Contributor

build commented Sep 19, 2018

Fails
🚫

Tests have failed, see below for more information.

Messages
📖

💾 Here's the generated SDK zipfile.

Tests:

Classname Name Time Error
ios.Titanium.Media.AudioPlayer #start, #stop 2.011 file:///Users/build/Libra

Generated by 🚫 dangerJS

@build
Copy link
Contributor

build commented Sep 19, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@lokeshchdhry lokeshchdhry merged commit 5a26745 into tidev:master Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants