feat: npm-tier example with no server JS and no config tag (#261) - #263
Merged
Merged
Conversation
schloerke
force-pushed
the
schloerke/faithful-no-jsdep-example
branch
from
August 31, 2026 14:56
83b244f to
2c77aa6
Compare
schloerke
force-pushed
the
schloerke/faithful-no-jsdep-example
branch
2 times, most recently
from
August 31, 2026 16:42
2b9ca8e to
80d7661
Compare
Collaborator
Author
|
Rebased onto
Verified after the rebase: vitest 280, pytest 161, testthat 270, pyright/tsc clean, and |
schloerke
force-pushed
the
schloerke/faithful-no-jsdep-example
branch
from
August 31, 2026 16:52
80d7661 to
3c5cd84
Compare
schloerke
marked this pull request as draft
September 10, 2026 20:14
schloerke
force-pushed
the
schloerke/faithful-no-jsdep-example
branch
3 times, most recently
from
September 11, 2026 20:18
5f7e949 to
fb489f9
Compare
examples/11-npm-local is Old Faithful (app.py + app.R over one client) at the npm tier with nothing else on the page. Where examples/09-hmr uses `set_react_page(shinyreact_js="client")` — which omits the JS but still emits the `#shinyreact-config` tag — this app's whole page is `page_bare(page_react_dep(...))`, so it has: - no shinyreact.js, hence one React and one hook registry on the page; - no config tag, hence no protocol handshake. The client imports `@posit/shinyreact` from the repo-relative `file:../../pkg-js` placeholder, the same one 09-hmr uses until the first npm publish. The second half is a deletion. The config-tag strict mode — a missing tag, or a tag with no `protocolVersion`, throwing rather than logging — existed only for the npm build, on the reasoning that an independently installed client meeting a tagless page means the server predates the protocol. It also banned the simplest page there is. Nothing opts into it now, so `requireShinyReactConfigTag()`, `isShinyReactConfigTagRequired()`, their flag and their test-only reset are gone, along with the two branches in bookmark.ts. A tag with no `protocolVersion` still logs; a major-version mismatch still throws visibly, in both builds.
schloerke
force-pushed
the
schloerke/faithful-no-jsdep-example
branch
from
September 11, 2026 20:30
fb489f9 to
adce7ff
Compare
schloerke
marked this pull request as ready for review
September 11, 2026 20:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
examples/11-npm-localis the Old Faithful app (app.py+app.Rover one client) at the npm tier with nothing else on the page.#264 gave npm-tier apps
shinyreact_js="client", which omitsshinyreact.jsbut still emits the#shinyreact-configtag. This app needs neither, so its whole page is:shinyreact.js— one React and one hook registry on the pageThe client imports
@posit/shinyreactfrom the repo-relativefile:../../pkg-jsplaceholder, same asexamples/09-hmr, until the first npm publish.The deletion
The config-tag strict mode is gone. It made a missing tag — or a tag with no
protocolVersion— throw rather than log, but only in the npm build, on the reasoning that an independently installed client meeting a tagless page means the server predates the protocol. It also banned the simplest page there is. With nothing opting in,requireShinyReactConfigTag(),isShinyReactConfigTagRequired(), the flag and the test-only reset are removed, along with the two branches inbookmark.tsandexamples/testing/mount.ts's reset call.Unchanged: a major-version mismatch still throws visibly in both builds, and a tag with no
protocolVersionstill logs an error. #264's double-load warning is untouched.Docs corrected where they justified the tag by the old behavior —
page_react()/page_react_html()/set_react_page()/ReactApp()(py + R +page_react.Rd),_dep.py/dep.R,FEATURES.md: the tag is still emitted undershinyreact_js="client", but because it carries the protocol version and any bookmark restore payload, not because the client hard-errors without it.Verification
Plus the app itself, driven in a browser on the Python server: page carries no
shinyreact.jsand no config tag, slider → server → SVG round-trips, no console errors.Note on scope
An earlier revision of this PR shipped
pkg-js/dist-npm/inside the wheel andinst/so an app could install@posit/shinyreactfrom.venv/renv(#261's actual proposal). That worked — portable lockfile, one symlink resolving for both languages — but it is not in this PR; the example uses the repo-relative placeholder instead, and #261 keeps the question. The evidence is recorded in a comment there.