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
[INTERNAL] Improve jQuery deprecation message #8399
Merged
rwjblue
merged 2 commits into
ember-cli:master
from
simonihmig:improve-jquery-deprecation
Feb 3, 2019
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -468,6 +468,10 @@ describe('EmberApp', function() { | |
'bar': 'bar', | ||
}); | ||
|
||
app = new EmberApp({ | ||
project, | ||
}); | ||
|
||
app.trees.public = input.path(); | ||
app.addonTreesFor = function() { | ||
return [ | ||
|
@@ -511,6 +515,10 @@ describe('EmberApp', function() { | |
'bar': 'bar', | ||
}); | ||
|
||
app = new EmberApp({ | ||
project, | ||
}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change was required as |
||
app.trees.public = input.path(); | ||
app.addonTreesFor = function() { | ||
return [ | ||
|
@@ -1644,27 +1652,76 @@ describe('EmberApp', function() { | |
}); | ||
}); | ||
|
||
it('shows ember-cli-shims deprecation', function() { | ||
let root = path.resolve(__dirname, '../../fixtures/app/npm'); | ||
let project = setupProject(root); | ||
project.require = function() { | ||
return { | ||
version: '5.0.0', | ||
|
||
describe('deprecations', function() { | ||
it('shows ember-cli-shims deprecation', function() { | ||
let root = path.resolve(__dirname, '../../fixtures/app/npm'); | ||
let project = setupProject(root); | ||
project.require = function() { | ||
return { | ||
version: '5.0.0', | ||
}; | ||
}; | ||
project.initializeAddons = function() { | ||
this.addons = [ | ||
{ | ||
name: 'ember-cli-babel', | ||
pkg: { version: '5.0.0' }, | ||
}, | ||
]; | ||
}; | ||
}; | ||
project.initializeAddons = function() { | ||
this.addons = [ | ||
{ | ||
name: 'ember-cli-babel', | ||
pkg: { version: '5.0.0' }, | ||
}, | ||
]; | ||
}; | ||
|
||
app = new EmberApp({ | ||
project, | ||
app = new EmberApp({ | ||
project, | ||
}); | ||
|
||
expect(project.ui.output).to.contain("You have not included `ember-cli-shims` in your project's `bower.json` or `package.json`."); | ||
}); | ||
|
||
expect(project.ui.output).to.contain("You have not included `ember-cli-shims` in your project's `bower.json` or `package.json`."); | ||
describe('jQuery integration', function() { | ||
it('shows deprecation', function() { | ||
project.initializeAddons = function() { | ||
this.addons = [ | ||
{ name: 'ember-source', paths: {} }, | ||
]; | ||
}; | ||
app = new EmberApp({ project }); | ||
|
||
expect(project.ui.output).to.contain( | ||
'The integration of jQuery into Ember has been deprecated and will be removed with Ember 4.0' | ||
); | ||
}); | ||
|
||
it('does not show deprecation if the app has `@ember/jquery` installed', function() { | ||
project.initializeAddons = function() { | ||
this.addons = [ | ||
{ name: 'ember-source', paths: {} }, | ||
{ name: '@ember/jquery' }, | ||
]; | ||
}; | ||
app = new EmberApp({ project }); | ||
expect(project.ui.output).to.not.contain( | ||
'The integration of jQuery into Ember has been deprecated and will be removed with Ember 4.0' | ||
); | ||
}); | ||
|
||
it('does not show deprecation if the app has `@ember/optional-features` with the `jquery-integration` FF turned off', function() { | ||
project.initializeAddons = function() { | ||
this.addons = [ | ||
{ name: 'ember-source', paths: {} }, | ||
{ | ||
name: '@ember/optional-features', | ||
isFeatureEnabled() { | ||
return false; | ||
}, | ||
}, | ||
]; | ||
}; | ||
app = new EmberApp({ project, vendorFiles: { 'ember-testing.js': null } }); | ||
expect(project.ui.output).to.not.contain( | ||
'The integration of jQuery into Ember has been deprecated and will be removed with Ember 4.0' | ||
); | ||
}); | ||
}); | ||
}); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgive me for being out of the loop, but is it not possible to put this in the ember-source addon itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right, and given that it's ember-source which is actually deprecating things (i.e. causing breaking changes in the future), it would make more sense to put it there. Especially that ember-source and ember-cli might not be used in lock step.
On the other hand, IIRC this was already added a while ago when we started to not include jQuery anymore (which historically ember-cli did, not ember-source!) when
@ember/jquery
is detected. So when we want to move that message to ember-source, we would probably have to check the ember-source version here, to not issue a deprecation message twice!?A bit of shenanigans involved, but I can do it if we agree it's worth it!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to print out where jquery is being included? We have a project with tons of dependencies and it would be a huge task to sift through all of those and figure out which one is using it.