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

fix: support vue hot reload. #785

Merged
merged 2 commits into from Oct 26, 2021
Merged

fix: support vue hot reload. #785

merged 2 commits into from Oct 26, 2021

Conversation

andycall
Copy link
Member

No description provided.

@cnryb
Copy link
Member

cnryb commented Oct 26, 2021

目前的代码执行 samples 中的 hello-vue 会闪退

answershuto
answershuto previously approved these changes Oct 26, 2021
@andycall
Copy link
Member Author

我这个是 ok 的

@answershuto
Copy link
Member

目前的代码执行 samples 中的 hello-vue 会闪退

你用的是这个分支吗

@cnryb
Copy link
Member

cnryb commented Oct 26, 2021

使用 gh pr checkout 785 获取的代码。没有执行 clean 操作,跟这个会有关系吗?

@andycall
Copy link
Member Author

需要重新编一下 bridge

@cnryb
Copy link
Member

cnryb commented Oct 26, 2021

在一个新的位置 clone 了代码进行测试,仍然闪退。

控制台的输出是这个样子的


An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:58352/n5rdnEnyi5g=/
flutter: Kraken getting bundle for contextId: 0, path: assets/bundle.js
The Flutter DevTools debugger and profiler on macOS is available at:
http://127.0.0.1:58361?uri=http%3A%2F%2F127.0.0.1%3A58352%2Fn5rdnEnyi5g%3D%2F
flutter: Kraken getting bundle for contextId: 0, path: http://localhost:8080/js/app.js
[HMR] Waiting for update signal from WDS...
Lost connection to device.

@answershuto
Copy link
Member

有没有 C++的崩溃堆栈

@cnryb
Copy link
Member

cnryb commented Oct 26, 2021

就真的是一闪就没了。控制台就那么点内容了。之前程序闪退之后还会有个框提示一下,这两次测试连提示框也没了。
你们那里复现不出来这个问题吗?

@andycall
Copy link
Member Author

@cnryb 修好了。window.postMessage 少了一个 return value。

@cnryb
Copy link
Member

cnryb commented Oct 26, 2021

能够正常渲染了

@@ -6,6 +6,7 @@
#include "window.h"
#include "dart_methods.h"
#include "bindings/qjs/qjs_patch.h"
#include "bindings/qjs/dom/events/.gen/message_event.h"
Copy link
Member

Choose a reason for hiding this comment

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

看这个路径感觉怪怪的,没什么问题吧?
有两处 1、以 . 开头的目录, 2 目录名是 gen 感觉里面的东西像是用代码生成的

Copy link
Member Author

Choose a reason for hiding this comment

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

使用了这里实现的代码生成器生成的代码

https://github.com/openkraken/kraken/tree/main/bridge/scripts/code_generator

Copy link
Member Author

Choose a reason for hiding this comment

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

没啥问题,生成代码只是省事

@@ -36,6 +37,7 @@ class Window : public EventTarget {
ObjectFunction m_scroll{m_context, m_prototypeObject, "scroll", scrollTo, 2};
ObjectFunction m_scrollTo{m_context, m_prototypeObject, "scrollTo", scrollTo, 2};
ObjectFunction m_scrollBy{m_context, m_prototypeObject, "scrollBy", scrollBy, 2};
ObjectFunction m_postMessage{m_context, m_prototypeObject, "postMessage", postMessage, 3};
Copy link
Member

Choose a reason for hiding this comment

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

这些魔法数字要找机会统一处理一下么?

Copy link
Member Author

Choose a reason for hiding this comment

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

postMessage 有 3 个参数,这个参考 Web 标准

Copy link
Member

Choose a reason for hiding this comment

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

这些函数的最后一个数字参数都是几个参数的意思么

Copy link
Member Author

Choose a reason for hiding this comment

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

@andycall andycall merged commit 9101b12 into main Oct 26, 2021
@andycall andycall deleted the fix/vue-hot-reload branch October 26, 2021 12:33
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.

None yet

3 participants