UNPKG

13.1 kBMarkdownView Raw
1# microsite
2
3## 0.7.6
4
5### Patch Changes
6
7- 837da9c: Fix issue with `<pre> <code>` dedent
8
9## 0.7.5
10
11### Patch Changes
12
13- cb4da30: Fix dedent within <pre> tags
14
15## 0.7.4
16
17### Patch Changes
18
19- 5eb1b20: Fix issue where shared styles of non-hydrated components would not be included in the output
20
21## 0.7.3
22
23### Patch Changes
24
25- 2535fe9: Fix bug where global script would have extra code injected
26
27## 0.7.2
28
29### Patch Changes
30
31- c71d8da: Whoops, actually fix that bundling bug
32
33## 0.7.1
34
35### Patch Changes
36
37- bf8cfa0: Fix bundling bug
38
39## 0.7.0
40
41### Minor Changes
42
43- 65bf0bd: Implements a caching strategy for `getStaticProps` and `getStaticPaths`, which can often become a build bottleneck due to network or filesystem reads.
44
45 This change introduces a new `prefetch` method for both of these functions. [Read the docs](/docs/data-fetching) for more details.
46
47### Patch Changes
48
49- 4475a3c: Update prefetch logic to accomodate changing headers
50- f3b313b: Update to esbuild@0.8.x
51
52## 0.7.0-next.2
53
54### Patch Changes
55
56- 4475a3c: Update prefetch logic to accomodate changing headers
57
58## 0.7.0-next.1
59
60### Patch Changes
61
62- f3b313b: Update to esbuild@0.8.x
63
64## 0.7.0-next.0
65
66### Minor Changes
67
68- 65bf0bd: Implements a caching strategy for `getStaticProps` and `getStaticPaths`, which can often become a build bottleneck due to network or filesystem reads.
69
70 This change introduces a new `prefetch` method for both of these functions. [Read the docs](/docs/data-fetching) for more details.
71
72## 0.6.14
73
74### Patch Changes
75
76- e18c71c: Fix Linux shebang issue (#40) by removing need for --experimental-module-resolution=node. Uses .js import specifiers everywhere
77
78## 0.6.13
79
80### Patch Changes
81
82- 86bdb17: Fix bug where &lt;pre> code was improperly indented
83
84## 0.6.12
85
86### Patch Changes
87
88- 9d22932: Update to typescript@4.1.2
89- 217299b: Update Document viewport meta tag, html lang and dir
90
91## 0.6.12-next.0
92
93### Patch Changes
94
95- 9d22932: Update to typescript@4.1.2
96- 217299b: Update Document viewport meta tag, html lang and dir
97
98## 0.6.11
99
100### Minor Changes
101
102- fd4c454: Add [HTTP Caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching) to `fetch` via [`make-fetch-happen`](https://github.com/zkat/make-fetch-happen/). Thanks [@zkat](https://github.com/zkat)!
103
104## 0.6.10
105
106### Patch Changes
107
108- 8a7374f: Add preload hints for hydrated pages
109- 6d0f3a3: Microsite's partial hydration method manages each component as a seperate Preact tree, meaning standard `Context` won't work across components.
110
111 This update adds a `microsite/global` entry point which exposes two utilities for sharing state across component trees.
112
113 **`createGlobalState`** creates a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) which acts as a mutable data source. Mutating this object notifies any consuming components that they should rerender.
114
115 > If you're a fan of Vue, this is very similar to `reactive` from the Composition API.
116
117 Components can consume this global state object via **`useGlobalState(state)`**.
118
119 ```tsx
120 // utils/state.tsx
121 import { createGlobalState } from "microsite/global";
122
123 export const state = createGlobalState({
124 count: 0
125 });
126
127 // components/Counter.tsx
128 import { withHydrate } from "microsite/hydrate";
129 import { useGlobalState } from "microsite/global";
130 import { state } from "@/utils/state";
131
132 const Counter = () => {
133 const localState = useGlobalState(state);
134 // `localState` is a readonly snapshot of global `state`
135 // Updates can be written to global `state` by direct mutation
136
137 return (
138 <>
139 <button onClick={() => state.count--}>-</button>
140 <span>{localState.count}</span>
141 <button onClick={() => state.count++}>+</button>
142 </>
143 );
144 };
145
146 export default withHydrate(Counter);
147 ```
148
149- 6d0f3a3: Fix issue with CSS scoped name generation
150
151## 0.6.9
152
153### Patch Changes
154
155- 788860d: Add --no-clean flag to persist intermediate build (useful for debugging)
156- 64add28: Fixes issue with named hydration chunks
157- 10f9fd5: Improve caching by using external styles rather than inlined styles
158- 0641e72: Update microsite bin to use correct arguments
159
160## 0.6.9-next.0
161
162### Patch Changes
163
164- Add --no-clean flag to persist intermediate build (useful for debugging)
165
166## 0.6.6
167
168### Patch Changes
169
170- 7e955a0: Ensure children is not required for Head component
171
172## 0.6.5
173
174### Patch Changes
175
176- f65c7f4: Improve types by adding global `h` and `Fragment`, and ambient `*.modules.css` declarations
177
178## 0.6.4
179
180### Patch Changes
181
182- e53864f: Update default `tsconfig` to be named `base`.
183
184 Update `tsconfig.baseUrl` to resolve from inside `node_modules`
185
186## 0.6.3
187
188### Patch Changes
189
190- a760228: Automatically inject h and Fragment
191- 580bb4f: expose default tsconfig.json for end-users
192
193## 0.6.2
194
195### Patch Changes
196
197- 60de6a2: Fix esbuild jsxFactory
198
199## 0.6.1
200
201### Patch Changes
202
203- a3a5131: Fix external warning
204- 5c79ec3: update README
205
206## 0.6.0
207
208### Breaking Changes
209
210- 9d0e9cc: Drop `@types/react` and switch to `preact`. See issue [#5](https://github.com/natemoo-re/microsite/issues/5) for more background.
211
212## 0.0.0-canary-2020101419274
213
214### Breaking Changes
215
216- 7fd4679: Drop `@types/react` and switch to `preact`. See issue [#5](https://github.com/natemoo-re/microsite/issues/5) for more background.
217
218## 0.5.1
219
220### Patch Changes
221
222- 3d99331: Fix handling of node builtins for intermediate builds
223- 3d99331: Remove .microsite/cache dir for now
224
225## 0.5.1-next.0
226
227### Patch Changes
228
229- a29b71e: Fix handling of node builtins for intermediate builds
230- 078b910: Remove .microsite/cache dir for now
231
232## 0.5.0
233
234### Minor Changes
235
236- 47eec22: **Build performance improvements**
237
238 Rather than relying on [`@rollup/plugin-typescript`](https://github.com/rollup/plugins/tree/master/packages/typescript) (which uses `typescript` under the hood), we have switched to [`rollup-plugin-esbuild`](https://github.com/egoist/rollup-plugin-esbuild) to perform code transforms.
239
240 [`esbuild`](https://github.com/evanw/esbuild) is very very fast. Now, so is Microsite.
241
242### Patch Changes
243
244- 275f297: Gracefully handle Component/export name mismatch
245
246 Automatically handle `tsconfig.paths` aliases
247
248- 945685d: **SEO**
249
250 Microsite aims to make SEO as simple as possible, so this featureset adds built-in SEO utility components to `microsite/head` under the `seo` namespace.
251
252 The benefit of using `seo` components over manual `meta` tag configuration is API simplicity, since `seo` automatically configures duplicate [Open Graph](https://ogp.me/)/social meta tags for you.
253
254 If something here doesn't cover your use case, please feel free to [open an issue](https://github.com/natemoo-re/microsite/issues/new).
255
256 ```tsx
257 import { Head, seo } from "microsite/head";
258
259 <Head>
260 <seo.title>Easy SEO</seo.title>
261 <seo.description>Hello world!</seo.description>
262 <seo.image
263 src="https://og-image.now.sh/**Hello**%20World.png?theme=light&md=1&fontSize=100px&images=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Ffront%2Fassets%2Fdesign%2Fvercel-triangle-black.svg"
264 width={100}
265 height={100}
266 />
267 <seo.twitter handle="@n_moore" />
268 </Head>;
269 ```
270
271 #### seo.robots
272
273 By default, `<Head>` now automatically adds the following tags.
274
275 ```html
276 <meta name="robots" content="index,follow" />
277 <meta name="googlebot" content="index,follow" />
278 ```
279
280 This behavior can be controlled with the `<seo.robots>` helper, which accepts `noindex` and `nofollow` booleans.
281
282 ```tsx
283 <seo.robots noindex nofollow />
284 ```
285
286 #### seo.title
287
288 `<seo.title>` has the same API as a regular `<title>` tag—it accepts a `string` child. `<seo.title>` sets the page `<title>` as well as `<meta property="og:title">`.
289
290 #### seo.description
291
292 `<seo.description>` accepts a `string` child. `<seo.description>` sets `<meta name="description">` as well as `<meta property="og:description">`.
293
294 #### seo.canonical
295
296 `<seo.canonical>` accepts a `string` child representing the canonical URL of the current page. It generates `<link rel="canonical">` and `<meta property="og:url">`.
297
298 #### seo.image
299
300 `<seo.image>` exposes an API similar to the native `<img>`, accepting `src`, `alt`, `width`, and `height` props. It generates all the meta tags necessary for valid Open Graph images.
301
302 #### seo.video
303
304 `<seo.video>` exposes an API similar to the native `<video>`, accepting `src`, `width`, and `height` props. It generates all the meta tags necessary for valid Open Graph videos.
305
306 #### seo.audio
307
308 `<seo.audio>` exposes an API similar to the native `<audio>`, accepting only a `src` prop. It generates all the meta tags necessary for valid Open Graph audio.
309
310 #### seo.twitter
311
312 `<seo.twitter>` controls [Twitter meta tags](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup). It accepts `card`, `handle` (maps to `twitter:creator`), and `site`.
313
314 #### seo.facebook
315
316 `<seo.facebook>` accepts an `appId` in order to set `<meta property="fb:app_id">`.
317
318 #### seo.openGraph
319
320 `<seo.openGraph>` provides low-level control over [Open Graph meta tags](https://ogp.me/). The accepted props vary based on `type`, so you might want to dig [into the code](https://github.com/natemoo-re/microsite/blob/8c0599f8c05da3214534b864c536a2614a89fb7f/src/head.tsx#L14) for this one.
321
322- 17e3130: Fix issue when building projects without optional global/hydrated files
323- da6e0f3: Improve build performance (parallelization)
324- eaec00b: Fixes issue with static path generation for the `/` route
325
326## 0.5.0-alpha.0
327
328### Minor Changes
329
330- 47eec22: **Build performance improvements**
331
332 Rather than relying on [`@rollup/plugin-typescript`](https://github.com/rollup/plugins/tree/master/packages/typescript) (which uses `typescript` under the hood), we have switched to [`rollup-plugin-esbuild`](https://github.com/egoist/rollup-plugin-esbuild) to perform code transforms.
333
334 [`esbuild`](https://github.com/evanw/esbuild) is very very fast. Now, so is Microsite.
335
336### Patch Changes
337
338- 945685d: **SEO**
339
340 Microsite aims to make SEO as simple as possible, so this featureset adds built-in SEO utility components to `microsite/head` under the `seo` namespace.
341
342 The benefit of using `seo` components over manual `meta` tag configuration is API simplicity, since `seo` automatically configures duplicate [Open Graph](https://ogp.me/)/social meta tags for you.
343
344 If something here doesn't cover your use case, please feel free to [open an issue](https://github.com/natemoo-re/microsite/issues/new).
345
346 ```tsx
347 import { Head, seo } from "microsite/head";
348
349 <Head>
350 <seo.title>Easy SEO</seo.title>
351 <seo.description>Hello world!</seo.description>
352 <seo.image
353 src="https://og-image.now.sh/**Hello**%20World.png?theme=light&md=1&fontSize=100px&images=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Ffront%2Fassets%2Fdesign%2Fvercel-triangle-black.svg"
354 width={100}
355 height={100}
356 />
357 <seo.twitter handle="@n_moore" />
358 </Head>;
359 ```
360
361 #### seo.robots
362
363 By default, `<Head>` now automatically adds the following tags.
364
365 ```html
366 <meta name="robots" content="index,follow" />
367 <meta name="googlebot" content="index,follow" />
368 ```
369
370 This behavior can be controlled with the `<seo.robots>` helper, which accepts `noindex` and `nofollow` booleans.
371
372 ```tsx
373 <seo.robots noindex nofollow />
374 ```
375
376 #### seo.title
377
378 `<seo.title>` has the same API as a regular `<title>` tag—it accepts a `string` child. `<seo.title>` sets the page `<title>` as well as `<meta property="og:title">`.
379
380 #### seo.description
381
382 `<seo.description>` accepts a `string` child. `<seo.description>` sets `<meta name="description">` as well as `<meta property="og:description">`.
383
384 #### seo.canonical
385
386 `<seo.canonical>` accepts a `string` child representing the canonical URL of the current page. It generates `<link rel="canonical">` and `<meta property="og:url">`.
387
388 #### seo.image
389
390 `<seo.image>` exposes an API similar to the native `<img>`, accepting `src`, `alt`, `width`, and `height` props. It generates all the meta tags necessary for valid Open Graph images.
391
392 #### seo.video
393
394 `<seo.video>` exposes an API similar to the native `<video>`, accepting `src`, `width`, and `height` props. It generates all the meta tags necessary for valid Open Graph videos.
395
396 #### seo.audio
397
398 `<seo.audio>` exposes an API similar to the native `<audio>`, accepting only a `src` prop. It generates all the meta tags necessary for valid Open Graph audio.
399
400 #### seo.twitter
401
402 `<seo.twitter>` controls [Twitter meta tags](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup). It accepts `card`, `handle` (maps to `twitter:creator`), and `site`.
403
404 #### seo.facebook
405
406 `<seo.facebook>` accepts an `appId` in order to set `<meta property="fb:app_id">`.
407
408 #### seo.openGraph
409
410 `<seo.openGraph>` provides low-level control over [Open Graph meta tags](https://ogp.me/). The accepted props vary based on `type`, so you might want to dig [into the code](https://github.com/natemoo-re/microsite/blob/8c0599f8c05da3214534b864c536a2614a89fb7f/src/head.tsx#L14) for this one.
411
\No newline at end of file