Commit Graph

6191 Commits

Author SHA1 Message Date
Carson
f54d37dad0 Merge main and rebuild compiled JS 2026-04-28 18:27:37 -05:00
Carson
f469517e03 Remove InputBinding.dispose() — dead code, never called or documented
Rather than wiring up the never-called dispose(), remove it entirely.
The method was defined but never invoked for 6+ years, is not documented
in the custom input bindings article, and unsubscribe() already serves
as the teardown hook.
2026-04-28 18:20:01 -05:00
Carson Sievert
719f3c8b3b fix: restore pre-#3682 visibility semantics (#4376) 2026-04-28 16:07:15 -05:00
Carson
e51b911dca fix: Call InputBinding.dispose() during unbinding (#2875)
InputBinding.dispose() was defined but never called. Now invoked
after unsubscribe and the shiny:unbound event in unbindInputs().
Also fixes the comment that incorrectly said "output" instead of "input".
2026-04-28 11:49:03 -05:00
Carson Sievert
e07298a728 Replace jQuery event-driven output info with per-output ResizeObserver/IntersectionObserver (#3682)
* Use ResizeObserver/IntersectionObserver for per-output resize handling

Replace the old window-resize + Bootstrap event listener approach with
per-output ResizeObserver, IntersectionObserver, and MutationObserver.
Each bound output now gets its own observers that handle resize,
visibility, and theme changes independently, rather than relying on
global window resize events and jQuery Bootstrap hooks.

Also renames sendImageSize -> sendOutputInfo, simplifies bind.ts by
removing sendOutputHiddenState/maybeAddThemeObserver from BindInputsCtx,
and makes ImageOutputBinding.resize() actually set width/height on the
img element.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix observer cleanup, zoom-aware sizing, and edge cases in resize handling

- Disconnect ResizeObserver/IntersectionObserver/MutationObserver on unbind
  to prevent callbacks firing on stale elements
- Restore getBoundingClientSizeBeforeZoom for size reporting to fix CSS zoom
  regression (see #4135)
- Guard doTriggerResize against missing binding during teardown races
- Fix visibleOutputs set to properly remove hidden outputs
- Hoist observer setup out of doSendOutputInfo loop to avoid re-allocating
  closures on every call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix pending output observer callbacks after unbind

* Flush pending output info before input send

* test and restore theme refresh for output observers

* fix: avoid theme mutation observers for non-theme outputs

* Replace custom isHidden() with native el.checkVisibility()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Simplify observer setup: inline outputInfoObserver, consolidate cleanup, guard null IDs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert image resize width/height attr setting

The resize() method only needs to trigger the jQuery resize event for
brush re-projection. Setting width/height attrs on the <img> just
briefly stretched the stale plot before the server re-render replaced
it, with no meaningful effect on behavior.

* Restore image resize() to match main exactly

The previous commit over-scoped the revert by changing the method
signature. This restores the original signature from main.

* Remove review doc

* Skip doTriggerResize() during initial output info send

* Add isVisible() fallback for browsers without checkVisibility()

* `npm run build` (GitHub Actions)

* Update NEWS.md

* Remove unnecessary type cast in debounce cancel test

The debounce() function already returns DebouncedFunction with a
required `cancel` property. The cast to an optional `cancel` weakened
type checking.

* Defer sendOutputInfoFns.regular lookup to execution time

Wrap setTimeout callbacks with arrow functions so regular is resolved
at call time rather than captured when it may still be undefined.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
2026-04-28 09:41:16 -05:00
Carson Sievert
75a63716e5 Increment version number to 1.13.0.9000 (#4361)
* Increment version number to 1.13.0.9000

* `npm run build` (GitHub Actions)

* Sync package version (GitHub Actions)

---------

Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
2026-02-24 16:39:52 -06:00
Carson Sievert
b240b0b868 v1.13.0 release candidate (#4360)
* Increment version number to 1.13.0

* Fix broken URL in NEWS

* Reorder NEWS bullets

* `npm run build` (GitHub Actions)

* Sync package version (GitHub Actions)

---------

Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
v1.13.0
2026-02-24 14:58:46 -06:00
Garrick Aden-Buie
3c18aca49b fix: add stack trace fences to hide internal render pipeline frames (#4358)
* test: add failing tests for render* stack trace fence coverage

Add tests for renderPlot, renderPrint, renderText, renderUI,
renderTable, and renderImage verifying that internal rendering
pipeline frames are hidden by stack trace fences.

All 6 tests fail, revealing that:
- All render functions leak `renderFunc` through the fences
- renderPlot additionally leaks `drawPlot`, `drawReactive`
- renderPrint additionally leaks `with_promise_domain`

Relates to #4357

* refactor: move stack trace test helpers to helper-stacks.R

Move extractStackTrace, cleanLocs, dumpTests, and
captureFilteredRenderTrace into helper-stacks.R so they are
available to all test files. Rename causeRenderError to
captureFilteredRenderTrace.

* fix: add stack trace fences to hide internal render pipeline frames

Add ..stacktraceoff../..stacktraceon.. fence pairs so that internal
rendering pipeline frames (renderFunc, hybrid_chain, drawPlot, etc.)
are hidden from filtered stack traces in the debugger.

- markRenderFunction: wrap renderFunc() call with ..stacktraceoff..
- createRenderFunction: wrap func() with ..stacktraceon.. to restore
  visibility for user code
- renderPrint: wrap func() with ..stacktraceon.. inside promise domain

For renderPlot, the existing ..stacktraceon from installExprFunction
is sufficient once the outer ..stacktraceoff.. is in place.

Fixes #4357

* fix: Legacy datatable stack traces

* chore: Add news bullet

* chore: Just normalize path in the place that needs it

* chore: don't normalize file path

* fix: Handle srcfilealias in stack traces and telemetry

Following commit 272dda27e, which normalized paths only in the #line
directive, sourceUTF8() now creates srcfilealias objects for user code.
This broke code that assumed only package code had srcfile$original.

## How the new approach works

When sourceUTF8() wraps code with a #line directive:

```r
file <- 'app.R'  # Keep original path (relative/symlink/as-typed)
lines <- c(
  '..stacktraceon..({',
  sprintf('#line 1 "%s"', normalizePath(file, ...)),  # Normalize HERE
  readLines(file),
  '})'
)
src <- srcfilecopy(file, lines, isFile = TRUE)  # Uses original path
expr <- parse(text = lines, srcfile = src)
```

The parser sees the #line path differs from srcfilecopy's path, so it
creates a srcfilealias with:
- srcfile$filename = absolute path (from #line, for source refs)
- srcfile$original$filename = original path (from srcfilecopy)

This gives us both: accurate source references + user-friendly paths.

## Changes made

1. Add getSrcfileFilename() helper
   - Prefers $original$filename (user-typed path) when available
   - Falls back to $filename (absolute) for old-style srcfile objects
   - Ensures stack traces show "app.R#10" not "/abs/path/app.R#10"

2. Add isPackageFile() helper
   - Checks if absolute path is under .libPaths()
   - More reliable than checking for $original presence

3. Fix getCallCategories()
   - Now uses isPackageFile() instead of checking $original
   - User code properly categorized as "user" (bold blue in traces)
   - Package code properly categorized as "pkg" (de-emphasized)

4. Update getLocs() and otel_srcref_attributes()
   - Use getSrcfileFilename() to show user-friendly paths

## Benefits

- Stack traces preserve relative paths and symlinks as users typed them
- User vs package code still correctly distinguished
- Better IDE integration (paths match what user entered)
- Telemetry contains meaningful file paths

* fix: Avoid using startsWith()

* fix: Use reverse clamped cumsum for stack trace fence filtering

Replace the forward cumulative sum in stripStackTraces() with a reverse
clamped cumulative sum so that an unmatched `..stacktraceoff..` (one
with no corresponding inner `..stacktraceon..`) is a no-op. This fixes
a regression where markRenderFunction-only callers (e.g. htmlwidgets)
had their user frames hidden when called outside a reactive domain.

The new algorithm concatenates all trace segments into a single vector,
performs vectorized fence scoring, and computes visibility via the
identity: clamped_cumsum = cumsum - pmin(0, cummin(cumsum)).

Fixes #4357

* refactor: Extract skip_if_shiny_otel_tracer_is_enabled() helper

* fix: Handle srcfilealias in reactive auto-labeling

The normalizePath() in sourceUTF8() causes R to create srcfilealias
objects whose $lines is NULL, breaking rassignSrcrefToLabel() and
rexprSrcrefToLabel(). Add getSrcfileLines() helper (alongside
getSrcfileFilename()) to resolve lines from the original srcfilecopy
using srcref[7] for the correct line number.

* fix: Enforce path-boundary check in isPackageFile()

The prefix-only matching in isPackageFile() could misclassify paths
like "/usr/lib/Rcpp/..." as inside "/usr/lib/R". Normalize library
paths with a trailing slash before comparison to ensure proper
path-boundary matching.

* fix: Prefer original filename only for non-package srcfilealias

When a package is installed with keep.source.pkgs = TRUE, the
srcfilecopy original filename may point to a collated build-time path.
For package files (under .libPaths()), keep srcfile$filename to avoid
regressing stack traces and telemetry with install-time paths.

* Update R/conditions.R

---------

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
2026-02-18 17:01:33 -06:00
Garrick Aden-Buie
9b78be1106 feat: Maybe annotate source for Ark (#4352)
* feat: Maybe annotate source for Ark

* fix: Use pre-parse approach to inject `..stacktraceon..`

* chore: Address code review feedback

* chore: Add news bullet

---------

Co-authored-by: Lionel Henry <lionel.hry@proton.me>
2026-02-17 12:22:07 -05:00
E Nelson
3a130b2015 fix: Update to increase whitespace (#4356)
* Update to increase whitespace

* Update scss again
2026-02-14 09:28:33 -06:00
Carson Sievert
27ddc696dc chore: avoid testing elapsed time on CRAN (#4351)
* chore: avoid testing elapsed time on CRAN

* chore: update tabPanel snapshot for disabled attribute on empty tabs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 18:34:39 -06:00
E Nelson
4d787c767c Update to remove whitespace and add padding when necessary (#4350)
* Update to remove whitespace and add padding when necessary

* Cleanup

* `npm run build` (GitHub Actions)

* Consolidate rules

* Updated action button

* `npm run build` (GitHub Actions)

---------

Co-authored-by: elnelson575 <elnelson575@users.noreply.github.com>
2026-02-06 09:49:06 -06:00
Garrick Aden-Buie
e161f2e4a8 fix: Provide context around SHINY_PORT triggering Shiny Server warning (#4345)
* fix: Provide context around SHINY_PORT triggering Shiny Server warning

* `npm run build` (GitHub Actions)

* chore: Add comma

Co-authored-by: Barret Schloerke <barret@posit.co>

---------

Co-authored-by: gadenbuie <gadenbuie@users.noreply.github.com>
Co-authored-by: Barret Schloerke <barret@posit.co>
2026-01-12 11:23:25 -05:00
Copilot
ca259ab0f1 ci: Rebuild npm assets and skip tests for unavailable Suggests packages (#4344)
Co-authored-by: schloerke <93231+schloerke@users.noreply.github.com>
2026-01-12 10:37:48 -05:00
Aditya bansal
9e9a3bf80b R 4.2 / Cairo testing changes reverted (#4342) 2026-01-12 09:21:54 -05:00
Karan
07af5f91c8 chore(license): Change license from GPL-3 to MIT (#4339)
* Change license from GPL-3 to MIT

Updated the project license from GPL-3 to MIT in DESCRIPTION, LICENSE, LICENSE.md, README.md, and package.json. Added LICENSE.md with the MIT license text and updated .Rbuildignore to exclude LICENSE.md from builds.

* `npm run build` (GitHub Actions)

* Update LICENSE and add LICENSE.note

Replaced the LICENSE file content with a summary including year and copyright holder. Moved detailed third-party license information to a new LICENSE.note file.

* Remove R check log file

Deleted the ..Rcheck/00check.log file, likely to clean up generated or temporary files from the repository.
2025-12-16 17:51:22 -06:00
Barret Schloerke
fda6a9fede chore(assets): Update asset versions (#4337) 2025-12-11 11:56:42 -05:00
Barret Schloerke
d2245a2e34 Increment version number to 1.12.1.9000 2025-12-09 16:29:27 -05:00
Barret Schloerke
a12a8130b8 v1.12.1 (#4329) v1.12.1 2025-12-09 16:26:52 -05:00
Barret Schloerke
b436d2a96d Clarify OTel collection level usage in docs (#4335)
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
2025-12-08 15:31:57 -05:00
Barret Schloerke
05b0f270c4 fix(otel): ExtendedTask's otel enabled status set during init (#4334) 2025-12-08 14:55:59 -05:00
Barret Schloerke
f24f71e4e0 feat(otel): Add withOtelCollect() and localOtelCollect() (#4333) 2025-12-08 14:30:40 -05:00
Barret Schloerke
63a00f775f fix(otel): Duplicate otel code attribute keys using both deprecated and preferred names (#4325) 2025-12-03 16:37:20 -05:00
Barret Schloerke
5a946caf35 Skip timer tests on CRAN and fix empty vector comparison (#4327) 2025-12-03 16:29:17 -05:00
Barret Schloerke
16c016a171 Increment version number to 1.12.0.9000 2025-12-03 15:50:36 -05:00
Barret Schloerke
284af65534 Update .Rbuildignore 2025-12-03 15:50:27 -05:00
Barret Schloerke
b5da7868fa v1.12.0 (#4312) v1.12.0 2025-12-03 15:48:49 -05:00
ismirsehregal
c8a41aa834 Update dateYMD (#4318)
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
2025-12-01 10:25:28 -05:00
Copilot
390f6d3b95 chore(otel): Rename shiny.otel.bind to shiny.otel.collect (#4321)
Co-authored-by: Barret Schloerke <barret@posit.co>
2025-11-25 16:36:56 -05:00
Barret Schloerke
9a2140cd19 chore(test): Fix stacks test with R 4.5.2 (#4322) 2025-11-25 16:31:53 -05:00
Barret Schloerke
e3cf4fb089 refactor(otel): Cache tracer and logger on init and on demand (#4315)
Co-authored-by: Charlie Gao <53399081+shikokuchuo@users.noreply.github.com>
2025-11-11 08:44:57 -05:00
Barret Schloerke
472a1cdba1 refactor(otel): Refactor internal method names (#4313) 2025-11-06 11:20:37 -05:00
Barret Schloerke
b56c275364 feat(otel): Enhanced OpenTelemetry support (#4300) 2025-10-28 14:01:50 -04:00
Garrick Aden-Buie
592e825a0f feat: Replace client-side markdown rendering with server-side in showcase mode (#4306)
* feat: Replace client-side markdown rendering with server-side in showcase mode

* `devtools::document()` (GitHub Actions)

* chore: callout rendering differences may happen
2025-10-22 09:34:20 -04:00
Barret Schloerke
50a140c580 ci(test): Disable installation of Cairo for unit tests (#4301) 2025-10-15 16:24:22 -04:00
Barret Schloerke
48d255a235 feat: Add {otel} support (#4269) 2025-10-14 15:40:36 -04:00
Barret Schloerke
a01fcc5194 chore(check): Fix minor check warnings (#4299) 2025-10-10 16:30:47 -04:00
Winston Chang
b6e9e9d216 Update package.json for publishing (#4284)
* Update package.json for publishing

* Use custom readme file for npm

* Update repository URLs

* Script cleanup

* Use name @posit/shiny
2025-09-09 16:37:06 -05:00
Barret Schloerke
5ddb99a5b4 update docs (#4285) 2025-09-05 13:52:30 -04:00
Carson Sievert
f981ed6363 feat: add shinyRemoveButton selectize.js option (for py-shiny) (#4276)
* fix: supply and retain default selectize.js plugins (for py-shiny)

* `npm run build` (GitHub Actions)

* Move more in a 'remove_button' attribute direction

* `npm run build` (GitHub Actions)

* Move to a JSON-only approach

* `npm run build` (GitHub Actions)

* Drop sticky update logic by always sending 'missing' value and resolving client-side

* Cleanup

* Don't mutate options; better typing pattern

* `npm run build` (GitHub Actions)

---------

Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
2025-08-28 15:49:25 -05:00
Carson Sievert
6d6b0ea6f9 fix: add CSS workaround to hide all but the first selectize remove button (#4275)
* fix: add CSS workaround to hide all but the first selectize remove button

* Update news

* Apply suggestions from code review
2025-08-21 16:48:34 -05:00
Barret Schloerke
0e355ed25c preemptively run revdepcheck. 5 failures. 2025-08-18 09:10:19 -04:00
Barret Schloerke
80a9ff470c fix(scss): Remove updated scss files and restore R sass compilation (#4272)
* Revert changes in 8861645d99 from #4252

We compile from R sass. So we should be partial to R's compiler, no the latest in npm

* Restore original compile script (with message) that built using R-sass, not npm

* Add step in build command to update the sass output

* run new command
2025-08-14 16:03:48 -04:00
Barret Schloerke
ead0abcd62 bug(check): Update .Rbuildignore with new and removed files (#4270) 2025-08-04 23:17:45 -04:00
Barret Schloerke
7dcb54bc7e build(js): Migrate from yarn to npm (#4252) 2025-08-04 16:07:39 -04:00
Colin Gillespie
ae82850e1f docs: Update R supported versions (#4256) 2025-08-04 10:37:48 -04:00
Daniel Chen
0610d756a8 docs: update srcts/readme.md to shiny 1.11.1 (#4259) 2025-08-04 09:50:06 -04:00
Carson Sievert
6325067130 Update DESCRIPTION (#4255)
* Change maintainer to Carson

* Add Garrick

* Add Posit ROR link

* `usethis::use_tidy_description()` (GitHub Actions)

* `devtools::document()` (GitHub Actions)

---------

Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
2025-07-22 13:19:24 -05:00
Carson Sievert
1a4e52dc73 Run routine (#4257)
* Touch news

* `usethis::use_tidy_description()` (GitHub Actions)

* Revert "Touch news"

This reverts commit 854e7e10ae.

* `usethis::use_tidy_description()` (GitHub Actions)

---------

Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
2025-07-22 12:38:23 -05:00
Winston Chang
08383ad8b9 Update srcts/README with info about window.Shiny (#4198) 2025-07-18 17:22:52 -05:00