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

Use ember-modifier v3 API #5

Merged
merged 5 commits into from
Feb 20, 2023
Merged

Use ember-modifier v3 API #5

merged 5 commits into from
Feb 20, 2023

Conversation

tcjr
Copy link
Contributor

@tcjr tcjr commented Dec 12, 2022

This PR updates the class-based modifiers to use the ember-modifier v3 API.

In summary

  • The lifecycle hooks didInstall, didReceiveArguments, didUpdateArguments have all been replaced with a single modify hook. This hook gets called on initial install and whenever the args change.
  • The Modify base class no longer provides this.element. Instead, element is provided in the modify hook, so the modifier implementation sets this.element there.
  • The Modify base class no longer provides this.args. Instead, positional and named args are passed to the modify hook. I updated the implementation to set this._namedArgs and this._positionalArgs so the rest of the code can use those where it used to use this.args.named and this.args.positional respectively.
  • The willDestroy hook has been removed. Instead, the implementation registers a cleanup function in the modifier's constructor using @ember/destroyable. I moved the code that was in the willDestroy hook into this cleanup function.

I updated the ember-try scenarios and ci to include the last two LTS versions (4.4 and 4.8).

I also updated the package.json to drop ^2.0.0 from the ember-modifier dependency. I guess this means if you merge this, it's a breaking change so maybe you'll need to bump the major version.

Fixes #4

@donaldsonjulia
Copy link

donaldsonjulia commented Feb 16, 2023

Would love if this could be merged. At this point we cannot continue to use ember-tippy in our project because of the ember-modifier deprecations. The changes made in this PR fix the functionality.

@nag5000
Copy link
Owner

nag5000 commented Feb 18, 2023

@tcjr The changes of package-lock.json and .npmrc seems are not really related to this PR, could you exclude it from the changes?

I no longer follow the ember-modifier changes and the ember ecosystem in general, but I believe I can merge it and release it as a beta version. Thank you!

@tcjr
Copy link
Contributor Author

tcjr commented Feb 20, 2023

@nag5000 I removed the .npmrc and instead updated the ember-try config. I also updated the CI workflow since github wants us to use Node 16 in actions.

These should all pass now. https://github.com/nag5000/ember-tippy/actions/runs/4226303928

@nag5000 nag5000 merged commit 9d1ef9e into nag5000:master Feb 20, 2023
@nag5000 nag5000 added breaking :boom: Breaking Change internal Internal labels Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking :boom: Breaking Change internal Internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation warnings
3 participants