The URI encoding already collapses everything into a single line. Are there still cases where the URI encoding is not enough (other than size limit issues)? If not, then a bookmarklet can be created without using a minifier:
First I created a template tiddler titled “bookmarklet template” like this:
<a href={{{[all[current]get[text]] +[encodeuri[]addprefix[javascript: (() => {]addsuffix[})()]]}}}>{{!!title}}</a>
Then a simple javascript tiddler titled “alert and console log javascript example” with contents like this:
alert("testing")
console.log("testing")
I applied the template to the javascript like this:
{{alert and console log javascript example||bookmarklet template}}
The resulting html looks like this:
<a href="javascript: (() => {alert(%22testing%22)%0Aconsole.log(%22testing%22)})()">alert and console log javascript example</a>
Clicking on that link does display an alert and a console log message. Maybe for more complicated javascript, this approach will fall apart?