Closed shofetim closed 4 years ago
Hi @shofetim .. I'm sorry ā I don't understand how this issue has escaped my attention, but I'll look closer at it now.
The reason wright does that is to avoid chrome cleaning out variable references between code injections. This ensures that if you're making changes back and forth HMR will still work.
I see I had a fix for this in the next
branch already so I just applied that to master ;)
Hello @porsager
I recently picked up several projects that I know used to work with Wright, but now don't. I am still trying to track down whether it was Wright, or Chrome, or Mithril.js that changed and caused things to stop working, but I have found that turning jailing off gets things working again.
Looking at jailing, I don't understand what is going on here: https://github.com/porsager/wright/blob/81a2e193cda8408b1c527076ea98b93a1b9ab71d/lib/jail.js#L7
How does appending an empty
eval("")
change the context(?) of the variables created?Here is my test case that works with
--jail false
but not without:index.html
app.js