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

[BUGFIX] ensure all of DS is initialized together #4823

Merged
merged 1 commit into from
Feb 26, 2017
Merged

Conversation

stefanpenner
Copy link
Member

Although this does force the entire DS namespaces to be initialized immediately. This shouldn’t cause a performance issue, as it the full namespace was always initialized, just in two phases.

@stefanpenner
Copy link
Member Author

strange the failure seems to be uglify related...

@bmac
Copy link
Member

bmac commented Feb 25, 2017

@stefanpenner the build seems to pass with "loader.js": "v4.1.0" but get the uglify error with v4.2.2.

@bmac
Copy link
Member

bmac commented Feb 26, 2017

More debugging has lead me to believe this line is what uglify is chocking on. https://github.com/ember-cli/loader.js/blob/master/lib/loader/loader.js#L7 I'm not sure why its getting run on the unprocessed loader.js thought. I think I'll lock Ember Data to using v4.1.0 of loader.js for now.

@stefanpenner
Copy link
Member Author

@bmac im not sure what script is running that causes that issue (haven't had a chance to look). My guess is it is pulling in loader.js directly, rather then letting the addon provide it.

@bmac
Copy link
Member

bmac commented Feb 26, 2017

Looks like you are right. I've opened a pr with a temporary fix #4824.

* DS object will always present fully. Today during initialization it remains partially initializers for a period (missing everything from https://github.com/emberjs/data/blob/master/addon/index.js#L91-L154)
* this also fixes the (unknown mixin) stuff for all DS classes

Although this does force the entire DS namespaces to be initialized immediately. This shouldn’t cause a performance issue, as it the full namespace was always initialized, just in two phases.
@stefanpenner
Copy link
Member Author

@bmac rebased on-top of your fix.

@bmac bmac merged commit 5e8798f into master Feb 26, 2017
@bmac bmac deleted the fix-namespace branch February 26, 2017 13:24
tricknotes added a commit to tricknotes/ember-data that referenced this pull request Jun 23, 2017
The global build of ember-data has been broken since emberjs#4823.
When `ember-data.js is loaded, the following error is occured:
```
Uncaught Error: Could not find module `ember-data/index` imported from `ember-data/initializers/ember-data`
```

A reproduction code is just simple:
```
<!DOCTYPE html>
<html>
  <head>
    <script src="http://builds.emberjs.com/tags/v2.13.1/ember.prod.js"></script>
    <script src="http://builds.emberjs.com/tags/v2.14.3/ember-data.js"></script>
  </head>
  <body>
    <h1>Hello, Ember!</h1>
  </body>
</html>
```

The reason of this error is that the broccoli builds the module named "*/index" into `*` for global build.
But loader.js couldn't resolve `ember-data/index` as `ember-data`.

So the `ember-data/index` module should be to as just `ember-data` to be
compatible with NPM package and global.
tricknotes added a commit to tricknotes/ember-data that referenced this pull request Jun 23, 2017
The global build of ember-data has been broken since emberjs#4823.
When `ember-data.js` is loaded, the following error is occured:
```
Uncaught Error: Could not find module `ember-data/index` imported from `ember-data/initializers/ember-data`
```

A reproduction code is just simple:
```
<!DOCTYPE html>
<html>
  <head>
    <script src="http://builds.emberjs.com/tags/v2.13.1/ember.prod.js"></script>
    <script src="http://builds.emberjs.com/tags/v2.14.3/ember-data.js"></script>
  </head>
  <body>
    <h1>Hello, Ember!</h1>
  </body>
</html>
```

The reason of this error is that the broccoli builds the module named "*/index" into `*` for global build.
But loader.js couldn't resolve `ember-data/index` as `ember-data`.

So the `ember-data/index` module should be to as just `ember-data` to be
compatible with NPM package and global.
tricknotes added a commit to tricknotes/ember-data that referenced this pull request Jun 23, 2017
The global build of ember-data has been broken since emberjs#4823.
When `ember-data.js` is loaded, the following error is occured:
```
Uncaught Error: Could not find module `ember-data/index` imported from `ember-data/initializers/ember-data`
```

A reproduction code is just simple:
```
<!DOCTYPE html>
<html>
  <head>
    <script src="http://builds.emberjs.com/tags/v2.13.1/ember.prod.js"></script>
    <script src="http://builds.emberjs.com/tags/v2.14.3/ember-data.js"></script>
  </head>
  <body>
    <h1>Hello, Ember!</h1>
  </body>
</html>
```

The reason of this error is that the broccoli builds the module named "*/index" into `*` for global build.
But loader.js couldn't resolve `ember-data/index` as `ember-data`.

So the `ember-data/index` module should be to as just `ember-data` to be
compatible with NPM package and global.
bmac pushed a commit that referenced this pull request Jun 24, 2017
The global build of ember-data has been broken since #4823.
When `ember-data.js` is loaded, the following error is occured:
```
Uncaught Error: Could not find module `ember-data/index` imported from `ember-data/initializers/ember-data`
```

A reproduction code is just simple:
```
<!DOCTYPE html>
<html>
  <head>
    <script src="http://builds.emberjs.com/tags/v2.13.1/ember.prod.js"></script>
    <script src="http://builds.emberjs.com/tags/v2.14.3/ember-data.js"></script>
  </head>
  <body>
    <h1>Hello, Ember!</h1>
  </body>
</html>
```

The reason of this error is that the broccoli builds the module named "*/index" into `*` for global build.
But loader.js couldn't resolve `ember-data/index` as `ember-data`.

So the `ember-data/index` module should be to as just `ember-data` to be
compatible with NPM package and global.
bmac pushed a commit that referenced this pull request Jul 21, 2017
The global build of ember-data has been broken since #4823.
When `ember-data.js` is loaded, the following error is occured:
```
Uncaught Error: Could not find module `ember-data/index` imported from `ember-data/initializers/ember-data`
```

A reproduction code is just simple:
```
<!DOCTYPE html>
<html>
  <head>
    <script src="http://builds.emberjs.com/tags/v2.13.1/ember.prod.js"></script>
    <script src="http://builds.emberjs.com/tags/v2.14.3/ember-data.js"></script>
  </head>
  <body>
    <h1>Hello, Ember!</h1>
  </body>
</html>
```

The reason of this error is that the broccoli builds the module named "*/index" into `*` for global build.
But loader.js couldn't resolve `ember-data/index` as `ember-data`.

So the `ember-data/index` module should be to as just `ember-data` to be
compatible with NPM package and global.
(cherry picked from commit 17bf1b7)
bmac pushed a commit that referenced this pull request Jul 21, 2017
The global build of ember-data has been broken since #4823.
When `ember-data.js` is loaded, the following error is occured:
```
Uncaught Error: Could not find module `ember-data/index` imported from `ember-data/initializers/ember-data`
```

A reproduction code is just simple:
```
<!DOCTYPE html>
<html>
  <head>
    <script src="http://builds.emberjs.com/tags/v2.13.1/ember.prod.js"></script>
    <script src="http://builds.emberjs.com/tags/v2.14.3/ember-data.js"></script>
  </head>
  <body>
    <h1>Hello, Ember!</h1>
  </body>
</html>
```

The reason of this error is that the broccoli builds the module named "*/index" into `*` for global build.
But loader.js couldn't resolve `ember-data/index` as `ember-data`.

So the `ember-data/index` module should be to as just `ember-data` to be
compatible with NPM package and global.
(cherry picked from commit 17bf1b7)
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

Successfully merging this pull request may close these issues.

3 participants