Coder Social home page Coder Social logo

connect-phonegap's Introduction

connect-phonegap's People

Contributors

bladesk avatar carynbear avatar devgeeks avatar doctorrustynelson avatar eliotsykes avatar filmaj avatar gkorshunov avatar globegitter avatar hermwong avatar ilyaskriblovsky avatar jfurfaro avatar killfill avatar lorinbeer avatar macdonst avatar marob avatar maverickmishra avatar mrbr avatar mwbrooks avatar ngokimphu avatar purplecabbage avatar stevengill avatar surajpindoria avatar tamb avatar timkim avatar ylecuyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connect-phonegap's Issues

add ./bin/pgserve

Not sure about the name but agree w/ @mwbrooks that soundwave is a bit misleading.

This feature allows for npm i -g pgserve to and running standalone.

Add Travis CI Support

Connect to Travis CI.

See the phonegap/phonegap-cli or phonegap/node-phonegap-build for examples.

Breakout cordova-useragent

Source

lib/middleware/ext/useragent.js

Blasphemy!

I know, I know. User-Agent detection is gross.

Why?

Without modifying the client app, we cannot detect the Cordova Platform.

We need to detect the Cordova Platform in order to serve the appropriate cordova.js, cordova_plugins.js, and plugins/**/*.js.

If we have the need, others may as well.

Android: tap navigation events unreliable

Problem

On my Galaxy Nexus 4.4, the events fires once in a blue moon.

Investigation

Taps are currently registered to the body element, which is compressed to the PhoneGap graphic and device ready element on the Hello World app. The remainder of the page does not respond to a touch.

Attaching the event to document allows the entire page to receive touch events.

The next problem is that I cannot get more than 1 touch to be detected :(

Note: iOS continues to detect multiple touches using the document element.

Served App is Cached

I am finding that I must use Remote Web Inspector to force a refresh, otherwise changes are not reflected.

Hammer js middleware for touchevents

Due to issue #17, a simple solution for now is to inject hammer.js and have that handle our touchevents instead of doing it ourselves. Later on, we should explore a native solution and not one based on JavaScript.

Tap Reload Interaction is Unreliable

I am finding that it is detecting a three-finger tap (go home) when I do a four-finger tap (reload).

I think this is caused by the events firing before all four of my fingers consistently touch the screen.

Incorrect IP Address on Windows with WP emulator installed

Problem

On Windows, the incorrect IP address is displayed when a server is started.

Reason

When the Windows Phone SDK has been installed on the system, the phonegap server will display the IP address of the Windows Phone emulator. The emulator does not need to be running.

The reason is that the emulator's IP address is listed first:

yeah, it should show up first

Ethernet adapter vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch):

  Connection-specific DNS Suffix  . :
  Link-local IPv6 Address . . . . . : fe80::d163:6344:6a6c:643%30
  IPv4 Address. . . . . . . . . . . : 169.254.80.80
  Subnet Mask . . . . . . . . . . . : 255.255.0.0
  Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (Broadcom 802.11n Network Adapter Virtual Switch):

  Connection-specific DNS Suffix  . : vs.shawcable.net
  Link-local IPv6 Address . . . . . : fe80::d449:8ecd:eff8:efc8%28
  IPv4 Address. . . . . . . . . . . : 192.168.1.78
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . : 192.168.1.1

We must patch the address dependency to support this case:
https://github.com/phonegap/connect-phonegap/blob/master/lib/serve.js#L75

Publish 0.2.0 to npm

npm is having issues at the moment. Try to publish the latest 0.2.0 tag in a bit.

Refactor EventEmitter

This will be an API breaking change.

Now

We use a singleton event emitter:

var pg = require('connect-phonegap');
pg.on('name', callback);
pg.emit('name', value);

The middleware is instantiated (standard practice for middleware):

http.createServer(pg(options));

Next

The event emitter should be instantiated with the middleware:

// emitter attached to returned request listener
var middleware = pg(options);
middleware.on('name', callback);

Or passed into the middleware as an option:

// emitter passed as option
var emitter = new events.EventEmitter();
var middleware = pg({ emitter: emitter });

Android: error on loading cordova.js (geometrixx app)

when trying to serve https://github.com/ccoenraets/geometrixx

Error: ENOENT, no such file or directory '/Users/brianleroux/Desktop/src/phonegap-serve/node_modules/connect-phonegap/res/middleware/cordova/platform/cordova.js'
    at Error (native)
    at Object.fs.openSync (fs.js:410:18)
    at Object.fs.readFileSync (fs.js:276:15)
    at Object.handle (/Users/brianleroux/Desktop/src/phonegap-serve/node_modules/connect-phonegap/lib/middleware/cordova/cordova.js:24:27)
    at next (/Users/brianleroux/Desktop/src/phonegap-serve/node_modules/connect-phonegap/node_modules/connect/lib/proto.js:193:15)
    at resume (/Users/brianleroux/Desktop/src/phonegap-serve/node_modules/connect-phonegap/node_modules/connect/lib/middleware/static.js:65:7)
    at SendStream.error (/Users/brianleroux/Desktop/src/phonegap-serve/node_modules/connect-phonegap/node_modules/connect/lib/middleware/static.js:80:37)
    at SendStream.EventEmitter.emit (events.js:104:17)
    at SendStream.error (/Users/brianleroux/Desktop/src/phonegap-serve/node_modules/connect-phonegap/node_modules/connect/node_modules/send/lib/send.js:147:51)
    at SendStream.onStatError (/Users/brianleroux/Desktop/src/phonegap-serve/node_modules/connect-phonegap/node_modules/connect/node_modules/send/lib/send.js:248:48)

Add middleware to handle cordova.js injection

A middleware that injects the proper cordova.js for the platform its requesting from would be a big plus for our app. It lets the dev/user not have to worry about moving files (ie cordova.js) around in their working directory in order to launch their app properly.

Replace .serve callback with complete event

The serve command returns an instance of http.Server. With that instance, we can subscribe to all the events required to follow the lifespan of the server. It doesn't make sense to have a callback attached to serve when everything else is conveyed through the event interface.

Replace

phonegap.serve(options, callback);

With

phonegap.serve(options).on('complete', callback);

AutoReload occasionally not firing

I've been using AutoReload a good deal today.

Occasionally, it will not fire but I cannot narrow down the culprit.

Here are a few of my scattered thoughts:

  • unrelated to an uncaught thrown Error
  • unrelated to input box focus
  • second save may or may not cause autoreload to fire
  • forced refresh works fine

We could implement a handshake to update the outdated flag. That would also help with debugging (inspecting the value without causing it to become outdated: false.

cordova.js not found

when loading the default app from the server started in the PG-GUI, an error is thrown because there is no platform set so the server is unable to serve the cordova.js file.

Add middleware to serve plugins

We'll also need to send cordova_plugins.js and the associated plugin files for all of the native plugins we plan to have on the app.

Adding the emitter to log events for the auto reload module causes memory leak warnings in tests

With this fix:
445be4a

Running npm test now throw a memory leak error:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at StatWatcher.EventEmitter.addListener (events.js:160:15)
    at Object.fs.watchFile (fs.js:1162:8)
    at Gaze._pollFile (/Users/timkim/repo/node-phonegap-soundwave/node_modules/gaze/lib/gaze.js:319:10)
    at /Users/timkim/repo/node-phonegap-soundwave/node_modules/gaze/lib/gaze.js:389:12
    at Array.forEach (native)
    at /Users/timkim/repo/node-phonegap-soundwave/node_modules/gaze/lib/gaze.js:387:11
    at iterate (/Users/timkim/repo/node-phonegap-soundwave/node_modules/gaze/lib/helper.js:52:5)
    at Object.forEachSeries (/Users/timkim/repo/node-phonegap-soundwave/node_modules/gaze/lib/helper.js:66:3)
    at Gaze._initWatched (/Users/timkim/repo/node-phonegap-soundwave/node_modules/gaze/lib/gaze.js:332:10)
    at Gaze.add (/Users/timkim/repo/node-phonegap-soundwave/node_modules/gaze/lib/gaze.js:167:8)

AutoReload not refreshing the app

AutoReload is not causing the app to refresh.

Quick inspection shows:

  • /autoreload works
  • /autoreload updating correcting
  • client is regularly pinging /autoreload
  • client does not throw JavaScript errors.

Add proxy to support cross-origin requests

Problem:

The PhoneGap Developer App cannot make cross-origin requests because it is served by connect-phonegap.

Source:

phonegap/phonegap-app-developer#98

Solution:

One potential solution is to allow the connect-phonegap middleware to proxy all external requests. An added bonus is that the only the CLI needs to be updated, rather each each app.

Consolidate Cordova middleware

Current

There are 3 middleware components used to support Cordova on platform:

  • middleware/cordova.js
  • middleware/cordova_plugins.js
  • middleware/plugins.js

Each detects the platforms, looks up a file, and returns the file content from:

  • res/middleware/cordova/android/
  • res/middleware/cordova/ios/
  • res/middleware/cordova/wp8/

Problem

The middleware can be thought of as connect-cordova, in which case it would be considered a single middleware handler.

When adding a new platform, it's confusing what middleware require editing.

There is a lot of duplicate code and tests between the three middleware components.

Solution

Consolidate the middleware into a single middleware function:

  • middleware/cordova.js

If there a reason to keep three separate files, then isolate with a directory:

  • middleware/cordova/cordova.js
  • middleware/cordova/cordova_plugins.js
  • middleware/cordova/plugins.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.