-
Notifications
You must be signed in to change notification settings - Fork 6k
Conversation
@eyebrowsoffire ptal. @ditman, @mdebbar FYI, please feel free to review if you like. |
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.
LGTM if @eyebrowsoffire likes it.
@@ -10,7 +11,8 @@ import 'package:ui/src/engine.dart' as engine; | |||
import 'package:ui/ui.dart' as ui; | |||
|
|||
@JS('_flutter') | |||
external set loader(Object? loader); | |||
external set _loader(JSAny? loader); | |||
set loader(Object? l) => _loader = l?.toJSAnyShallow; |
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.
Took me a while to figure out why this was a setter (it's a test 🤦)
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.
I may be misunderstanding something here, but isn't this redundant with the js_util.jsify(...)
calls below?
set loader(Object? l) => _loader = l?.toJSAnyShallow;
// in tests:
loader = js_util.jsify(<String, Object>{
'loader': <String, Object>{
'didCreateEngineInitializer': allowInterop(() { print('not mocked'); }),
},
});
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.
Ahh yea, good catch, it is redundant. I'm not actually trying to investigate usage patterns too deeply at this phase of the migration, mostly to derisk the conversion. That said, this is a good candidate for cleanup when we try to push JS types deeper into the Web engine. Thankfully this is a test, and jsify
now has fast paths for types it doesn't need to convert.
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.
Looks great! I have one comment... it's not necessarily blocking but it would be really nice if you had the time to do it.
ef4ac03
to
2943832
Compare
Roll Flutter Engine from bb51cda2fa47 to 5775c6b05fa4 (1 revision)
…23217) Commit: b42e8db6cf8f7aa0e8debb7dec423b9080d3727f
No description provided.