Skip to content

Integrating with Appcelerator as a Common js module #784

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

Closed
sobytes opened this issue Nov 10, 2015 · 8 comments
Closed

Integrating with Appcelerator as a Common js module #784

sobytes opened this issue Nov 10, 2015 · 8 comments
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.

Comments

@sobytes
Copy link

sobytes commented Nov 10, 2015

Hi All,

I am looking to integrate the aws sdk with Appcelerator and i seem to be running into some issues.

I need to take the aws sdk and convert it to a commonJS module with an exports object. How do i go about this with the sdk?

I am looking into https://github.com/smclab/titaniumifier to this but i am getting errors ticket here smclab/titaniumifier#43.

Is there a easier way to do this with the AWS javascript SDK i would love to use this with Appcelerator?

https://community.appcelerator.com/topic/3997/using-amazon-javascript-sdk-node-module-in-appcelerator

Thanks

@sobytes
Copy link
Author

sobytes commented Nov 10, 2015

Ok so i have managed to build the common js module using titaniumifier.

https://s3.amazonaws.com/samuel.east/aws-sdk-commonjs-2.2.15.zip

But getting some errors when running.

var AWS = require('aws-sdk');
[ERROR] :      message = "Object prototype may only be an Object or null.";

Debugging now

@sobytes
Copy link
Author

sobytes commented Nov 10, 2015

Here is the error line 42568.

ctor.prototype = Object.create(superCtor.prototype, {
                    constructor: {
                        value: ctor,
                        enumerable: false,
                        writable: true,
                        configurable: true
                    }
                });

@chrisradek
Copy link
Contributor

@sobytes
We don't typically guarantee support with 3rd party frameworks. However, if you can provide the steps you performed to convert the AWS SDK to a common js module, you may get better feedback.

@AdityaManohar
Copy link
Contributor

@sobytes

I need to take the aws sdk and convert it to a commonJS module

The SDK is built entirely from CommonJS modules. This is the convention for most (if not all) Node.js modules. It looks like the the tool you are using (titaniumifier) converts any CommonJS module into a Titanium SDK module. As per the titaniumifier wiki this is done using browserify to convert a CommonJS package into a single file dependency.

The SDK is fully compatible with browserify, in fact we build our browser distributable with browserify. You can also include the SDK as a dependency of a package that is being built using browserify (see #383).

The titaniumfier output bundle that you attached contains an artifact that is identical to our browser distributable that can be found here: http://sdk.amazonaws.com/js/aws-sdk-2.2.15.js

That being said, my initial guess is that the JavaScript engine used by Appcelerator may not support certain standard APIs the SDK is using. A full stack trace my reveal more about what is actually failing.

Hope this helps clarify things!

@chrisradek chrisradek added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed Feedback Requested labels Nov 19, 2015
@chrisradek
Copy link
Contributor

Closing due to lack of activity.

@anthonychung
Copy link

Titanium has mechanisms to map the IOS AWS-SDK to a native titanium module. However, because AWS-SDK apis get added so frequently, if there is an easier solution to wrap the javascript AWS-SDK to be used directly in Titanium's javascript environment, this will be more sustainable for using Titanium with AWS-SDK on a regular basis.

Can we reopen this? I've been going through the same process to explore if we can integrate javascript AWS-SDK with Titanium, hit the same wall. Can an Amazon engineer familiar with Titanium attempt this integration, and recommend ways forward?

For other Titanium devs exploring AWS integration, links to previous Appcelerator maintained aws module here.

http://stackoverflow.com/questions/35172821/how-to-create-a-module-for-aws-sdk

But also is an example scenario of Ti user trying to use new AWS API but old module not up to date.

AWS-SDK Javascript with NodeJS works great, keen to find ways for integration with Titanium mobile. Would open up ways for existing Titanium developers to expand integrations with AWS Cognito, Lambda, Amazon Mobile Analytics, IOT and more.

Much appreciated, Anthony

@samueleastdev
Copy link

@anthonychung did you ever get anywhere with this?

@srchase srchase added the guidance Question that needs advice or information. label Dec 26, 2018
@lock
Copy link

lock bot commented Sep 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

6 participants