-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Sharable URLs.ts
29 lines (25 loc) · 1.09 KB
/
Sharable URLs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//// { "order": 1 }
// With the new Playground, URLs contain a lot more
// information about your settings. This makes reproductions
// accurate, and you don't have to tell someone to hit a
// particular compiler flag to replicate your setup.
// The URL contains:
//
// - Whether you are on an example
// - The gzipped source code for your TypeScript/JavaScript
// - Backwards compatibility for older non-gzipped URLs
// - Which language you are working in
// - The diff of your compiler settings from the defaults
// example:new-compiler-defaults
// - Your text selection if you have some code highlighted
//
// The URL is updated live when any of the above changes
// using HTML5's replaceState, so your back button will
// still work as expected.
// When loading an example, you'll see an occasional e=[number]
// which is used to ensure the browser correctly reloads when
// you jump between examples. It's harmless.
// You can see the URL change on this page by editing some
// of the comments, or start selecting some text. Pressing
// reload on your browser will take you back to the same
// state.