Deprecate the Stimulus controllers shipped by the bundle - #456
Open
Spomky wants to merge 1 commit into
Open
Conversation
Spomky
force-pushed
the
feature/deprecate-stimulus-controllers
branch
3 times, most recently
from
August 16, 2026 20:42
a5f64a3 to
1c56793
Compare
The 27 controllers are leaving in 2.0.0. Wrapping a browser API in a generic, configurable Stimulus controller turns out to be a lot of abstraction for very little reuse: every project wants its own behaviour, its own UI and its own error handling. Several of them also push real-time, client-side interactions through the server and back, a round trip nobody really asks for. The full rationale is in #372. The notice sits in the AbstractController constructor rather than in connect(): fifteen controllers override connect() without calling super, so the warning would never fire for them, whereas a derived class has no choice but to call super() in a constructor. NetworkInformationController extends Stimulus' Controller directly and carries the notice itself. Reported once per controller identifier: a page mounting the same controller on twenty elements should not print the same line twenty times. The two page-side helpers exported by the package, onPeriodicSync() and registerPeriodicSync(), warn as well. Their service worker counterpart is deprecated in the same release.
Spomky
force-pushed
the
feature/deprecate-stimulus-controllers
branch
from
August 17, 2026 06:47
1c56793 to
113e0bc
Compare
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.
Second step of the scope reduction announced in #372, independent from #455 which covers the service worker helpers. Nothing is removed here: the 27 controllers keep working exactly as before, they just say out loud that they are going away in 2.0.0.
Where the notice sits
In the
AbstractControllerconstructor, not inconnect().Fifteen of the twenty-seven controllers override
connect()without callingsuper.connect(), so a base-class hook there would silently never fire for them. No controller defines a constructor, and a derived class has no choice but to callsuper(), so the constructor is the only airtight seam.NetworkInformationControlleris the one controller extending Stimulus'Controllerdirectly rather thanAbstractController, so it carries the notice itself.The warning is reported once per controller identifier: a page mounting the same controller on twenty elements should not print the same line twenty times.
Page-side helpers
onPeriodicSync()andregisterPeriodicSync(), exported through the@spomky-labs/pwa/helpersimportmap entry, warn too. Their service worker counterpart (registerPeriodicSyncTask,notifyPeriodicSyncClients) is deprecated in #455, so both halves of that protocol leave together.Package metadata
The npm README gets a deprecation banner and the package description is prefixed. The registry-level
npm deprecate @spomky-labs/pwa-bundle@"*"is a separate manual step, worth doing since only1.4.0-alpha1was ever published.What users should do
Copy the controllers you use into your own application and register them there. They are plain Stimulus controllers with no dependency on the bundle, so nothing is lost in the move, and you get to drop the parts you never needed.
Checks
connect()without calling super still warns; the same identifier twice produces a single warning; the standalone controller and the helper both warn. 6 instantiations, 4 unique warnings.node --checkon every modified file,package.jsonstill parses