1 | # microsite
|
2 |
|
3 | ## 1.1.0
|
4 |
|
5 | ### Minor Changes
|
6 |
|
7 | - 889da9a: Implements fragment-based hydration. This is a **breaking change**—the previous behavior was to wrap any hydrated components in a `div` with `display: contents` but this new behavior has the benefit of not modifying the document flow at all.
|
8 |
|
9 | **Breaking change**: The `interaction` hydration strategy has been removed. In practice it tended to actually _cause_ interaction delays because hydration work would occur in an input-blocking fashion. Use `idle` or `visible`.
|
10 |
|
11 | ### Patch Changes
|
12 |
|
13 | - 53ea544: Fixed a bug when using any --flag with "microsite" CLI
|
14 | - 889da9a: Add support for deployment to a relative subdirectory. To enable this behavior, either set `"homepage": "/subdir"` in `package.json` or pass `--base-path=/subdir` to `microsite build`.
|
15 | - c3e1ec5: Always output hashed files with an 8 character hash
|
16 | - 0c9d426: Include shim for `requestIdleCallback` for Safari
|
17 | - 0c9d426: Fix error with previous shared CSS module logic, adds \_static output directory
|
18 | - 0c9d426: Fix <Head> component bug
|
19 | - 0c9d426: Update hydration method to be compatible with `preact@10.5.11+`. Allows `preact@^10.5.12`.
|
20 | - 0c9d426: Remove prettier from core dependencies
|
21 | - 2468a3a: Dev server now uses `etag` for caching and chunk behavior for `global/index.ts` files has been fixed
|
22 | - 06f439b: Add `--no-open` flag to `microsite dev` and `microsite build --serve`. This flag allows you to skip the default behavior of automatically opening your browser.
|
23 | - 0c9d426: Prefer pinned Skypack URLs to lookup URLs. Improves load waterfall significantly. Fixes #106.
|
24 | - 0c9d426: Adds a `fallback` option to `withHydrate` to allow customization of server-side rendering behavior.
|
25 | - 0c9d426: Pin `preact@10.5.10` and `snowpack@~3.0.11`
|
26 | - 0c9d426: Remove PostCSS logic from core dependencies. Microsite will prompt users to install PostCSS locally if detected.
|
27 | - efdc433: Add support for custom "pages/\_document.tsx" file
|
28 | - 355eb2b: Fixed a bug with custom document rendering
|
29 | - 0c9d426: Fix missed edge case with CSS module assets shared between pages (#126)
|
30 | - 0c9d426: Update snowpack to snowpack@3.0.13
|
31 | - 0c9d426: fix(#119): remove `defer` from inline script`
|
32 |
|
33 | fix(#115): do not include vendor chunk in hydrateBindings
|
34 |
|
35 | - db45d3b: Add support for custom "snowpack.config.cjs" files
|
36 |
|
37 | ## 1.1.0-next.11
|
38 |
|
39 | ### Patch Changes
|
40 |
|
41 | - 6723b24: Adds a `fallback` option to `withHydrate` to allow customization of server-side rendering behavior.
|
42 |
|
43 | ## 1.1.0-next.10
|
44 |
|
45 | ### Patch Changes
|
46 |
|
47 | - 7fcba84: Fix error with previous shared CSS module logic, adds \_static output directory
|
48 |
|
49 | ## 1.1.0-next.9
|
50 |
|
51 | ### Patch Changes
|
52 |
|
53 | - 64ca86e: Fix missed edge case with CSS module assets shared between pages (#126)
|
54 |
|
55 | ## 1.1.0-next.8
|
56 |
|
57 | ### Patch Changes
|
58 |
|
59 | - 3d8b6e0: Prefer pinned Skypack URLs to lookup URLs. Improves load waterfall significantly. Fixes #106.
|
60 | - 81b1f9a: Update snowpack to snowpack@3.0.13
|
61 |
|
62 | ## 1.1.0-next.7
|
63 |
|
64 | ### Patch Changes
|
65 |
|
66 | - fix(#119): remove `defer` from inline script`
|
67 | - fix(#115): do not include vendor chunk in hydrateBindings
|
68 |
|
69 | ## 1.1.0-next.6
|
70 |
|
71 | ### Patch Changes
|
72 |
|
73 | - ddd48ea: Include shim for `requestIdleCallback` for Safari
|
74 | - d486147: Update hydration method to be compatible with `preact@10.5.11+`. Allows `preact@^10.5.12`.
|
75 |
|
76 | ## 1.1.0-next.5
|
77 |
|
78 | ### Patch Changes
|
79 |
|
80 | - Pin `preact@10.5.10` and `snowpack@~3.0.11`
|
81 |
|
82 | ## 1.1.0-next.4
|
83 |
|
84 | ### Patch Changes
|
85 |
|
86 | - 4c63780: Fix <Head> component bug
|
87 | - 669eab2: Remove prettier from core dependencies
|
88 | - 1eb8733: Remove PostCSS logic from core dependencies. Microsite will prompt users to install PostCSS locally if detected.
|
89 |
|
90 | ## 1.1.0-next.3
|
91 |
|
92 | ### Patch Changes
|
93 |
|
94 | - 2468a3a: Dev server now uses `etag` for caching and chunk behavior for `global/index.ts` files has been fixed
|
95 |
|
96 | ## 1.1.0-next.2
|
97 |
|
98 | ### Patch Changes
|
99 |
|
100 | - Fixed a bug with custom document rendering
|
101 |
|
102 | ## 1.1.0-next.1
|
103 |
|
104 | ### Patch Changes
|
105 |
|
106 | - 53ea544: Fixed a bug when using any --flag with "microsite" CLI
|
107 | - c3e1ec5: Always output hashed files with an 8 character hash
|
108 | - 06f439b: Add `--no-open` flag to `microsite dev` and `microsite build --serve`. This flag allows you to skip the default behavior of automatically opening your browser.
|
109 | - efdc433: Add support for custom "pages/\_document.tsx" file
|
110 | - db45d3b: Add support for custom "snowpack.config.cjs" files
|
111 |
|
112 | ## 1.1.0-next.0
|
113 |
|
114 | ### Minor Changes
|
115 |
|
116 | - 889da9a: Implements fragment-based hydration. This is a **breaking change**—the previous behavior was to wrap any hydrated components in a `div` with `display: contents` but this new behavior has the benefit of not modifying the document flow at all.
|
117 |
|
118 | **Breaking change**: The `interaction` hydration strategy has been removed. In practice it tended to actually _cause_ interaction delays because hydration work would occur in an input-blocking fashion. Use `idle` or `visible`.
|
119 |
|
120 | ### Patch Changes
|
121 |
|
122 | - 889da9a: Add support for deployment to a relative subdirectory. To enable this behavior, either set `"homepage": "/subdir"` in `package.json` or pass `--base-path=/subdir` to `microsite build`.
|
123 |
|
124 | ## 1.0.3
|
125 |
|
126 | ### Patch Changes
|
127 |
|
128 | - b94b6a9: Fix handling of js/tsconfig.json without a "paths" option
|
129 |
|
130 | ## 1.0.2
|
131 |
|
132 | ### Patch Changes
|
133 |
|
134 | - 1559789: Fix bug with Snowpack's esinstall and Microsite's global state utility
|
135 | - 9241da7: - Update @prefresh/snowpack to effectively update effects and memoization
|
136 |
|
137 | ## 1.0.1
|
138 |
|
139 | ### Patch Changes
|
140 |
|
141 | - 41f0201: Remove init script if no hydrated components exist
|
142 | - fe2d1d7: Resolve exact version of Preact used in project
|
143 | - 712dc53: Fixes build issue where no esm dependencies would be found
|
144 |
|
145 | ## 1.0.0
|
146 |
|
147 | ### Major Changes
|
148 |
|
149 | - 2ae753d: Microsite has been completely rewritten to focus on what it does best—optimize your static site for partial hydration.
|
150 |
|
151 | Rather than implementing a highly-opinionated, custom build pipeline, Microsite@1.0.0 leverages the power of [Snowpack](https://www.snowpack.dev/)'s upcoming 3.0.0 release. This means that there are a number of new features, notably:
|
152 |
|
153 | - Pages can now be written in your preferred file format—TypeScript or plain old JavaScript.
|
154 | - If your file/asset types are [supported in Snowpack](https://www.snowpack.dev/reference/supported-files), they are supported by Microsite. This is because Microsite has delegated the initial compilation of your site completely to Snowpack!
|
155 | - `microsite dev` spins up a Snowpack development server with best-in-class DX, including built-in HMR with [Prefresh](https://github.com/JoviDeCroock/prefresh/tree/main).
|
156 | - `microsite build --serve` performs a build and serves the result on a local server, for testing production builds.
|
157 |
|
158 | There are a small number of breaking changes in the release:
|
159 |
|
160 | - Microsite now relies on explicit [subpath exports](https://nodejs.org/api/packages.html#packages_subpath_exports), meaning only public files can be accessed from Node.
|
161 | - Global asset entry points have been moved from `src/global.ts` and `src/global.css` to `src/global/index.ts` and `src/global/index.css`.
|
162 | - Global scripts are no longer executed as a side-effect. Global scripts must contain a single `export default async () => {}`, which is executed on page load.
|
163 |
|
164 | ### Patch Changes
|
165 |
|
166 | - 914bf18: Fix cosmicconfig CJS interop issue
|
167 | - 727fc04: Remove cache dir for now
|
168 | - 7681446: Fixed a bug where automatic JSX inject would not always be triggered
|
169 | - d5993d7: Automatically use PostCSS if a postcss.config.cjs file is found
|
170 | - a3b38a8: Automatic JSX injection is fixed (I really mean it this time.)
|
171 |
|
172 | Added automatic aliasing for `tsconfig` `paths`.
|
173 |
|
174 | Fixed a bug where `microsite/global` was not included in the vendor bundle.
|
175 |
|
176 | Fixed a bug where `shared` components would not be concatenated into a single chunk.
|
177 |
|
178 | Added minification for the `init` hydration script.
|
179 |
|
180 | - c17d109: Fix bug with JSX Pragma injection
|
181 | - 1dff58f: Fixed issue with automatic environment typings.
|
182 |
|
183 | Fixed issue where JSX pragma (`h`, `Fragment`) was not being automatically injected.
|
184 |
|
185 | Enabled Snowpack to pick up on `tsconfig.json` or `jsconfig.json` `paths` aliases automatically.
|
186 |
|
187 | ## 1.0.0-next.7
|
188 |
|
189 | ### Patch Changes
|
190 |
|
191 | - 727fc04: Remove cache dir for now
|
192 |
|
193 | ## 1.0.0-next.6
|
194 |
|
195 | ### Patch Changes
|
196 |
|
197 | - 914bf18: Fix cosmicconfig CJS interop issue
|
198 |
|
199 | ## 1.0.0-next.5
|
200 |
|
201 | ### Patch Changes
|
202 |
|
203 | - Automatically use PostCSS if a postcss.config.cjs file is found
|
204 |
|
205 | ## 1.0.0-next.4
|
206 |
|
207 | ### Patch Changes
|
208 |
|
209 | - a3b38a8: Automatic JSX injection is fixed (I really mean it this time.)
|
210 |
|
211 | Added automatic aliasing for `tsconfig` `paths`.
|
212 |
|
213 | Fixed a bug where `microsite/global` was not included in the vendor bundle.
|
214 |
|
215 | Fixed a bug where `shared` components would not be concatenated into a single chunk.
|
216 |
|
217 | Added minification for the `init` hydration script.
|
218 |
|
219 | ## 1.0.0-next.3
|
220 |
|
221 | ### Patch Changes
|
222 |
|
223 | - 7681446: Fixed a bug where automatic JSX inject would not always be triggered
|
224 |
|
225 | ## 1.0.0-next.2
|
226 |
|
227 | ### Patch Changes
|
228 |
|
229 | - Fix bug with JSX Pragma injection
|
230 |
|
231 | ## 1.0.0-next.1
|
232 |
|
233 | ### Patch Changes
|
234 |
|
235 | - Fixed issue with automatic environment typings.
|
236 |
|
237 | Fixed issue where JSX pragma (`h`, `Fragment`) was not being automatically injected.
|
238 |
|
239 | Enabled Snowpack to pick up on `tsconfig.json` or `jsconfig.json` `paths` aliases automatically.
|
240 |
|
241 | ## 1.0.0-next.0
|
242 |
|
243 | ### Major Changes
|
244 |
|
245 | - 2ae753d: Microsite has been completely rewritten to focus on what it does best—optimize your static site for partial hydration.
|
246 |
|
247 | Rather than implementing a highly-opinionated, custom build pipeline, Microsite@1.0.0 leverages the power of [Snowpack](https://www.snowpack.dev/)'s upcoming 3.0.0 release. This means that there are a number of new features, notably:
|
248 |
|
249 | - Pages can now be written in your preferred file format—TypeScript or plain old JavaScript.
|
250 | - If your file/asset types are [supported in Snowpack](https://www.snowpack.dev/reference/supported-files), they are supported by Microsite. This is because Microsite has delegated the initial compilation of your site completely to Snowpack!
|
251 | - `microsite dev` spins up a Snowpack development server with best-in-class DX, including built-in HMR with [Prefresh](https://github.com/JoviDeCroock/prefresh/tree/main).
|
252 | - `microsite build --serve` performs a build and serves the result on a local server, for testing production builds.
|
253 |
|
254 | There are a small number of breaking changes in the release:
|
255 |
|
256 | - Microsite now relies on explicit [subpath exports](https://nodejs.org/api/packages.html#packages_subpath_exports), meaning only public files can be accessed from Node.
|
257 | - Global asset entry points have been moved from `src/global.ts` and `src/global.css` to `src/global/index.ts` and `src/global/index.css`.
|
258 | - Global scripts are no longer executed as a side-effect. Global scripts must contain a single `export default async () => {}`, which is executed on page load.
|
259 |
|
260 | ## 0.7.6
|
261 |
|
262 | ### Patch Changes
|
263 |
|
264 | - 837da9c: Fix issue with `<pre> <code>` dedent
|
265 |
|
266 | ## 0.7.5
|
267 |
|
268 | ### Patch Changes
|
269 |
|
270 | - cb4da30: Fix dedent within <pre> tags
|
271 |
|
272 | ## 0.7.4
|
273 |
|
274 | ### Patch Changes
|
275 |
|
276 | - 5eb1b20: Fix issue where shared styles of non-hydrated components would not be included in the output
|
277 |
|
278 | ## 0.7.3
|
279 |
|
280 | ### Patch Changes
|
281 |
|
282 | - 2535fe9: Fix bug where global script would have extra code injected
|
283 |
|
284 | ## 0.7.2
|
285 |
|
286 | ### Patch Changes
|
287 |
|
288 | - c71d8da: Whoops, actually fix that bundling bug
|
289 |
|
290 | ## 0.7.1
|
291 |
|
292 | ### Patch Changes
|
293 |
|
294 | - bf8cfa0: Fix bundling bug
|
295 |
|
296 | ## 0.7.0
|
297 |
|
298 | ### Minor Changes
|
299 |
|
300 | - 65bf0bd: Implements a caching strategy for `getStaticProps` and `getStaticPaths`, which can often become a build bottleneck due to network or filesystem reads.
|
301 |
|
302 | This change introduces a new `prefetch` method for both of these functions. [Read the docs](/docs/data-fetching) for more details.
|
303 |
|
304 | ### Patch Changes
|
305 |
|
306 | - 4475a3c: Update prefetch logic to accomodate changing headers
|
307 | - f3b313b: Update to esbuild@0.8.x
|
308 |
|
309 | ## 0.7.0-next.2
|
310 |
|
311 | ### Patch Changes
|
312 |
|
313 | - 4475a3c: Update prefetch logic to accomodate changing headers
|
314 |
|
315 | ## 0.7.0-next.1
|
316 |
|
317 | ### Patch Changes
|
318 |
|
319 | - f3b313b: Update to esbuild@0.8.x
|
320 |
|
321 | ## 0.7.0-next.0
|
322 |
|
323 | ### Minor Changes
|
324 |
|
325 | - 65bf0bd: Implements a caching strategy for `getStaticProps` and `getStaticPaths`, which can often become a build bottleneck due to network or filesystem reads.
|
326 |
|
327 | This change introduces a new `prefetch` method for both of these functions. [Read the docs](/docs/data-fetching) for more details.
|
328 |
|
329 | ## 0.6.14
|
330 |
|
331 | ### Patch Changes
|
332 |
|
333 | - e18c71c: Fix Linux shebang issue (#40) by removing need for --experimental-module-resolution=node. Uses .js import specifiers everywhere
|
334 |
|
335 | ## 0.6.13
|
336 |
|
337 | ### Patch Changes
|
338 |
|
339 | - 86bdb17: Fix bug where <pre> code was improperly indented
|
340 |
|
341 | ## 0.6.12
|
342 |
|
343 | ### Patch Changes
|
344 |
|
345 | - 9d22932: Update to typescript@4.1.2
|
346 | - 217299b: Update Document viewport meta tag, html lang and dir
|
347 |
|
348 | ## 0.6.12-next.0
|
349 |
|
350 | ### Patch Changes
|
351 |
|
352 | - 9d22932: Update to typescript@4.1.2
|
353 | - 217299b: Update Document viewport meta tag, html lang and dir
|
354 |
|
355 | ## 0.6.11
|
356 |
|
357 | ### Minor Changes
|
358 |
|
359 | - 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)!
|
360 |
|
361 | ## 0.6.10
|
362 |
|
363 | ### Patch Changes
|
364 |
|
365 | - 8a7374f: Add preload hints for hydrated pages
|
366 | - 6d0f3a3: Microsite's partial hydration method manages each component as a seperate Preact tree, meaning standard `Context` won't work across components.
|
367 |
|
368 | This update adds a `microsite/global` entry point which exposes two utilities for sharing state across component trees.
|
369 |
|
370 | **`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.
|
371 |
|
372 | > If you're a fan of Vue, this is very similar to `reactive` from the Composition API.
|
373 |
|
374 | Components can consume this global state object via **`useGlobalState(state)`**.
|
375 |
|
376 | ```tsx
|
377 | // utils/state.tsx
|
378 | import { createGlobalState } from "microsite/global";
|
379 |
|
380 | export const state = createGlobalState({
|
381 | count: 0
|
382 | });
|
383 |
|
384 | // components/Counter.tsx
|
385 | import { withHydrate } from "microsite/hydrate";
|
386 | import { useGlobalState } from "microsite/global";
|
387 | import { state } from "@/utils/state";
|
388 |
|
389 | const Counter = () => {
|
390 | const localState = useGlobalState(state);
|
391 | // `localState` is a readonly snapshot of global `state`
|
392 | // Updates can be written to global `state` by direct mutation
|
393 |
|
394 | return (
|
395 | <>
|
396 | <button onClick={() => state.count--}>-</button>
|
397 | <span>{localState.count}</span>
|
398 | <button onClick={() => state.count++}>+</button>
|
399 | </>
|
400 | );
|
401 | };
|
402 |
|
403 | export default withHydrate(Counter);
|
404 | ```
|
405 |
|
406 | - 6d0f3a3: Fix issue with CSS scoped name generation
|
407 |
|
408 | ## 0.6.9
|
409 |
|
410 | ### Patch Changes
|
411 |
|
412 | - 788860d: Add --no-clean flag to persist intermediate build (useful for debugging)
|
413 | - 64add28: Fixes issue with named hydration chunks
|
414 | - 10f9fd5: Improve caching by using external styles rather than inlined styles
|
415 | - 0641e72: Update microsite bin to use correct arguments
|
416 |
|
417 | ## 0.6.9-next.0
|
418 |
|
419 | ### Patch Changes
|
420 |
|
421 | - Add --no-clean flag to persist intermediate build (useful for debugging)
|
422 |
|
423 | ## 0.6.6
|
424 |
|
425 | ### Patch Changes
|
426 |
|
427 | - 7e955a0: Ensure children is not required for Head component
|
428 |
|
429 | ## 0.6.5
|
430 |
|
431 | ### Patch Changes
|
432 |
|
433 | - f65c7f4: Improve types by adding global `h` and `Fragment`, and ambient `*.modules.css` declarations
|
434 |
|
435 | ## 0.6.4
|
436 |
|
437 | ### Patch Changes
|
438 |
|
439 | - e53864f: Update default `tsconfig` to be named `base`.
|
440 |
|
441 | Update `tsconfig.baseUrl` to resolve from inside `node_modules`
|
442 |
|
443 | ## 0.6.3
|
444 |
|
445 | ### Patch Changes
|
446 |
|
447 | - a760228: Automatically inject h and Fragment
|
448 | - 580bb4f: expose default tsconfig.json for end-users
|
449 |
|
450 | ## 0.6.2
|
451 |
|
452 | ### Patch Changes
|
453 |
|
454 | - 60de6a2: Fix esbuild jsxFactory
|
455 |
|
456 | ## 0.6.1
|
457 |
|
458 | ### Patch Changes
|
459 |
|
460 | - a3a5131: Fix external warning
|
461 | - 5c79ec3: update README
|
462 |
|
463 | ## 0.6.0
|
464 |
|
465 | ### Breaking Changes
|
466 |
|
467 | - 9d0e9cc: Drop `@types/react` and switch to `preact`. See issue [#5](https://github.com/natemoo-re/microsite/issues/5) for more background.
|
468 |
|
469 | ## 0.0.0-canary-2020101419274
|
470 |
|
471 | ### Breaking Changes
|
472 |
|
473 | - 7fd4679: Drop `@types/react` and switch to `preact`. See issue [#5](https://github.com/natemoo-re/microsite/issues/5) for more background.
|
474 |
|
475 | ## 0.5.1
|
476 |
|
477 | ### Patch Changes
|
478 |
|
479 | - 3d99331: Fix handling of node builtins for intermediate builds
|
480 | - 3d99331: Remove .microsite/cache dir for now
|
481 |
|
482 | ## 0.5.1-next.0
|
483 |
|
484 | ### Patch Changes
|
485 |
|
486 | - a29b71e: Fix handling of node builtins for intermediate builds
|
487 | - 078b910: Remove .microsite/cache dir for now
|
488 |
|
489 | ## 0.5.0
|
490 |
|
491 | ### Minor Changes
|
492 |
|
493 | - 47eec22: **Build performance improvements**
|
494 |
|
495 | 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.
|
496 |
|
497 | [`esbuild`](https://github.com/evanw/esbuild) is very very fast. Now, so is Microsite.
|
498 |
|
499 | ### Patch Changes
|
500 |
|
501 | - 275f297: Gracefully handle Component/export name mismatch
|
502 |
|
503 | Automatically handle `tsconfig.paths` aliases
|
504 |
|
505 | - 945685d: **SEO**
|
506 |
|
507 | 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.
|
508 |
|
509 | 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.
|
510 |
|
511 | If something here doesn't cover your use case, please feel free to [open an issue](https://github.com/natemoo-re/microsite/issues/new).
|
512 |
|
513 | ```tsx
|
514 | import { Head, seo } from "microsite/head";
|
515 |
|
516 | <Head>
|
517 | <seo.title>Easy SEO</seo.title>
|
518 | <seo.description>Hello world!</seo.description>
|
519 | <seo.image
|
520 | 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"
|
521 | width={100}
|
522 | height={100}
|
523 | />
|
524 | <seo.twitter handle="@n_moore" />
|
525 | </Head>;
|
526 | ```
|
527 |
|
528 | #### seo.robots
|
529 |
|
530 | By default, `<Head>` now automatically adds the following tags.
|
531 |
|
532 | ```html
|
533 | <meta name="robots" content="index,follow" />
|
534 | <meta name="googlebot" content="index,follow" />
|
535 | ```
|
536 |
|
537 | This behavior can be controlled with the `<seo.robots>` helper, which accepts `noindex` and `nofollow` booleans.
|
538 |
|
539 | ```tsx
|
540 | <seo.robots noindex nofollow />
|
541 | ```
|
542 |
|
543 | #### seo.title
|
544 |
|
545 | `<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">`.
|
546 |
|
547 | #### seo.description
|
548 |
|
549 | `<seo.description>` accepts a `string` child. `<seo.description>` sets `<meta name="description">` as well as `<meta property="og:description">`.
|
550 |
|
551 | #### seo.canonical
|
552 |
|
553 | `<seo.canonical>` accepts a `string` child representing the canonical URL of the current page. It generates `<link rel="canonical">` and `<meta property="og:url">`.
|
554 |
|
555 | #### seo.image
|
556 |
|
557 | `<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.
|
558 |
|
559 | #### seo.video
|
560 |
|
561 | `<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.
|
562 |
|
563 | #### seo.audio
|
564 |
|
565 | `<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.
|
566 |
|
567 | #### seo.twitter
|
568 |
|
569 | `<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`.
|
570 |
|
571 | #### seo.facebook
|
572 |
|
573 | `<seo.facebook>` accepts an `appId` in order to set `<meta property="fb:app_id">`.
|
574 |
|
575 | #### seo.openGraph
|
576 |
|
577 | `<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.
|
578 |
|
579 | - 17e3130: Fix issue when building projects without optional global/hydrated files
|
580 | - da6e0f3: Improve build performance (parallelization)
|
581 | - eaec00b: Fixes issue with static path generation for the `/` route
|
582 |
|
583 | ## 0.5.0-alpha.0
|
584 |
|
585 | ### Minor Changes
|
586 |
|
587 | - 47eec22: **Build performance improvements**
|
588 |
|
589 | 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.
|
590 |
|
591 | [`esbuild`](https://github.com/evanw/esbuild) is very very fast. Now, so is Microsite.
|
592 |
|
593 | ### Patch Changes
|
594 |
|
595 | - 945685d: **SEO**
|
596 |
|
597 | 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.
|
598 |
|
599 | 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.
|
600 |
|
601 | If something here doesn't cover your use case, please feel free to [open an issue](https://github.com/natemoo-re/microsite/issues/new).
|
602 |
|
603 | ```tsx
|
604 | import { Head, seo } from "microsite/head";
|
605 |
|
606 | <Head>
|
607 | <seo.title>Easy SEO</seo.title>
|
608 | <seo.description>Hello world!</seo.description>
|
609 | <seo.image
|
610 | 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"
|
611 | width={100}
|
612 | height={100}
|
613 | />
|
614 | <seo.twitter handle="@n_moore" />
|
615 | </Head>;
|
616 | ```
|
617 |
|
618 | #### seo.robots
|
619 |
|
620 | By default, `<Head>` now automatically adds the following tags.
|
621 |
|
622 | ```html
|
623 | <meta name="robots" content="index,follow" />
|
624 | <meta name="googlebot" content="index,follow" />
|
625 | ```
|
626 |
|
627 | This behavior can be controlled with the `<seo.robots>` helper, which accepts `noindex` and `nofollow` booleans.
|
628 |
|
629 | ```tsx
|
630 | <seo.robots noindex nofollow />
|
631 | ```
|
632 |
|
633 | #### seo.title
|
634 |
|
635 | `<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">`.
|
636 |
|
637 | #### seo.description
|
638 |
|
639 | `<seo.description>` accepts a `string` child. `<seo.description>` sets `<meta name="description">` as well as `<meta property="og:description">`.
|
640 |
|
641 | #### seo.canonical
|
642 |
|
643 | `<seo.canonical>` accepts a `string` child representing the canonical URL of the current page. It generates `<link rel="canonical">` and `<meta property="og:url">`.
|
644 |
|
645 | #### seo.image
|
646 |
|
647 | `<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.
|
648 |
|
649 | #### seo.video
|
650 |
|
651 | `<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.
|
652 |
|
653 | #### seo.audio
|
654 |
|
655 | `<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.
|
656 |
|
657 | #### seo.twitter
|
658 |
|
659 | `<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`.
|
660 |
|
661 | #### seo.facebook
|
662 |
|
663 | `<seo.facebook>` accepts an `appId` in order to set `<meta property="fb:app_id">`.
|
664 |
|
665 | #### seo.openGraph
|
666 |
|
667 | `<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.
|
668 |
|
\ | No newline at end of file |