-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Convert FlashObject
to native class
#394
Convert FlashObject
to native class
#394
Conversation
6a85006
to
f92ff84
Compare
Add regression test
f92ff84
to
23cd226
Compare
@@ -1,5 +1,15 @@ | |||
# Upgrading ember-cli-flash | |||
|
|||
## Upgrading to v6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming next release will be v6, although minor, this is a breaking change.
Would be good to batch all the remaining internal changes and TypeScript migration in the same update...
@tracked exiting = false; | ||
@tracked message = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This this is no longer an EmberObject. Only the tracked properties will update rendered flash messages. We may want to track type
as well, although I'm not sure if that would even work.
@@ -18,23 +19,29 @@ module('Integration | Component | flash message', function (hooks) { | |||
setupRenderingTest(hooks); | |||
|
|||
test('it renders a flash message', async function (assert) { | |||
this.set('flash', FlashMessage.create({ message: 'hi', sticky: true })); | |||
const flash = new FlashMessage({ message: 'hi', sticky: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the FlashMessage need associateDestroyableChild
when it's created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea. I've implemented this in FlashMessagesService
when the messages are created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NullVoxPopuli migrated the destruction to use @ember/destroyable
. Seems to work good, there are quite a lot of tests that were checking destruction timing
@@ -11,6 +11,5 @@ declare module 'ember-cli-flash/flash/object' { | |||
allowExit(): void; | |||
timerTask(): void; | |||
exitTimerTask(): void; | |||
destroy(): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an EmberObject
method. Public API destroyMessage()
will destroy the message and should be used instead.
This will be
breaking
due togetFlashObject
public APITo do
.get()
etc on FlashObject instancesAs for these two I'm not sure what their purpose is, I couldn't find any mention of them in the docs or PRs/issues. I don't think they are public API...