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

Support ember-modifier v4 & ember-style-modifier v2 + v3 #691

Closed
wants to merge 5 commits into from

Conversation

mkszepp
Copy link
Collaborator

@mkszepp mkszepp commented Jan 25, 2023

fix #689

Changes:

  • Widen version range for ember-modifier to include ^4.0.0
  • Add ember-auto-import@^2 as a dependency (breaking change)
  • Drop support for node 12 (breaking change)

Cause of ember-modifier@4 we are already have braking, so can also support more versions of ember-style-modifier (v2 + v3). This versions are bringing also breaking changes.

  • v2 needs ember-auto-import@^2
  • v3 requires peerDependency @ember/string (this warning starts with ember v4.10)

* Widen version range for ember-modifier to include ^4.0.0
* Add ember-auto-import@^2 as a dependency
* Drop support for node 12
@jelhan
Copy link

jelhan commented Jan 28, 2023

Tests are failing due to potential memory leak detected:

ember-cli-memory-leak-detector: Memory leak detected. 
The following classes were retained in the heap after tests completed: 
  BasicDropdownTrigger x2
  BasicDropdownContent x1
  BasicDropdown x3

I don't have much experience with ember-cli-memory-leak-detector. Maybe it is just a false positive? If not, it is likely a regression in an upstream dependency. I think we should first restart the test and see if it is passing in a second try.

@mkszepp
Copy link
Collaborator Author

mkszepp commented Jan 29, 2023

@jelhan maybe caused by qunit > 2.14, see steveszc/ember-cli-memory-leak-detector#51

I have now recovered the old package.lock file & updated only the packages, which we want update

Update: Seen that we have already v2.19.3 installed, so maybe a other package updates brings this leaks...
Local with commitet package.lock i have no leaks, all tests were passed... I think in github test are alway using the latest version of packages... so we need to find out which packages brings this problems.

@mkszepp
Copy link
Collaborator Author

mkszepp commented Jan 29, 2023

The ember-cli-memory-leak-detector v0.7.1 was the problem... now we use strict v0.5.1, which was installed since now. Starting with v0.6.1 there comes the error for memory leak

@jelhan
Copy link

jelhan commented Feb 1, 2023

@mkszepp Embroider optimized scenario is failing with the following error:

[Embroider:MacrosConfig] cannot read userConfigs until MacrosConfig has been finalized.

Could be caused by outdated Embroider version.

package.json Outdated
"ember-truth-helpers": "^2.1.0 || ^3.0.0"
},
"peerDependencies": {
"@ember/string": "^3.0.1"
Copy link

Choose a reason for hiding this comment

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

I don't think you need having @ember/string as a peer dependency here. It should only be needed if the addon imports from @ember/string itself. Adding it to devDependencies should be enough if it only depends on another addon (here: ember-style-modifier), which requires that package. Adding it to devDependencies makes it available for the test app, which should be enough.

The difference is important if ember-style-modifier drops the peer dependency. If you have it declared as a peer dependency here as well, consumers would still need to install it even if it is not used anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jelhan sry my delay... thats right, i have removed the peerDependency

@jelhan
Copy link

jelhan commented Feb 4, 2023

@mkszepp @cibernox Please let me know if I can help getting this one in.

@cibernox
Copy link
Owner

cibernox commented Feb 4, 2023

Is expected that the embroider scenario is failing for these changes?

@mkszepp
Copy link
Collaborator Author

mkszepp commented Feb 5, 2023

@cibernox no, the error Embroider optimized scenario, has nothing to do with this changes... i can also reproduce it with the current master version.

The error is maybe caused, because some packages are bringing as dependency ember-cli-htmlbars < 5.3.2. embroider-build/embroider#882

To fix the macro error, we need to update asome devDependencies...
I have tried this already some days ago, but the problem is, that some packages are very old, so we must remove old packages (if there is possible) or we create PR for this packages...

@jelhan
Copy link

jelhan commented Feb 5, 2023

@cibernox Current master seems to have similar problems as @mkszepp run into in this MR. E.g. latest scheduled run for master failed with the memory leak detection error, which @mkszepp fixed here. See https://github.com/cibernox/ember-basic-dropdown/actions/runs/4094738908/jobs/7061169669 for failing CI pipeline and #691 (comment) for information on the fix.

There seems to be many outdated dependencies making the tests unstable. I feel we need to get back to a stable state. In my experience upgrading one dependency at a time works out best. And using a tool like Dependabot or RenovateBot to reduce the manual workload. Main trade-off of this approach is that it requires many small PRs to be reviewed and merged over a couple of days or even weeks. @cibernox Do you have time doing so?

@mkszepp Maybe we could start by pulling out the fix for the memory leak issue in a separate PR and landing that one first? This also tells us if the fix for memory leak issue or the other upgrades in this PR caused the regression with Embroider tests.

@mkszepp
Copy link
Collaborator Author

mkszepp commented Feb 5, 2023

@cibernox @jelhan The following packages are bringen an outdated ember-cli-htmlbar (we use v6.x)

Maybe only ember-code-snippet is causing our problem, because it is v3.x, all other are automatically latest ´v5.x` which would be ok.

I'm on the same opinion as @jelhan . We can merge this changes without any problems. After that, we should try to update ember-code-sinppet and making a PR, because i think after updating this package we can fix the Embroider optimized error.

When we have solved the Embroider optimized error we should also retry to update ember-cli-memory-leak-detector...

@mkszepp
Copy link
Collaborator Author

mkszepp commented Feb 5, 2023

i have started a draft to update all dependencies manually (#696).

Now i will try to update ember-code-snippet` (lets see, in which error we run as next :) )

@mkszepp
Copy link
Collaborator Author

mkszepp commented Feb 6, 2023

@jelhan @cibernox the macro problem occurs, when we use "ember-cli-htmlbars": "^6.2.0" as dependency. When we downgrade this dependency to ^5.3.2 the embroider tests are working. It looks like a mix of v5 & v6 are causing this problem... The update to v6.x was done in #631 (Okt 2021).

I have tested only the embroider try szenario's locally with this commit changes 9d6da21#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519 and it was fixed.

Using "ember-cli-htmlbars": "^5.3.2 || ^6.2.0" was also not helpful (build fails)

@cibernox cibernox closed this in #696 Feb 6, 2023
@mkszepp mkszepp deleted the support-ember-modifier-v4 branch February 7, 2023 06:00
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.

Support ember-modifier@4
3 participants