Skip to content

Commit

Permalink
Ember 3.0, dep updates, testing updates, and codemods (emberjs#762)
Browse files Browse the repository at this point in the history
* Bump some deps

* Remove manual sass and lint

* First pass at ember 3

* Fix the first container test

* Convert to ember-test-helpers

* Use vertical-collection

* Use positional param for VC

* Fix some lint issues

* Fix the view tree

* Add trs with classes

* Add imports for wait helper

* Fix class

* WIP

* Remove usage of container-instance for simple action case.

* Fix acceptance test to use `find` / `findAll` without "context" element.

* Tweak ember debug tests to use newer ember testing setup..

* Fix a bunch of tests

* Remove unused container-instance component

* Fix more tests, use location: none

* Fix rootElement and binding tests

* Fix some missed __container__

* Lint ember_debug

* Fix getClassName resolver

* Add ember-try

* Filter ember-try to only test ember_debug

* Attempt to use stages

* Try to fix stages

* Try another env

* Try matrix

* Adjust matrix more

* Add missing :

* Fix indent lint

* fail_fast: false so we can see all test results

* Travis tweaks

* Move script to stage

* Maybe fix stage?

* Remove stages config, set script back to global

* Since stages do not proceed if the previous fails, switch them

* Bump ember-try, fix owner.factoryFor

* Restrict to master for builds

* Try skip cleanup

* Try to fix some hover issues

* Test with more ember versions

* Use short name for view

* Use Ember.Component instead of Ember.View

* Use controller.controller

We had an issue with controller._controller.

* Super hacky workaround for 2.10

* Work around computed issues in 3.1+ tests

* Fix lint issues

* Fix calculating computeds, cleanup TODOs

* Remove RowEventsMixin, move actions to trs

* Update yarn commands

* Fix view preview layer test

* Revert preview layer changes

* Revert previews, fix tests

* Remove the index property

It was used with EventRow mixin

* Remove ember-math-helpers

* Confirm removal of eslint test generator
  • Loading branch information
RobbieTheWagner authored and cyril-sf committed Mar 30, 2022
1 parent af6e451 commit 40a014f
Show file tree
Hide file tree
Showing 73 changed files with 2,714 additions and 2,314 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ember_debug/vendor/startup-wrapper.js
47 changes: 40 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
Expand Down Expand Up @@ -42,19 +48,19 @@ module.exports = {
'no-shadow': 0,
'no-use-before-define': [2, {
'classes': false,
'functions': false,
'functions': false
}],

/* Stylistic Issues */

'array-bracket-spacing': 2,
'block-spacing': 2,
'camelcase': [0, {
'properties': 'always',
'properties': 'always'
}],
'comma-spacing': [2, {
'before': false,
'after': true,
'after': true
}],
'comma-style': 2,
'computed-property-spacing': 2,
Expand All @@ -63,19 +69,19 @@ module.exports = {
'VariableDeclarator': {
'var': 2,
'let': 2,
'const': 3,
'const': 3
}
}],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true,
'afterColon': true
}],
'keyword-spacing': 2,
'linebreak-style': [2, 'unix'],
'max-len': [2, 250],
'max-nested-callbacks': [2, 5],
'new-cap': [2, {
'capIsNew': false,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
Expand Down Expand Up @@ -115,5 +121,32 @@ module.exports = {
'prefer-template': 2,
'require-yield': 2,
'template-curly-spacing': 2,

// Temporarily turn these off
'ember/avoid-leaking-state-in-ember-objects': 'off',
'ember/closure-actions': 'off',
'ember/no-on-calls-in-components': 'off',
'ember/jquery-ember-run': 'off',
'ember/use-brace-expansion': 'off'
},
overrides: [
// node files
{
files: [
'testem.js',
'ember-cli-build.js',
'config/**/*.js',
'lib/*/index.js',
'Gruntfile.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
};
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
/coverage/*
/libpeerconnection.log
npm-debug.log*
yarn-error.log
testem.log
config/secrets.json

/.mozilla-addon-sdk

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ dist_prev
.mozilla-addon-sdk

aws.json

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
48 changes: 39 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,48 @@
---
language: node_js

node_js:
- "6"

sudo: false
dist: trusty
sudo: required

addons:
chrome: stable

cache:
yarn: true

addons:
chrome: stable
env:
global:
- secure: EYaa9XxKkfJbQENuQPNFAIIieMWBiSknGCO9he8MH8ZHbqJODTjFixJnD5ZYLZCXH67SmjorBneznQHp8Xaf0aIuHbRhRY/MOUzqEWw12MmexW1kJF5wX+oxEnvzoiVAUJLNTIQi+g5WN43YBleASKMjUPa2i/3GBIcTlsVdf3U=
- secure: g+Qh9jUTpK1yFpcZi9O8rsybfqv3TFE2hTFvG8XZ+QaQYBLLZ52JfhsJhdI0cvRRp7qWOhzE784iadkPWgvhj8c0/N/af5ZrSP3ceiv6RKqSUG2/iQyzX/qUh3vqrZ7a4xTsELTwswQtR+sA+I+DQVVlnqcCqYTAW2SFR/D4H8o=

jobs:
fail_fast: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
# runs tests for ember_debug against each supported Ember version
- stage: ember debug test
env: EMBER_TRY_SCENARIO=ember-2.7
- env: EMBER_TRY_SCENARIO=ember-lts-2.8
- env: EMBER_TRY_SCENARIO=ember-2.9
- env: EMBER_TRY_SCENARIO=ember-2.10
- env: EMBER_TRY_SCENARIO=ember-2.11
- env: EMBER_TRY_SCENARIO=ember-lts-2.12
- env: EMBER_TRY_SCENARIO=ember-lts-2.16
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default

# runs tests with current locked deps and linting
- stage: test
script:
- yarn lint:js
- yarn test

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
Expand All @@ -23,12 +54,11 @@ install:
- bower install

script:
- yarn test
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup=true --- node_modules/.bin/ember test --filter="Ember Debug"

after_success:
- test $TRAVIS_BRANCH == "stable" && yarn run upload

env:
global:
- secure: EYaa9XxKkfJbQENuQPNFAIIieMWBiSknGCO9he8MH8ZHbqJODTjFixJnD5ZYLZCXH67SmjorBneznQHp8Xaf0aIuHbRhRY/MOUzqEWw12MmexW1kJF5wX+oxEnvzoiVAUJLNTIQi+g5WN43YBleASKMjUPa2i/3GBIcTlsVdf3U=
- secure: g+Qh9jUTpK1yFpcZi9O8rsybfqv3TFE2hTFvG8XZ+QaQYBLLZ52JfhsJhdI0cvRRp7qWOhzE784iadkPWgvhj8c0/N/af5ZrSP3ceiv6RKqSUG2/iQyzX/qUh3vqrZ7a4xTsELTwswQtR+sA+I+DQVVlnqcCqYTAW2SFR/D4H8o=
branches:
only:
- "master"
12 changes: 6 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = function(grunt) {
var packageJson = grunt.file.readJSON('package.json');
var versionedPane = 'panes-' + packageJson.emberVersionsSupported[0].replace(/\./g, '-');
var config = {
let packageJson = grunt.file.readJSON('package.json');
let versionedPane = `panes-${packageJson.emberVersionsSupported[0].replace(/\./g, '-')}`;
let config = {
pkg: packageJson,
env: process.env,
"s3": {
Expand Down Expand Up @@ -47,7 +47,7 @@ module.exports = function(grunt) {
},
expand: true,
pretty: true,
cwd: 'dist/chrome/' + versionedPane,
cwd: `dist/chrome/${versionedPane}`,
src: ['**/*']
},
"firefox-pane": {
Expand All @@ -56,7 +56,7 @@ module.exports = function(grunt) {
},
expand: true,
pretty: true,
cwd: 'dist/firefox/' + versionedPane,
cwd: `dist/firefox/${versionedPane}`,
src: ['**/*']
},
"bookmarklet-pane": {
Expand All @@ -65,7 +65,7 @@ module.exports = function(grunt) {
},
expand: true,
pretty: true,
cwd: 'dist/bookmarklet/' + versionedPane,
cwd: `dist/bookmarklet/${versionedPane}`,
src: ['**/*']
}
}
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OR:
- cd into the repo directory
- run `yarn install && bower install`
- run `yarn global add ember-cli`
- run `yarn run build` to build the `dist` directory
- run `yarn build` to build the `dist` directory
- Visit `chrome://extensions` in Chrome
- Make sure `Developer mode` is checked
- Click on 'Load unpacked extension...'
Expand All @@ -32,7 +32,7 @@ OR:
- cd into the repo directory
- run `yarn install && bower install`
- run `yarn global add ember-cli`
- run `yarn run build` to build the `dist` directory
- run `yarn build` to build the `dist` directory
- Visit `about:debugging` in Firefox
- Click on 'Load Temporary Addon-on'
- Choose the `dist/firefox/manifest.json` file in the cloned repo
Expand All @@ -43,7 +43,7 @@ OR:
- cd into the repo directory
- run `yarn install && bower install`
- run `yarn global add ember-cli`
- run `yarn run build` to build the `dist` directory
- run `yarn build` to build the `dist` directory
- Visit `chrome://extensions` in Opera
- Make sure `Developer mode` is checked
- Click on 'Load unpacked extension...'
Expand All @@ -60,7 +60,7 @@ Internet explorer will open an iframe instead of a popup due to the lack of supp

For development:

- run `yarn run serve:bookmarklet`
- run `yarn serve:bookmarklet`
- create a bookmark (make sure you unblock the popup when you run the bookmarklet):

```javascript
Expand All @@ -71,8 +71,8 @@ javascript: (function() { var s = document.createElement('script'); s.src = 'htt

Run `yarn install && yarn global add ember-cli && yarn global add bower && bower install && grunt-cli` to install the required modules.

- `yarn run build` to build the files in the `dist` directory
- `yarn run watch` To watch the files and re-build in `dist` when anything changes (useful during development).
- `yarn build` to build the files in the `dist` directory
- `yarn watch` To watch the files and re-build in `dist` when anything changes (useful during development).
- `yarn test` To run the tests in the terminal
- `yarn start` To start the test server at `localhost:4200/testing/tests`

Expand Down Expand Up @@ -104,7 +104,7 @@ When releasing a major/minor version, master would already have this version set
#### Steps to publish

- Push the `stable` branch to github (this will publish the bookmarklet version).
- `yarn run build:production`
- `yarn build:production`
- `git tag` the new version
- Follow the "Publishing to Chrome" steps
- Follow the "Publishing to Firefox" steps
Expand Down Expand Up @@ -142,7 +142,7 @@ Here are the steps to lock an inspector version:

- Update `package.json`'s `emberVersionsSupported`: add a second element that indicates the minimum Ember version this inspector *does not* support.
- Release a new version (See "Minor and major versions"). Create a branch for this version.
- Run `yarn run lock-version`. This will build, compress, and upload this version to S3.
- Run `yarn lock-version`. This will build, compress, and upload this version to S3.
- Update `package.json`'s `previousEmberVersionsSupported`: add the first Ember version supported by the recently locked version (the first element in the `emberVersionsSupported` array).
- Update `package.json`'s `emberVersionsSupported`: Move the second element in the array to the first position. Add an empty string as the second element to indicate there's currently no maximum Ember version supported yet.
- Commit.
Expand Down
13 changes: 0 additions & 13 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ const App = Application.extend({
Resolver
});

// TODO: remove this when fixed
// problem description: registry classes being registered
// again on app reset. this will clear the registry.
// long term solution: make registry initializers run once on app
// creation.
// issue: https://github.com/emberjs/ember.js/issues/10310
// pr: https://github.com/emberjs/ember.js/pull/10597
App.reopen({
buildInstance() {
this.buildRegistry();
return this._super(...arguments);
}
});

config.VERSION = version;

Expand Down
21 changes: 0 additions & 21 deletions app/components/container-instance.js

This file was deleted.

12 changes: 6 additions & 6 deletions app/components/drag-handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ export default Component.extend({

$('body').on(`mousemove.${namespace}`, e => {
let position = this.get('isLeft') ?
e.pageX - $containerOffsetLeft :
$containerOffsetRight - e.pageX;
e.pageX - $containerOffsetLeft :
$containerOffsetRight - e.pageX;

position -= this.get('left');
if (position >= this.get('minWidth') && position <= this.get('maxWidth')) {
this.set('position', position);
this.get('on-drag')(position);
}
})
.on(`mouseup.${namespace} mouseleave.${namespace}`, () => {
this.stopDragging();
});
.on(`mouseup.${namespace} mouseleave.${namespace}`, () => {
this.stopDragging();
});
},

stopDragging() {
Expand All @@ -89,7 +89,7 @@ export default Component.extend({
return false;
},

style: computed('side', 'position', 'left', function () {
style: computed('side', 'position', 'left', function() {
let string;
if (this.get('side')) {
string = `${this.get('side')}: ${(this.get('position') + this.get('left'))}px;`;
Expand Down
Loading

0 comments on commit 40a014f

Please sign in to comment.