Easily create apps using the web technologies you know and love: HTML, CSS, and JavaScript
Check out the Github Organization for all of our projects.
Stream a PhoneGap app to any device.
License: Apache License 2.0
Easily create apps using the web technologies you know and love: HTML, CSS, and JavaScript
Check out the Github Organization for all of our projects.
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.
Connect to Travis CI.
See the phonegap/phonegap-cli
or phonegap/node-phonegap-build
for examples.
For example, changes to www/js/index.js
do not invoke a refresh.
We should also test:
res/middleware/homepage.js
res/middleware/refresh.js
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.
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.
I am finding that I must use Remote Web Inspector to force a refresh, otherwise changes are not reflected.
subscribes to volume up/down for reload
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.
Let's rename this sucker to something more relevant.
My vote: phonegap-server
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.
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
npm is having issues at the moment. Try to publish the latest 0.2.0
tag in a bit.
eom
WP8 uses the MS Pointer Event instead of the Touch Event spec.
which requires us fleshing out
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 });
Add some API documentation to the README.md
Add the JavaScript for all of the official PhoneGap plugins.
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)
The test runner is hanging since issue #14 was merged into master.
Travis CI is showing error as well.
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.
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);
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:
Error
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
.
{"reload":true}
(or false)./www
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.
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.
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 is not causing the app to refresh.
Quick inspection shows:
/autoreload
works/autoreload
updating correcting/autoreload
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.
Someone ran into this today. Wanted to record it incase people run into it and search.
Just upgrade your version of node.
fs.readdir
returns an undefined files object.
On a desktop browser, the incorrect cordova.js
is served. Let's fail a little more gracefully until the desktop version of cordova.js
exists.
By default, we will set the autoreload feature to be turned on so we'll need a way for it to be able to turn off.
A more rewarding architecture for phonegap-soundwave
is to seamlessly wrap the http
module. This will allow the module to integrate with libraries such as connect
and express
. It will also enable easier extensibility for features such as proxy support.
For inspiration, see express
wrapping http
: https://github.com/visionmedia/express/blob/master/lib/application.js#L531-L534
soundwave.serve(options, callback) should return the server object in the callback
eom
Many PhoneGap apps (including our Hello World) still use phonegap.js
.
required to implement the following feature: phonegap/phonegap-app-desktop#27
WP8 uses the MS Pointer Events instead of Touch Events.
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
At the moment, it is hardcoded to return 127.0.0.1
. This is useless when testing on a device.
eom
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.