Skip to content

Commit

Permalink
Increment version number to 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Jan 16, 2024
1 parent bf0e738 commit f40ad8f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Package: withr
Title: Run Code 'With' Temporarily Modified Global State
Version: 2.99.0.9000
Version: 3.0.0
Authors@R:
c(person(given = "Jim",
family = "Hester",
Expand Down
49 changes: 30 additions & 19 deletions NEWS.md
@@ -1,20 +1,6 @@
# withr (development version)
# withr 3.0.0

* `deferred_run()` now reports the number of executed expressions with
a message.

* `deferred_run()` can now be run at any point in a knitr file (#235).

,* `local_tempfile()` now writes `lines` in UTF-8 (#210) and always uses
`\n` for newlines (#216).

* `local_pdf()` and friends now correctly restore to the previously
active device (#138).

* `local_()` now works even if withr isn't attached (#207).

* `local_par()` and `with_par()` now work if you don't set any parameters
(#238).
## Performance of withr

* `defer()` is now a thin wrapper around `base::on.exit()`. This is
possible thanks to two contributions that we made to R 3.5:
Expand All @@ -24,20 +10,45 @@
is needed for manual invokation with `deferred_run()`.

Following this change, `defer()` is now much faster (although still
slower than `on.exit()`). This also increases the compatibility of
`defer()` with `on.exit()` (all handlers are now run in the expected
order even if they are registered with `on.exit()`) and standalone
slower than `on.exit()` which is a primitive function and about as
fast as it gets). This also increases the compatibility of `defer()`
with `on.exit()` (all handlers are now run in the expected order
even if they are registered with `on.exit()`) and standalone
versions of `defer()`.


## Breaking change

* When `source()` is used with a local environment, as opposed to
`globalenv()` (the default), you now need to set
`options(withr.hook_source = TRUE)` to get proper withr support
(running `defer()` or `local_` functions at top-level of a script).
THis support is disabled by default in local environments to avoid a
performance penalty in normal usage of withr features.


## Other features and bugfixes

* `deferred_run()` now reports the number of executed expressions with
a message.

* `deferred_run()` can now be run at any point in a knitr file (#235).

,* `local_tempfile()` now writes `lines` in UTF-8 (#210) and always uses
`\n` for newlines (#216).

* `local_pdf()` and friends now correctly restore to the previously
active device (#138).

* `local_()` now works even if withr isn't attached (#207).

* `local_par()` and `with_par()` now work if you don't set any parameters
(#238).

* `with_language()` now properly resets the translation cache (#213).

* Fixes for Debian packaging.


# withr 2.5.2

Expand Down

0 comments on commit f40ad8f

Please sign in to comment.