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

remove DEPRECATION: Using the global version of DS is deprecated when running tests #4418

Merged
merged 2 commits into from
Jun 21, 2016

Conversation

frunjik
Copy link
Contributor

@frunjik frunjik commented Jun 2, 2016

remove DEPRECATION: Using the global version of DS is deprecated.
Imported DS explicitly in tests/ember-data-initializers.js.

DEPRECATION: Using the global version of DS is
deprecated.
@frunjik
Copy link
Contributor Author

frunjik commented Jun 2, 2016

I have no idea why this change would break the build ... ?

@frunjik
Copy link
Contributor Author

frunjik commented Jun 2, 2016

it looks like:

  • tests green when: "ember test --server"
  • tests break when: "ember test --environment=production" (some broccoli error)

Help?

@frunjik
Copy link
Contributor Author

frunjik commented Jun 6, 2016

I tried several different permutations (of the import statements) to get rid of errors.

But it looks like as soon as i put an import statement (either importing Ember or DS), at the top of the file, i get a brocolli error when running:
"ember test --environment=production"

the tests build and run when:
"ember test"

Is this an (unexpected) side effect of switching to ESlint / and or using the iffy ?

Any hints appreciated

@bmac

@bmac
Copy link
Member

bmac commented Jun 10, 2016

The build is failing with the production flag because confusingly the tests/ember-data-initializers.js get added to the Ember Data build for bower when built in production mode. See here: https://github.com/emberjs/data/blob/master/lib/javascripts.js#L49.

I'm not sure what the best solution is at the moment although I can think of a few hacks to just make it work. Let me get back to you.

@frunjik
Copy link
Contributor Author

frunjik commented Jun 11, 2016

Thx for that,

I also see a typo there: emberDataInitialierPath

@@ -1,8 +1,9 @@
/* eslint no-extra-semi: "off" */

import DS from 'ember-data';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of the reason why the build fails is this file is not transformed before it gets added to the bower build output. One thing we could do is remove this line and add var DS = require('ember-data').default; inside the iffe.

fixes tests failing in production mode
fixes deprecation message using global DS in tests
@frunjik
Copy link
Contributor Author

frunjik commented Jun 21, 2016

Thx,

Your 'hacks' make the build work ...
But they don't solve the issue of tests/ember-data-initializers.js wrongly? being included ...

@bmac

@rwjblue
Copy link
Member

rwjblue commented Jun 21, 2016

I am unsure why exactly we need to duplicate these initializers. Ideally we can fix that issue.

One possible solution might be to do what "normal" ember-cli apps do, and use ember-load-initializers...

@bmac bmac merged commit a3aeb0b into emberjs:master Jun 21, 2016
@bmac
Copy link
Member

bmac commented Jun 21, 2016

@rwjblue I have merged this pr as is and opened a new issue for cleaning up the duplicated initializers #4437. I'd like to sync up with you later on how to use ember-load-initializers.

@rwjblue
Copy link
Member

rwjblue commented Jun 21, 2016

sounds good

@frunjik frunjik deleted the removing_test_warnings_and_deprecations branch June 22, 2016 14:58
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.

4 participants