# astro ## 0.19.0 ### Minor Changes - 239065e2: **[BREAKING]** Replace the Collections API with new file-based routing. This is a breaking change which impacts collections, pagination, and RSS support. Runtime warnings have been added to help you migrate old code to the new API. If you have trouble upgrading, reach out on https://astro.build/chat This change was made due to confusion around our Collection API, which many users found difficult to use. The new file-based routing approach should feel more familiar to anyone who has used Next.js or SvelteKit. Documentation added: - https://astro-docs-git-main-pikapkg.vercel.app/core-concepts/routing - https://astro-docs-git-main-pikapkg.vercel.app/guides/pagination - https://astro-docs-git-main-pikapkg.vercel.app/guides/rss - https://astro-docs-git-main-pikapkg.vercel.app/reference/api-reference#getstaticpaths - 239065e2: Adds support for Astro.resolve `Astro.resolve()` helps with creating URLs relative to the current Astro file, allowing you to reference files within your `src/` folder. Astro _does not_ resolve relative links within HTML, such as images: ```html ``` The above will be sent to the browser as-is and the browser will resolve it relative to the current **page**. If you want it to be resolved relative to the .astro file you are working in, use `Astro.resolve`: ```astro ``` - 239065e2: Adds support for client:only hydrator The new `client:only` hydrator allows you to define a component that should be skipped during the build and only hydrated in the browser. In most cases it is best to render placeholder content during the build, but that may not always be feasible if an NPM dependency attempts to use browser APIs as soon as is imported. **Note** If more than one renderer is included in your Astro config, you need to include a hint to determine which renderer to use. Renderers will be matched to the name provided in your Astro config, similar to ``. Shorthand can be used for `@astrojs` renderers, i.e. `` will use `@astrojs/renderer-react`. An example usage: ```jsx --- import BarChart from '../components/BarChart.jsx'; --- /** * If multiple renderers are included in the Astro config, * this will ensure that the component is hydrated with * the Preact renderer. */ /** * If a custom renderer is required, use the same name * provided in the Astro config. */ ``` This allows you to import a chart component dependent on d3.js while making sure that the component isn't rendered at all at build time. ### Patch Changes - @astrojs/parser@0.18.6 ## 0.19.0-next.3 ### Minor Changes - 1971ab3c: Adds support for client:only hydrator The new `client:only` hydrator allows you to define a component that should be skipped during the build and only hydrated in the browser. In most cases it is best to render placeholder content during the build, but that may not always be feasible if an NPM dependency attempts to use browser APIs as soon as is imported. **Note** If more than one renderer is included in your Astro config, you need to include a hint to determine which renderer to use. Renderers will be matched to the name provided in your Astro config, similar to ``. Shorthand can be used for `@astrojs` renderers, i.e. `` will use `@astrojs/renderer-react`. An example usage: ```jsx --- import BarChart from '../components/BarChart.jsx'; --- /** * If multiple renderers are included in the Astro config, * this will ensure that the component is hydrated with * the Preact renderer. */ /** * If a custom renderer is required, use the same name * provided in the Astro config. */ ``` This allows you to import a chart component dependent on d3.js while making sure that the component isn't rendered at all at build time. ### Patch Changes - 1f13e403: Fix CSS scoping issue - 78b5bde1: Adds support for Astro.resolve `Astro.resolve()` helps with creating URLs relative to the current Astro file, allowing you to reference files within your `src/` folder. Astro _does not_ resolve relative links within HTML, such as images: ```html ``` The above will be sent to the browser as-is and the browser will resolve it relative to the current **page**. If you want it to be resolved relative to the .astro file you are working in, use `Astro.resolve`: ```astro ``` ## 0.19.0-next.2 ### Patch Changes - 089d1e7a: update dependencies, and fix a bad .flat() call ## 0.19.0-next.1 ### Patch Changes - c881e71e: Revert 939b9d0 "Allow dev server port to be set by PORT environment variable" ## 0.19.0-next.0 ### Minor Changes - 0f0cc2b9: **[BREAKING]** Replace the Collections API with new file-based routing. This is a breaking change which impacts collections, pagination, and RSS support. Runtime warnings have been added to help you migrate old code to the new API. If you have trouble upgrading, reach out on https://astro.build/chat This change was made due to confusion around our Collection API, which many users found difficult to use. The new file-based routing approach should feel more familiar to anyone who has used Next.js or SvelteKit. Documentation added: - https://astro-docs-git-main-pikapkg.vercel.app/core-concepts/routing - https://astro-docs-git-main-pikapkg.vercel.app/guides/pagination - https://astro-docs-git-main-pikapkg.vercel.app/guides/rss - https://astro-docs-git-main-pikapkg.vercel.app/reference/api-reference#getstaticpaths ## 0.18.10 ### Patch Changes - 2321b577: - Allow Markdown with scoped styles to coexist happily with code syntax highlighting via Prism - 618ea3a8: Properly escapes script tags with nested client:load directives when passing Astro components into framework components via props. Browsers interpret script end tags in strings as script end tags, resulting in syntax errors. - 939b9d01: Allow dev server port to be set by `PORT` environment variable - Updated dependencies [1339d5e3] - @astrojs/renderer-vue@0.1.7 ## 0.18.9 ### Patch Changes - 8cf0e65a: Fixes a previous revert, makes sure head content is injected into the right place - 8cf0e65a: Refactor the CLI entrypoint to support stackblitz and improve the runtime check ## 0.18.8 ### Patch Changes - b1959f0f: Reverts a change to head content that was breaking docs site ## 0.18.7 ### Patch Changes - 268a36f3: Fixes issue with head content being rendered in the wrong place - 39df7952: Makes `fetch` available in all framework components - Updated dependencies [f7e86150] - @astrojs/renderer-preact@0.2.1 ## 0.18.6 ### Patch Changes - 27672096: Exclude remote srcset URLs - 03349560: Makes Astro.request available in Astro components ## 0.18.5 ### Patch Changes - a1491cc6: Fix Vue components nesting - Updated dependencies [cd2b5df4] - Updated dependencies [a1491cc6] - @astrojs/parser@0.18.5 - @astrojs/renderer-vue@0.1.6 ## 0.18.4 ### Patch Changes - Updated dependencies [460e625] - @astrojs/markdown-support@0.2.3 ## 0.18.3 ### Patch Changes - Updated dependencies [7015356] - @astrojs/markdown-support@0.2.2 ## 0.18.2 ### Patch Changes - 829d5ba: Fix TSX issue with JSX multi-rendering - 23b0d2d: Adds support for image srcset to the build - Updated dependencies [70f0a09] - Updated dependencies [fdb1c15] - @astrojs/markdown-support@0.2.1 - @astrojs/renderer-vue@0.1.5 ## 0.18.1 ### Patch Changes - d8cebb0: Removes a warning in Svelte hydrated components - e90615f: Fixes warnings for Astro internals for fetch-content and slots ## 0.18.0 ### Minor Changes - f67e8f5: New Collections API (createCollection) BREAKING CHANGE: The expected return format from createCollection() has been changed. Visit https://docs.astro.build/core-concepts/collections to learn the new API. This feature was implemented with backwards-compatible deprecation warnings, to help you find and update pages that are using the legacy API. - 40c882a: Fix url to find page with "index" at the end file name - 0340b0f: Adds support for the client:media hydrator The new `client:media` hydrator allows you to define a component that should only be loaded when a media query matches. An example usage: ```jsx --- import Sidebar from '../components/Sidebar.jsx'; --- ``` This allows you to define components which, for example, only run on mobile devices. A common example is a slide-in sidebar that is needed to add navigation to a mobile app, but is never displayed in desktop view. Since Astro components can have expressions, you can move common media queries to a module for sharing. For example here are defining: **media.js** ```js export const MOBILE = '(max-width: 700px)'; ``` And then you can reference this in your page: **index.astro** ```jsx import Sidebar from '../components/Sidebar.jsx'; import { MOBILE } from '../media.js'; ---(); ``` ### Patch Changes - e89a99f: This includes the props passed to a hydration component when generating the hash/id. This prevents multiple instances of the same component with differing props to be treated as the same component when hydrated by Astro. - b8af49f: Added sass support - a7e6666: compile javascript to target Node v12.x - fb8bf7e: Allow multiple Astro servers to be running simultaneously by choosing random ports if the defaults are taken. - 294a656: Adds support for global style blocks via `