-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Return result of wrapped function from context #144
Return result of wrapped function from context #144
Conversation
Return result of wrapped function from context
Looks sensible to me! Thanks. 👍 |
No problem! Any idea when the next release'll be? Seems like it's been a while. |
It has been a while. We are planning to get together this weekend and figure out the tooling and whatnot for this. I built some stuff that made things more difficult to do releases, so it has been a pain point. We're gonna switch to grunt and whatnot this weekend and get things into some standard tools. Also, finishing ravenjs.com as well for downloading custom built versions from our new CDN. :) |
Cool. Thanks for all the hard work (: |
- fix(rrweb): Use unpatched requestAnimationFrame when possible [#150](getsentry/rrweb#150) - ref: Avoid async in canvas (#143) - feat: Bundle canvas worker manually (#144) - build: Build for ES2020 (#142)
- fix(rrweb): Use unpatched requestAnimationFrame when possible [#150](getsentry/rrweb#150) - ref: Avoid async in canvas (#143) - feat: Bundle canvas worker manually (#144) - build: Build for ES2020 (#142)
This bump contains the following changes: - fix(rrweb): Use unpatched requestAnimationFrame when possible [#150](getsentry/rrweb#150) - ref: Avoid async in canvas [#143](getsentry/rrweb#143) - feat: Bundle canvas worker manually [#144](getsentry/rrweb#144) - build: Build for ES2020 [#142](getsentry/rrweb#142) Extracted out from #9826 Closes #6946
This adds one word ("
return
") and a test (:The idea is that it makes the context method more of a transparent wrapping. This comes in handy with anything where the return value matters—for example, RequireJS:
Without Raven
With Raven
With Raven + This Change
This allows you wrap your entire module with little change (and without having to worry if you missed some errors that were done after the context call). It's even nicer in CoffeeScript thanks to the implicit returns:
Without Raven
With Raven + This Change
Basically, you just need to indent your code an extra level, as opposed with the current behavior where you need to create a variable in the outer context and close over it.
These are small examples to get the point across but obviously it has more of an impact as the amount of code grows.