Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Ember 3.5 upgrade #1541

Closed
wants to merge 4 commits into from
Closed

Ember 3.5 upgrade #1541

wants to merge 4 commits into from

Conversation

AaronTJDev
Copy link

Fixes #[1528].

Changes proposed in this pull request:

  • Upgraded ember-source, ember-data, and ember-cli from 2.18 to 3.5
  • Explicitly binded onclick events in template files, edit-panel.hbs, modal-dialog.hbs, and section.hbs, to get rid of compilation error.
  • Changed requires to imports in "tests/electron.js" & "tests/ember-electron/main.js", to get rid of compilation errors.

cc @HospitalRun/core-maintainers

@jsf-clabot
Copy link

jsf-clabot commented Oct 23, 2018

CLA assistant check
All committers have signed the CLA.

@donaldwasserman
Copy link
Contributor

Hey @AaronTJDev Thanks for the help.

So I forgot that ember 3.4 introduced stricter template linting rules by default.

@MatthewDorner - What's your thinking on this? Should we ignore the template linting rules and then turn them back on, or try to fix them all up front?

@AaronTJDev Would you be willing to give the template linting rules a stab?

@AaronTJDev AaronTJDev closed this Oct 23, 2018
@AaronTJDev AaronTJDev reopened this Oct 23, 2018
@AaronTJDev
Copy link
Author

@donaldwasserman Well, l was working on resolving that, but honestly I'm kind of lost on the template-linting issue. I tried running an "eslint --fix" on it, but it wasn't effective. Only thing that was working for me was disabling rules. Are there any automated tools that you could suggest that I look into?

@donaldwasserman
Copy link
Contributor

@AaronTJDev There's two solutions:

  1. Disable the rules in a .template-lintrc.js
module.exports = {
  extends: 'recommended',
  ignore: ['node_modules/*'],
  rules: {
    'simple-unless': false,
    'link-rel-noopener': false,
    'attribute-indentation': false,
  }
};

This is copied and pasted from my work's template lint file, so we'd want different values

  1. Is just fix the issues.

  2. Is fix all the issues that have a handlful of instances by hand, and then create tickets to do the rest.

There may be some functionality in VSCode to deal with this. I'll ask around (I'm not personally a VSCode user)

@AaronTJDev
Copy link
Author

So I was looking into the VS Code linting options and found this , https://youtu.be/qYOw2z6Og8I, I already have vs code but don't use it either, so I'll look into it when I have some time.

config.couchAuthDbURL = config.getProtocol(config.couchDbUseSsl) + config.couchCredentials() + config.couchDbServer + ':' + config.couchDbPort;
// config.searchURL = 'http:https://localhost:9200'; ELASTIC SEARCH URL (OPTIONAL)
config.serverInfo = 'Development Ember CLI server';
module.exports = config;
Copy link
Contributor

Choose a reason for hiding this comment

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

This file shouldn't get deleted.

@MatthewDorner
Copy link
Contributor

I tried the VSCode thing, I think it only works for .js ESLint though, not .hbs ember-template-lint. I am not very familiar with configuring these linters, or even with the upgrade process generally. But any things I can work on to help, I will.

Regarding the template errors, seems like a separate task. If there's a way to do it quickly now then we should, but otherwise later.

I'm getting more errors on "ember test" than just lint errors so maybe just get this to the point it passes all tests, and then decide what else we should do now and what later.

Also @AaronTJDev how did those "avoid-leaking-state-in-components" errors you were discussing in Slack get resolved?

@MatthewDorner
Copy link
Contributor

This extension works for VSCode https://marketplace.visualstudio.com/items?itemName=emberjs.vscode-ember, but doesn't have auto fix.

Most common violations are for 'quotes' (must use double quotes) which we can probably fix easily, and then this 'attribute-indentation' as seen in the screenshot. I don't even like that one.

ember-template-lint

Aside from those 2, there are 269 remaining instances of various types, that somebody can fix but will take a while. A lot of them don't seem like they would be fixable automatically even if there was such a tool.

@AaronTJDev
Copy link
Author

@donaldwasserman @MatthewDorner Alright, so for now I'll just disable the template lint rules until I can get "ember test" to pass all tests. Also, will restore the config-example.js. As far as the "avoid-leaking-state-in-components" errors, it was an error in how I had resolved the merge conflicts after running ember-cli-update, so I just started from scratch by cloning the repo again and ran a "git checkout --their ." I believe.

@@ -130,6 +130,16 @@ If you would like to load sample data, you can do so by navigating to **Load DB*

![Load DB screenshot](screenshots/load-db.png)

<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like there is a merge conflict here.

"start": "node script/server.js",
"test": "ember test",
"electron-test": "ember electron:test",
"translation-sync": "babel-node script/translation/sync.js --presets es2015 && eslint --fix app/locales",
"stylelint": "stylelint 'app/styles/**/*.scss'"
},
"repository": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like some of these properties got deleted

"ember-browserify": "^1.1.12",
"ember-cli": "2.17.1",
"ember-cli": "~3.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you pin this to 3.5.0 instead of ~3.5.0?

Suggested change
"ember-cli": "~3.5.0",
"ember-cli": "3.5.0",

"ember-concurrency": "0.8.21",
"ember-concurrency-test-waiter": "0.3.1",
"ember-data": "2.18.2",
"ember-data": "~3.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment about ember-cli versioning

"ember-radio-buttons": "^4.0.1",
"ember-rapid-forms": "^1.2.5",
"ember-resolver": "^5.0.1",
"ember-simple-auth": "^1.5.1",
"ember-sinon-qunit": "3.2.0",
"ember-source": "2.18.2",
"ember-source": "~3.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment about ember cli versioning

@donaldwasserman
Copy link
Contributor

@AaronTJDev That sounds good. I'll look into finding some more automated solutions for handling the template linting errors automatically.

@AaronTJDev
Copy link
Author

@MatthewDorner Alright, so I took a step back from this for about a week because I was having a ton of trouble getting the tests to pass. After coming back to it, I realized that it looks like the way the tests are performed have changed.

2.14
3 14

3.5
3 5

@MatthewDorner
Copy link
Contributor

Might we want to work on this in a new branch instead of master, so we can separate tasks into multiple smaller PRs?

@MatthewDorner
Copy link
Contributor

regarding the tests, looks like we can try this https://github.com/rwjblue/ember-qunit-codemod

@donaldwasserman
Copy link
Contributor

@MatthewDorner @AaronTJDev I've used the Qunit Codemod and it works really well. I'd say if all the tests pass after you run it, let's just keep it on master.

If there are more problems, breaking up is probably the right call

@AaronTJDev
Copy link
Author

AaronTJDev commented Nov 3, 2018

@MatthewDorner @donaldwasserman Yeah I'm still getting a lot of trouble out of it, breaking up may be the way to go. I tried running ember-qunit-codemod, as well as ember-test-helpers-codemod with little success.

@AaronTJDev AaronTJDev closed this Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants