Skip to content

Commit

Permalink
chore: release v0.16.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Dec 17, 2024
1 parent 8ef9207 commit 3e9470b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.16.0-beta.3

Change hook order.

## 0.16.0-beta.2

- Add Brotli size.
Expand Down
10 changes: 4 additions & 6 deletions examples/integrate/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ declare global {
function render() {
window.CUSTOM_SIDE_BAR = true
window.addEventListener('client:ready', () => {
setTimeout(() => {
const evt = new CustomEvent('send:ui', { detail: { Component: SideBar, type: 'SideBar' } })
window.dispatchEvent(evt)
const evt2 = new CustomEvent('send:ui', { detail: { Component: Main, type: 'Main' } })
window.dispatchEvent(evt2)
}, 300)
const evt = new CustomEvent('send:ui', { detail: { Component: SideBar, type: 'SideBar' } })
window.dispatchEvent(evt)
const evt2 = new CustomEvent('send:ui', { detail: { Component: Main, type: 'Main' } })
window.dispatchEvent(evt2)
})
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-bundle-analyzer",
"version": "0.16.0-beta.2",
"version": "0.16.0-beta.3",
"description": "a modern vite bundle analyzer tool",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
5 changes: 3 additions & 2 deletions src/client/receiver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export function Receiver() {
const updateUI = useUpdateUI()
const updateAnalyzeModule = useUpdateAnalyzeModule()
useEffect(() => {
const evt = createMagicEvent('client:ready', {})
window.dispatchEvent(evt)
const handler = (evt: CustomEvent<SendUIMessage>) => {
if (evt.detail.Component) {
updateUI(evt.detail.type, evt.detail.Component)
Expand All @@ -25,6 +23,9 @@ export function Receiver() {
window.addEventListener('send:ui', handler)
// @ts-expect-error custom-event
window.addEventListener('send:filter', filterHandler)

const evt = createMagicEvent('client:ready', {})
window.dispatchEvent(evt)
return () => {
// @ts-expect-error custom-event
window.removeEventListener('send:ui', handler)
Expand Down

0 comments on commit 3e9470b

Please sign in to comment.