ardatan / ardatan/meteor-webpack

WebApp.addHtmlAttributeHook hooks are not cleared on HMR updates

Open
#92 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
123
Forks
28
PR merge metrics
No merged PRs in 30d

Description

When calling a `WebApp.addHtmlAttributeHook`, previous hooks are not cleared upon HMR updates.

It's worth noting that this doesn't seem to any negative impact on my app.

Test done locally:

```
// ...

const randomNumber = Math.random()

WebApp.addHtmlAttributeHook(req => {
console.log(randomNumber)

return null
})
```

Here is what the console returns after 2 updates on each request:

```
0.6168036561182655
0.06950770055811595
0.5245338011658636
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with WebApp.addHtmlAttributeHook and two HMR updates, checking the logged random values on a request. Then trace the hook registration and HMR update entry points; done means prior hooks no longer run after an update, while the current hook still runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.