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

0.7.0-beta.6 broken package.json override #98

Closed
MajorBreakfast opened this issue Aug 14, 2014 · 5 comments
Closed

0.7.0-beta.6 broken package.json override #98

MajorBreakfast opened this issue Aug 14, 2014 · 5 comments

Comments

@MajorBreakfast
Copy link

Before the upgrade I had ember running. Now the via jspm install ember installed ember package's package.json is different.

With the old jspm it automatically included

{
  "dependencies": {
    "jquery": "*",
    "handlebars.js": "^1.3.0"
  },
  "shim": {
    "ember": {
      "deps": [
        "jquery",
        "handlebars.js"
      ],
      "exports": "Ember"
    }
  }
}

Now dependencies is an empty object and shim doesn't exist.

I think the algorithm that does these overrides broke. Maybe the ember package isn't the only broken package.

And another question:
I tried to fix this by applying the override manually. I did:

System.config({
  "meta": {
    "ember": {
      "deps": ["jquery", "handlebars.js"],
      "exports": "Ember"
    }
  }
});

Out of curiosity: What am I doing wrong here? This should make the two globals exported by Handlebars and by jquery available to ember, right?

@MajorBreakfast MajorBreakfast changed the title 0.7.0-beta.6 ember shim 0.7.0-beta.6 broken package.json override Aug 14, 2014
@guybedford
Copy link
Member

Thanks, yes these are betas for a reason! I will make sure to get a fix in this weekend.

@guybedford
Copy link
Member

The meta config must apply to the full-normalized module name. That is -

System.config({
  meta: {
    'github:components/[email protected]/ember': {
      deps: ['jquery', 'handlebars.js'],
      exports: 'Ember'
    }
  }
});

I believe the issue is actually because Ember has updated to 1.6.1, while the automatic configuration was enabled for Ember 1.4.x here - https://github.com/jspm/registry/blob/master/package-overrides/github/components/ember%401.4.0.json.

To manually override you can do:

  jspm install ember -o "{  shim: {    ember: {      deps: ['jquery', 'handlebars.js'],      exports: 'Ember'    }  },  'registry': 'jspm',  'dependencies': {    jquery: '*',    'handlebars.js': '^1.3.0'  },  'files': ['ember.js'],  'buildConfig': {    'minify': true  }}"

If that works ok, we can create the new override file for the latest version like https://github.com/jspm/registry/blob/master/package-overrides/github/components/ember%401.4.0.json.

The reason that we don't apply the registry overrides to the semver range is because it is expected to send a PR to the original repo and have this information in the underlying package.json for Ember itself. Perhaps we can reconsider this, but I'm tracking that decision here - jspm/registry#11.

@MajorBreakfast
Copy link
Author

Super helpful and speedy answer as always :)

Would it be possible to apply System.normalize() automatically? Then ember/ember would correctly expand to github:components/[email protected]/ember.

@guybedford
Copy link
Member

Potentially, but I don't want to start doing these fine-level optimizations when all of this stuff is still a little in flux. There is a spec change and package config coming to SystemJS which will both alter a few things around configuration.

@MajorBreakfast
Copy link
Author

A spec - sounds nice. What I wanted kinda works, so I'm happy with that :)

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

No branches or pull requests

2 participants