UNPKG

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