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