Skip to content

Commit 7bead24

Browse files
authored
Stop naming the protoc host in the UI (#6)
Three places named it: the language group, the note beside the language bar and the footer, with the header badge naming it too. None of them needed to. What a user has to know is that this one target leaves the browser, which the wording still says; where it goes is an implementation detail, and printing it on every page is an invitation to point traffic at it directly. The messages shown when the service cannot be reached lose the hostname for the same reason. Source comments keep it, since that audience needs to know.
1 parent 5f42390 commit 7bead24

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎web/index.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040
<option value="vb">VB.NET</option>
4141
</optgroup>
4242
<!-- filled from PROTOC_LANGUAGES, so the picker and the service cannot disagree -->
43-
<optgroup label="protoc — on protoc.protobuf-net.dev" id="opt-language-protoc"></optgroup>
43+
<optgroup label="protoc — compiled on a server" id="opt-language-protoc"></optgroup>
4444
</select>
4545
</label>
4646
<button type="button" class="ghost remote-only" id="run-protoc">Generate</button>
47+
<!-- the host is deliberately not named here or in the footer; what the user needs to
48+
know is that this one leaves the browser, not where it goes -->
4749
<span class="note remote-only">
48-
compiled by <code>protoc</code> on
49-
<a href="https://protoc.protobuf-net.dev" rel="noopener">protoc.protobuf-net.dev</a> —
50-
your schema is sent there when you press Generate
50+
compiled with <code>protoc</code> — your schema is sent to a server when you press
51+
Generate
5152
</span>
5253
<label id="opt-langver-wrap" class="net-only">
5354
Version
@@ -137,8 +138,7 @@
137138
<span id="engine-version">loading engine…</span>
138139
<span>
139140
C#, VB.NET and payload decoding run in your browser via WebAssembly and are never uploaded.
140-
protoc's own languages are compiled on
141-
<a href="https://protoc.protobuf-net.dev" rel="noopener">protoc.protobuf-net.dev</a>.
141+
protoc's own languages are compiled with <code>protoc</code> on a server.
142142
</span>
143143
</footer>
144144

‎web/src/protoc.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function readResponse(status: number, body: string): GenerateResponse {
6969

7070
if (!parsed || !Array.isArray(parsed.files) || !Array.isArray(parsed.errors)) {
7171
const detail = body.trim().slice(0, 200) || '(no detail)';
72-
return { files: [], errors: [], exception: `protoc.protobuf-net.dev replied ${status}: ${detail}` };
72+
return { files: [], errors: [], exception: `the protoc service replied ${status}: ${detail}` };
7373
}
7474
return { files: parsed.files, errors: parsed.errors, ...(parsed.exception ? { exception: parsed.exception } : {}) };
7575
}

‎web/src/schema.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ export function initSchemaView(): void {
154154

155155
// the decoder is local whatever the schema view is set to, so it wins while it is on screen
156156
const remote = protoc !== undefined && location.hash.replace('#', '') !== 'decode';
157-
privacyBadge.textContent = remote ? 'uses protoc.protobuf-net.dev' : 'runs locally';
157+
privacyBadge.textContent = remote ? 'compiled on a server' : 'runs locally';
158158
privacyBadge.setAttribute(
159159
'title',
160160
remote
161-
? 'protoc is a native compiler: pressing Generate sends this schema to protoc.protobuf-net.dev'
161+
? 'protoc is a native compiler and cannot run in the browser: pressing Generate sends this schema to a server'
162162
: 'Nothing you paste leaves your browser',
163163
);
164164
}
@@ -207,7 +207,7 @@ export function initSchemaView(): void {
207207
} catch (error) {
208208
// an abort is this code superseding itself, and has nothing to report
209209
if (controller.signal.aborted || token !== generation) return;
210-
renderMessages(messages, [], `could not reach protoc.protobuf-net.dev: ${String(error)}`);
210+
renderMessages(messages, [], `could not reach the protoc service: ${String(error)}`);
211211
markStale('outdated — press Generate');
212212
} finally {
213213
if (token === generation) {

0 commit comments

Comments
 (0)