radekstepan / pomme.js

JS comms between frames using postMessage
7 stars 1 forks source link

AMD loading does not in fact work #18

Closed alexkalderimis closed 8 years ago

alexkalderimis commented 10 years ago

The following line overwrites the custom Pomme version of require (with non-standard things like register, with the global require).

// Lines 204-207 in app.js
// Do we already have require loader?
  root.require = require = (typeof root.require !== 'undefined') ? root.require : require;

  // All our modules will see our own require. # actually, no, they won't.

If they two objects have different APIs, they must have different names.

(Installed latest from bower).

radekstepan commented 10 years ago

That is for apps-c not doing good build right? If you have some test code for me where it does not work then it will help me fix it sooner (next month). On 1 May 2014 03:50, "Alex Kalderimis" notifications@github.com wrote:

The following line overwrites the custom Pomme version of require (with non-standard things like register, with the global require).

// Lines 204-207 in app.js// Do we already have require loader? root.require = require = (typeof root.require !== 'undefined') ? root.require : require;

// All our modules will see our own require. # actually, no, they won't.

If they two objects have different APIs, they must have different names.

— Reply to this email directly or view it on GitHubhttps://github.com/radekstepan/pomme.js/issues/18 .

radekstepan commented 10 years ago

@alexkalderimis any comments on this? I may have a few days in Auckland to work on this.

alexkalderimis commented 10 years ago

There is no massive rush with this tbh. I am currently using jschannel by mozilla for my communication needs, as it does everything I require.

As for the issue with Pomme, I think I laid it all out in the issue, explaining the problem (you overwrite your own version of require with amd.require, but you need your own version to work). The minimal test case would be something like:

A bower.json file with the dependency: pomme.

A require js app that loads pomme:


define(['pomme'], function (Pomme) {

  console.log("woot");

});

Run this in a web-page - note that it fails with a run-time error in Pomme.js On 5 May 2014 03:15, "Radek Stepan" notifications@github.com wrote:

@alexkalderimis https://github.com/alexkalderimis any comments on this? I may have a few days in Auckland to work on this.

— Reply to this email directly or view it on GitHubhttps://github.com/radekstepan/pomme.js/issues/18#issuecomment-42154742 .

alexkalderimis commented 10 years ago

Also - please don't feel obliged to work on your break. Auckland is cool. The museum is meant to have neat stuff, the viaduct harbour is great at night. Waiheke is awesome (go go go). The French Market in Ponsonby on Sundays rocks. neat stuff

On 5 May 2014 22:01, Alex Kalderimis alexkalderimis@googlemail.com wrote:

There is no massive rush with this tbh. I am currently using jschannel by mozilla for my communication needs, as it does everything I require.

As for the issue with Pomme, I think I laid it all out in the issue, explaining the problem (you overwrite your own version of require with amd.require, but you need your own version to work). The minimal test case would be something like:

A bower.json file with the dependency: pomme.

A require js app that loads pomme:


define(['pomme'], function (Pomme) {

  console.log("woot");

});

Run this in a web-page - note that it fails with a run-time error in Pomme.js On 5 May 2014 03:15, "Radek Stepan" notifications@github.com wrote:

@alexkalderimis https://github.com/alexkalderimis any comments on this? I may have a few days in Auckland to work on this.

— Reply to this email directly or view it on GitHubhttps://github.com/radekstepan/pomme.js/issues/18#issuecomment-42154742 .

radekstepan commented 10 years ago

Yeah my programming mind has not kicked in in a long while so...

We are spending too much time in Auckland actually, we were supposed to have been in Australia already, but someone forgot to apply for visa (...) and Czech Republic is a "high risk" country so everything takes a while.

alexkalderimis commented 10 years ago

You need a visa for Aussie? o_0

You crazy high risk eastern Europeans, with your revolutions and civil wars :P On 5 May 2014 23:30, "Radek Stepan" notifications@github.com wrote:

Yeah my programming mind has not kicked in in a long while so...

We are spending too much time in Auckland actually, we were supposed to have been in Australia already, but someone forgot to apply for visa (...) and Czech Republic is a "high risk" country so everything takes a while.

— Reply to this email directly or view it on GitHubhttps://github.com/radekstepan/pomme.js/issues/18#issuecomment-42248653 .