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

The current packaging system does not work with minimised scripts. #126

Open
GoogleCodeExporter opened this issue Jul 8, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

The current system uses eval(this.exports) to export symbols from a closure. 
This does not work correctly when a package is minimised using anything other 
than packer.

A new packaging system is required that can survive minification.

Original issue reported on code.google.com by [email protected] on 5 Jan 2010 at 2:01

@GoogleCodeExporter
Copy link
Author

The new packaging system will be very similar to the old one. Here is a 
template:

base2.exec(function(namespace) {

  eval(namespace); // optional

  var PI = 3.14;

  var Shape = Base.extend({
    ...
  });

  var Circle = Shape.extend({
    ...
  });

  var Rect = Shape.extend({
    ...
  });

  var shapes = new Package({
    name: "shapes",
    version: "2.0",

    exports: {
      PI: PI,
      Shape: Shape,
      Circle: Circle,
      Rect: Rect
    }
  });

});

There will also be base2.require() which will lazy-load other packages/scripts:

base2.require("dom", function(namespace) {

  eval(namespace); // optional

  // package definition

});

Original comment by [email protected] on 5 Jan 2010 at 2:10

@GoogleCodeExporter
Copy link
Author

Fixing this will mean that base2 will move to version 2.0 instead of version 
1.1.

Original comment by [email protected] on 9 Jan 2010 at 6:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant