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

feat: update-ember-cli-project #213

Merged
merged 47 commits into from
Dec 9, 2021

Conversation

rahulk94
Copy link
Contributor

@rahulk94 rahulk94 commented Dec 1, 2021

Description

This PR bumps this project up to the latest Ember CLI blueprint. This change has primarily been done using ember-cli-update followed up by commits to update tests and the source to follow newer lint rules.

This should be pretty straightforward / match other Ember CLI updates for addons as I've tried to do keep things as standard as possible here.

Not all lint rules have been addressed at this stage, I think upgrading the CLI version and later addressing lint rules is probably a more tactiful approach.

The tests are passing with Ember@3 LTS versions and failing with Ember@4 versions (which is fine since we're not aiming to add support for that in this PR as it drops lots of deprecated functionality). Embroider safe and optimized builds also fail atm and I'll do a separate PR to address that (as I think there's more issues around Babel with Embroider too).

New Feature

  • If this is a big feature with breaking changes, consider [opening an issue][issues] to discuss first. This is completely up to you, but please keep in mind that your PR might not be accepted.
  • Run unit tests to ensure all existing tests are still passing
  • NA - Add new passing unit tests to cover the code introduced by your PR
  • NA - Update the readme
  • Add some steps so we can test your cool new feature!
  • The PR title is in the conventional commit format: e.g. feat(<area>): added new way to do this cool thing #issue-number
  • Add your info to the contributors array in package.json!

Steps to Test

Running the tests and also the dummy app in this project should work as expected.

I've also integration tested this with our internal Ember app and verified this works as expected. Unfortunately I can't share that as it's closed source.

Rahul Kumar added 30 commits November 23, 2021 18:00
@commit-lint
Copy link

commit-lint bot commented Dec 1, 2021

Contributors

rahulk94

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

Comment on lines +1 to +2
import { getOwnConfig } from '@embroider/macros';
const APP_VERSION = getOwnConfig().version;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ed F's fix from the Embroider support issue seems to have fixed this when using babel@7 deps
#210 (comment)

init() {
this._super(...arguments);
deprecate(
'imgix-image-wrapped is deprecated and will be removed in ember-cli-imgix@3. Please migrate to using imgix-image instead.',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please be aware that rather than updating this component I've just chopped it since it is probably best we cut a major now anyway (as the ember-cli-babel bump that comes with this PR probably warrants a major)

"ember-get-config": "0.2.4",
"ember-cli-babel": "^7.26.6",
"ember-cli-htmlbars": "^5.7.1",
"ember-get-config": "0.2.4 - 0.5.0",
"ember-resize-aware": "1.2.0",
"fastboot-transform": "^0.1.2",
"imgix-core-js": "2.3.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In a separate PR we can switch this to use imgix/js-core since thats the new preferred name

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good 👍

Copy link
Contributor

@frederickfogerty frederickfogerty left a comment

Choose a reason for hiding this comment

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

This looks good to me on the surface. I tried running the tests on CI (excluding lint), and it seems that the ember try cases are failing - even though the basic tests are succeeding. Take a look here for failing tests, and here for succeeding tests

"ember-get-config": "0.2.4",
"ember-cli-babel": "^7.26.6",
"ember-cli-htmlbars": "^5.7.1",
"ember-get-config": "0.2.4 - 0.5.0",
"ember-resize-aware": "1.2.0",
"fastboot-transform": "^0.1.2",
"imgix-core-js": "2.3.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good 👍

@frederickfogerty
Copy link
Contributor

To be clear here, I'm pretty happy with the state of this PR. If we can get to a resolution about the Travis build and what to do to make sure it passes, then I'm happy to merge this.

@rahulk94
Copy link
Contributor Author

rahulk94 commented Dec 1, 2021

Hey @frederickfogerty thanks the quick first pass and getting the build to run on Travis.

Take a look here for failing tests

=== Scenario: ember-lts-3.20 ===================================================
Result: true

=== Scenario: ember-lts-3.24 ===================================================
Result: true

=== Scenario: ember-lts-3.28 ===================================================
Result: true

=== Scenario: ember-release ====================================================
To use these addons, your app needs ember-auto-import >= 2: ember-source
Result: false

=== Scenario: ember-beta =======================================================
To use these addons, your app needs ember-auto-import >= 2: ember-source
Result: false

=== Scenario: ember-canary =====================================================
To use these addons, your app needs ember-auto-import >= 2: ember-source
=================================================================================
Result: false

=== Scenario: ember-classic ====================================================
Result: true

=== Scenario: embroider-safe ===================================================
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
The build has been terminated

Yeah so I'm not 100% sure what the best approach here is atm the moment. The Ember LTS series against version 3 all pass which is great, but the release, beta and canary are all failing due to us still using ember-auto-import (EAI) 1.x. EAI has recently had a major release which is not backwards compatible (I'll let you skim the upgrade/migration summary section rather than try re-explain it) and so that fails those builds. Ember release/beta/canary are all running Ember@4 as well which drops deprecated functionality (I have not checked if we are doing anything thats been dropped just yet). Embroider Ember Try builds are expected to fail at this stage (I haven't tried getting compatibility going and they just timeout weirdly).

Summing up, what are your thoughts on commenting the release, beta, canary, and Embroider options out in the Ember Try config and cutting a 3.0.0-beta.1 style release? I can then look at making Embroider options work since thats what I'm hear to try solve 😂 and do a 3.0.0-beta.2 and then we can see if we want/need to do anything else before cutting a 3.0.0 release?

Ember@4 support can be discussed in a later PR but depending on how easy it is/my capacity I may cheap out and just do a README note and Issue saying Ember we need to add Ember@4 compat soon.

@frederickfogerty
Copy link
Contributor

Right, that makes sense as to why those builds are failing then, and I'm happy to comment out those stages and proceed as you suggested. It seems that the ember try environment variable (EMBER_TRY_SCENARIO) isn't working properly, I will need to fix this before merging as well. Do you have any ideas how to fix this? I could also just use one ember try since it seems that is already doing all of the steps 😅

Totally understand about Ember 4, and thanks for all your help until now!

@rahulk94
Copy link
Contributor Author

rahulk94 commented Dec 2, 2021

Hey @frederickfogerty I've removed the Ember@4 and Embroider stuff per our earlier discussion.

I've also updated the Travis.yml to call yarn test:ember-compatibility in the second stage so it should call Ember Try now, whereas earlier I think it was just doing ember test again 😅 . I reckon start the build and lets see how far we get now.

Oh also, commit lint is complaining at me but I can't tell what I've done wrong since it just links to generic docs rather than the broken rule so if you can tell let me know and I can touch it up 😂

@@ -59,20 +84,21 @@
"responsive"
],
"dependencies": {
"babel-plugin-inline-package-json": "^2.0.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frederickfogerty I've removed this plugin (and the newer equivalent) in the most recent commit so that consumers of this dependency don't specifically need the version we set. I was seeing some babel weirdness when integrating this with our app and realized its cause we'd declared a version new version of this as the minimum.

Fwiw its brought in transitively via ember-cli-babel so I reckon we're safe without it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me 👍

@sherwinski
Copy link
Contributor

sherwinski commented Dec 3, 2021

Oh also, commit lint is complaining at me but I can't tell what I've done wrong since it just links to generic docs rather than the broken rule so if you can tell let me know and I can touch it up 😂

@rahulk94 Maybe I can chime in here. Commit lint expects the PR title to conform to a specific format, detailed here. So if you were to edit the PR title that check should pass.

@rahulk94 rahulk94 changed the title feat/update-ember-cli-project feat:update-ember-cli-project Dec 4, 2021
@rahulk94 rahulk94 changed the title feat:update-ember-cli-project feat: update-ember-cli-project Dec 4, 2021
@rahulk94
Copy link
Contributor Author

rahulk94 commented Dec 4, 2021

@sherwinski 🤦🏾‍♂️ cheers mate... Had a / instead of a : 🥲

@frederickfogerty
Copy link
Contributor

Hey @rahulk94 - just leaving an interim comment here. I worked on Friday to try get the Travis build to pass, but didn't succeed. I will have a bit more time tomorrow, so hopefully I can have an update to you by then 👍 You can track my progress here for the branch "upgrade/update-ember-cli"

- use travis wait
- build without embroider since currently not supported
- use single travis step instead of one for each try step
- add info about why builds are commented out
- comment out lint task
- remove branches from travis config
Copy link
Contributor

@frederickfogerty frederickfogerty left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks so much for the help here @rahulk94 🙌

@frederickfogerty
Copy link
Contributor

I got the tests passing here so I'll go ahead and merge this 🎉

@frederickfogerty frederickfogerty merged commit f7bd774 into imgix:main Dec 9, 2021
@frederickfogerty
Copy link
Contributor

@rahulk94 I opened up this PR to release v3 of this library. If you have any improvements on the release notes there, I'm all ears. Thanks!

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