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