Conversation
|
Repro is with the build from https://github.com/brimdata/zui/actions/runs/4920574674. Not a serious bug, but I've noticed that when selecting Show Welcome Page from the Help pull-down menu, nothing happens. The error Repro.mp4 |
|
I've marked this PR with a "do not merge" label for now since we've discussed holding off on merging it until we put out another GA Zui release. That way we can merge it right after that release and it'll have more soak time through internal testing and Zui Insiders before we put out yet another GA Zui release in the future. |
|
Now that GA Zui v1.1.0 is out and this branch has been caught up with First, I've verified that the three issues I reported in comments above have all been fixed. 👍 Here's a new issue I found, though. While the About window comes up ok now, I can click on the links shown for Website and Source and they come up in my browser as expected. However, clicking on either License or Acknowledgments is a no-op. Doing the same in a GA Zui on my Mac, the relevant files are opened up for view in a text editor. Interestingly, I only had that problem on macOS. On Windows it opened the files in the text editor as expected. |
|
I've made a note-to-self for when preparing the next Zui release I'll need to update these docs to show the new paths in this PR that take the place of the former
|
|
When upgrading from an older release and the migrations successfully move |
philrz
left a comment
There was a problem hiding this comment.
Using a new Dev build in https://github.com/brimdata/zui/actions/runs/5083087906 I've verified the fixes to the last couple issues reported in comments above. I feel like I've done enough testing on this one for it to merge and get some extended soak time in Zui Insiders before the next GA release, so, 👍.
philrz
left a comment
There was a problem hiding this comment.
Using a new Dev build in https://github.com/brimdata/zui/actions/runs/5083087906 I've verified the fixes to the last couple issues reported in comments above. I feel like I've done enough testing on this one for it to merge and get some extended soak time in Zui Insiders before the next GA release, so, 👍.

To Do List:
Things to Test
Summary
An electron app is composed of a main node process, and one or more chrome renderer processes. Electron makes it possible to use node APIs within the renderer processes. This is done by providing an option to the BrowserWindow constructor called nodeIntegration: true. 5 years ago, this was the default. It was what made electron unique. However, this created big security risks. Since a web browser is built to load remote files. When remote files are loaded, they also have full access to the node apis, and thereby the computer they are running on. (file system, processes, etc...).
It became good practice to turn off nodeIntegration and use interprocess communication to access the powerful node apis. That is now the default in latest electron versions.
Historically, our app has been like a node application that runs in the browser. With this PR, I have turned off nodeIntegration and migrated to ipc for everything that needs node APIs.
Plugins
The biggest place we used the node apis was in the plugins for brimcap, zeek, and suricata. These have been re-arranged to run in the node process. The API they use to interact with the app has been much improved as well in this PR.
Zealot
This PR now uses the built versions of @brimdata/zed-js and @brimdata/zed-node published on NPM and maintained in the brimdata/zealot repo.
Packaged Files
I changed the electron-builder configuration to only include files from
dist/,out/, andzdeps/. It was previously including everything. I also notice that we bundle two versions of thezedandzq. We also include some other rather large binaries from the zed repo we don't need. We could reduce the size of the packaged app by 200Mb if we fix this and only include what we need.Installers
Installers now get put in
installers/. They were previously indist/installers/. But since dist was and is included in the package other versions of the installers could be included in the app package. That's why some builds were many gigabytes large. 🤦New Tools & Commands
Renderer
We now use nextjs to build the renderer javascript bundle.
This starts a dev server on port 3000 and serves the html the browser window needs. It will perform hot module reloading whenever a file changes. The main process, when in dev mode, will load this url. Changes to files will immediately be reflected in the browser window.
This will create an folder (
/out) of optimized, static files to serve in production mode. This is located in theout/folder. When the app is in production mode, it will load these files directly from the file system.Main
We use esbuild to build the main process bundle.
Esbuild bundles all the typescript files used in the main process into one javascript file. This is not required in node, but is convenient as it allows us to keep all our source typescript files (main and renderer) in the same directory. Esbuild works by only including that are imported, not everything in a directory.
This runs the below command and triggers a rebuild whenever files change.
This wraps the electron start script in a tool called nodemon. This will watch a directory and restart the node script on changes. It watches the /dist folder where the main process bundle lives. This is perfect for development.