docusaurus/assets/js/38dd9662.9af6edc8.js
2025-12-04 14:19:59 +00:00

1 line
18 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["1532"],{41452:function(e,s,n){n.d(s,{A:()=>t});let t={tabItem:"tabItem_pnkT"}},18416:function(e,s,n){n.d(s,{A:()=>t});let t={tabList:"tabList_Qoir",tabItem:"tabItem_AQgk"}},80944:function(e,s,n){n.d(s,{A:()=>t});let t={browserWindow:"browserWindow_my1Q",browserWindowHeader:"browserWindowHeader_jXSR",row:"row_KZDM",buttons:"buttons_uHc7",right:"right_oyze",browserWindowAddressBar:"browserWindowAddressBar_Pd8y",dot:"dot_giz1",browserWindowMenuIcon:"browserWindowMenuIcon_Vhuh",bar:"bar_rrRL",browserWindowBody:"browserWindowBody_Idgs"}},90978:function(e,s,n){n.d(s,{A:()=>t});let t=n.p+"assets/images/social-card-7e038d19ea67c686e90e1f599f7256d0.png"},75757:function(e,s,n){n.d(s,{A:()=>t});let t=n.p+"assets/images/social-card-7e038d19ea67c686e90e1f599f7256d0.png"},76423:function(e,s,n){n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>u,default:()=>p,frontMatter:()=>c,metadata:()=>t,toc:()=>h});var t=n(55360),a=n(74848),r=n(56151),o=n(52903),i=n(14729),l=n(13899);let c={title:"Docusaurus 2.3",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2023-01-27T00:00:00.000Z")},u,d={image:n(90978).A,authorsImageUrls:[void 0]},h=[{value:"Highlights",id:"highlights",level:2},{value:"Google Tag Manager plugin",id:"google-tag-manager-plugin",level:3},{value:"Tabs Query String Support",id:"tabs-query-string-support",level:3},{value:"Nested admonitions",id:"nested-admonitions",level:3},{value:"Blog <code>createFeedItems</code>",id:"blog-createfeeditems",level:3},{value:"Translations",id:"translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function g(e){let s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["We are happy to announce ",(0,a.jsx)(s.strong,{children:"Docusaurus 2.3"}),"."]}),"\n",(0,a.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,a.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,a.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Docusaurus 2.2 social card",src:n(75757).A+"",width:"1200",height:"600"})}),"\n",(0,a.jsx)(s.h2,{id:"highlights",children:"Highlights"}),"\n",(0,a.jsx)(s.h3,{id:"google-tag-manager-plugin",children:"Google Tag Manager plugin"}),"\n",(0,a.jsx)(s.p,{children:"Google Tag Manager is a tag management system that allows great flexibility. It enables analytics and marketing teams to easily load other third-party trackers and fire analytics tags."}),"\n",(0,a.jsxs)(s.p,{children:["We now have a ",(0,a.jsx)(s.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-tag-manager/",children:(0,a.jsx)(s.code,{children:"@docusaurus/plugin-google-tag-manager"})})," package that you can use alongside or as an alternative to the existing ",(0,a.jsx)(s.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag/",children:"gtag.js plugin"})," (refer to ",(0,a.jsx)(s.a,{href:"https://support.google.com/tagmanager/answer/7582054",children:"this doc"})," to understand when to use which solution)."]}),"\n",(0,a.jsxs)(s.admonition,{title:"Google is sunsetting Universal Analytics",type:"warning",children:[(0,a.jsxs)(s.p,{children:[(0,a.jsx)(s.a,{href:"https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/",children:"Google will sunset its Universal Analytics"})," on ",(0,a.jsx)(s.strong,{children:"July 1, 2023"}),", and ask users to migrate to ",(0,a.jsx)(s.strong,{children:"Google Analytics 4"}),"."]}),(0,a.jsxs)(s.p,{children:["Therefore, we are also ",(0,a.jsxs)(s.strong,{children:["deprecating our existing ",(0,a.jsx)(s.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-analytics",children:(0,a.jsx)(s.code,{children:"@docusaurus/plugin-google-analytics"})})]})," package. Docusaurus users should create a new Google Analytics 4 property, and migrate to the ",(0,a.jsx)(s.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag/",children:"gtag.js plugin"}),", or the ",(0,a.jsx)(s.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-tag-manager/",children:"Google Tag Manager plugin"}),". Refer to the ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/7221",children:"dedicated Docusaurus issue"})," for details and questions."]})]}),"\n",(0,a.jsx)(s.h3,{id:"tabs-query-string-support",children:"Tabs Query String Support"}),"\n",(0,a.jsxs)(s.p,{children:["It is now possible to link a selected tab to a query string parameter. When a tab is selected, it will be stored in your browser URL as a ",(0,a.jsx)(s.code,{children:"?qs-param=tab-value"})," search parameter."]}),"\n",(0,a.jsx)(s.p,{children:"This feature allows deep-linking to a specific documentation tab that will pre-selected on page load."}),"\n",(0,a.jsxs)(s.p,{children:["When used alongside the ",(0,a.jsx)(s.code,{children:"groupId"})," prop, the query string tab value takes precedence over the ",(0,a.jsx)(s.code,{children:"localStorage"})," value."]}),"\n",(0,a.jsxs)(s.p,{children:["Make sure to check the ",(0,a.jsx)(s.a,{href:"/docs/markdown-features/tabs#query-string",children:"documentation"})," and the demo below to understand how it works:"]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-tsx",children:'<Tabs groupId="current-os" queryString>\n <TabItem value="android" label="Android">\n Android\n </TabItem>\n <TabItem value="ios" label="iOS">\n iOS\n </TabItem>\n</Tabs>\n'})}),"\n",(0,a.jsx)(o.A,{children:(0,a.jsxs)(i.A,{groupId:"current-os",queryString:!0,children:[(0,a.jsx)(l.A,{value:"android",label:"Android",children:(0,a.jsx)(s.p,{children:"Android"})}),(0,a.jsx)(l.A,{value:"ios",label:"iOS",children:(0,a.jsx)(s.p,{children:"iOS"})})]})}),"\n",(0,a.jsx)(s.h3,{id:"nested-admonitions",children:"Nested admonitions"}),"\n",(0,a.jsx)(s.p,{children:"It is now possible to nest one admonition within another by adding extra colons for the outer/enclosing admonition:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-md",children:"::::tip[nested admonitions]\n\nYou can now nest one admonition within another!\n\n:::danger\n\nUse this sparingly when it makes sense.\n\n:::\n\n::::\n"})}),"\n",(0,a.jsxs)(s.admonition,{title:"nested admonitions",type:"tip",children:[(0,a.jsx)(s.p,{children:"You can now nest one admonition within another!"}),(0,a.jsx)(s.admonition,{type:"danger",children:(0,a.jsx)(s.p,{children:"Use this sparingly when it makes sense."})})]}),"\n",(0,a.jsxs)(s.h3,{id:"blog-createfeeditems",children:["Blog ",(0,a.jsx)(s.code,{children:"createFeedItems"})]}),"\n",(0,a.jsxs)(s.p,{children:["A new blog plugin option ",(0,a.jsx)(s.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-blog/#CreateFeedItemsFn",children:(0,a.jsx)(s.code,{children:"feedOptions.createFeedItems"})})," gives you more control over the RSS/Atom feed generation. It is now possible to transform/filter/limit feed items through a new callback."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-tsx",metastring:'title="docusaurus.config.js"',children:"[\n '@docusaurus/preset-classic',\n {\n blog: {\n feedOptions: {\n // highlight-start\n createFeedItems: async (params) => {\n const {blogPosts, defaultCreateFeedItems, ...rest} = params;\n return defaultCreateFeedItems({\n // keep only the 10 most recent blog posts in the feed\n blogPosts: blogPosts.filter((item, index) => index < 10),\n ...rest,\n });\n },\n // highlight-end\n },\n },\n },\n];\n"})}),"\n",(0,a.jsx)(s.h3,{id:"translations",children:"Translations"}),"\n",(0,a.jsx)(s.p,{children:"We added or completed the default theme translation support for multiple languages:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["\u{1F1F8}\u{1F1EE} ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8541",children:"#8541"})," Slovenian"]}),"\n",(0,a.jsxs)(s.li,{children:["\u{1F1F9}\u{1F1F7} ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8289",children:"#8289"})," Turkish"]}),"\n",(0,a.jsxs)(s.li,{children:["\u{1F1EE}\u{1F1F7} ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8406",children:"#8406"})," Farsi"]}),"\n",(0,a.jsxs)(s.li,{children:["\u{1F1F5}\u{1F1F1} ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8525",children:"#8525"})," Polish"]}),"\n",(0,a.jsxs)(s.li,{children:["\u{1F1E8}\u{1F1F3} ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8423",children:"#8423"})," Chinese"]}),"\n",(0,a.jsxs)(s.li,{children:["\u{1F1F8}\u{1F1EA} ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8312",children:"#8312"})," Swedish"]}),"\n",(0,a.jsxs)(s.li,{children:["\u{1F1FB}\u{1F1F3} ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8450",children:"#8450"})," Vietnamese"]}),"\n"]}),"\n",(0,a.jsx)(s.admonition,{type:"tip",children:(0,a.jsxs)(s.p,{children:["Completing theme translations is an ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"ongoing effort"})," and an easy way to contribute to Docusaurus. We add new theme features regularly, for which we often ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"need new translations"}),"."]})}),"\n",(0,a.jsx)(s.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,a.jsx)(s.p,{children:"Other notable changes include:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8463",children:"#8463"})," and ",(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8328",children:"#8328"}),": fix some annoying Docusaurus layout issues"]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8539",children:"#8539"}),": Algolia plugin ",(0,a.jsx)(s.code,{children:"options.searchPagePath"})," should be correctly applied to search modal footer"]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8462",children:"#8462"}),": Algolia plugin now makes it easier to transform displayed search results with custom logic"]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8397",children:"#8397"}),": the ",(0,a.jsx)(s.code,{children:"deploy"})," CLI now understands git url ",(0,a.jsx)(s.code,{children:"insteadOf"})," config"]}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["Check the ",(0,a.jsx)(s.strong,{children:(0,a.jsx)(s.a,{href:"/changelog/2.3.0",children:"2.3.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function p(e={}){let{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(g,{...e})}):g(e)}},13899:function(e,s,n){n.d(s,{A:()=>o});var t=n(74848);n(96540);var a=n(11118),r=n(41452);function o({children:e,hidden:s,className:n}){return(0,t.jsx)("div",{role:"tabpanel",className:(0,a.A)(r.A.tabItem,n),hidden:s,children:e})}},14729:function(e,s,n){n.d(s,{A:()=>p});var t=n(74848),a=n(96540),r=n(11118),o=n(85208),i=n(31191),l=n(17060),c=n(30926),u=n(18416);function d({className:e,block:s,selectedValue:n,selectValue:a,tabValues:o}){let l=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.a_)(),d=e=>{let s=e.currentTarget,t=o[l.indexOf(s)].value;t!==n&&(c(s),a(t))},h=e=>{let s=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let n=l.indexOf(e.currentTarget)+1;s=l[n]??l[0];break}case"ArrowLeft":{let n=l.indexOf(e.currentTarget)-1;s=l[n]??l[l.length-1]}}s?.focus()};return(0,t.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":s},e),children:o.map(({value:e,label:s,attributes:a})=>(0,t.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{l.push(e)},onKeyDown:h,onClick:d,...a,className:(0,r.A)("tabs__item",u.A.tabItem,a?.className,{"tabs__item--active":n===e}),children:s??e},e))})}function h({lazy:e,children:s,selectedValue:n}){let o=(Array.isArray(s)?s:[s]).filter(Boolean);if(e){let e=o.find(e=>e.props.value===n);return e?(0,a.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,t.jsx)("div",{className:"margin-top--md",children:o.map((e,s)=>(0,a.cloneElement)(e,{key:s,hidden:e.props.value!==n}))})}function g(e){let s=(0,l.u)(e);return(0,t.jsxs)("div",{className:(0,r.A)(o.G.tabs.container,"tabs-container",u.A.tabList),children:[(0,t.jsx)(d,{...s,...e}),(0,t.jsx)(h,{...s,...e})]})}function p(e){let s=(0,c.A)();return(0,t.jsx)(g,{...e,children:(0,l.v)(e.children)},String(s))}},17060:function(e,s,n){n.d(s,{u:()=>d,v:()=>c});var t=n(96540),a=n(49519),r=n(57190),o=n(11864),i=n(84329),l=n(34123);function c(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){let{props:s}=e;return!!s&&"object"==typeof s&&"value"in s}(e))return e;throw Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u({value:e,tabValues:s}){return s.some(s=>s.value===e)}function d(e){let s,{defaultValue:n,queryString:d=!1,groupId:h}=e,g=function(e){let{values:s,children:n}=e;return(0,t.useMemo)(()=>{let e=s??c(n).map(({props:{value:e,label:s,attributes:n,default:t}})=>({value:e,label:s,attributes:n,default:t})),t=(0,i.XI)(e,(e,s)=>e.value===s.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[s,n])}(e),[p,m]=(0,t.useState)(()=>(function({defaultValue:e,tabValues:s}){if(0===s.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!u({value:e,tabValues:s}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${s.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}let n=s.find(e=>e.default)??s[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value})({defaultValue:n,tabValues:g})),[b,f]=function({queryString:e=!1,groupId:s}){let n=(0,a.W6)(),r=function({queryString:e=!1,groupId:s}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!s)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:e,groupId:s});return[(0,o.aZ)(r),(0,t.useCallback)(e=>{if(!r)return;let s=new URLSearchParams(n.location.search);s.set(r,e),n.replace({...n.location,search:s.toString()})},[r,n])]}({queryString:d,groupId:h}),[x,j]=function({groupId:e}){let s=e?`docusaurus.tab.${e}`:null,[n,a]=(0,l.Dv)(s);return[n,(0,t.useCallback)(e=>{s&&a.set(e)},[s,a])]}({groupId:h}),w=u({value:s=b??x,tabValues:g})?s:null;return(0,r.A)(()=>{w&&m(w)},[w]),{selectedValue:p,selectValue:(0,t.useCallback)(e=>{if(!u({value:e,tabValues:g}))throw Error(`Can't select invalid tab value=${e}`);m(e),f(e),j(e)},[f,j,g]),tabValues:g}}},52903:function(e,s,n){n.d(s,{A:()=>o});var t=n(74848);n(96540);var a=n(11118),r=n(80944);function o({children:e,minHeight:s,url:n="http://localhost:3000",style:o,bodyStyle:i}){return(0,t.jsxs)("div",{className:r.A.browserWindow,style:{...o,minHeight:s},children:[(0,t.jsxs)("div",{className:r.A.browserWindowHeader,children:[(0,t.jsxs)("div",{className:r.A.buttons,children:[(0,t.jsx)("span",{className:r.A.dot,style:{background:"#f25f58"}}),(0,t.jsx)("span",{className:r.A.dot,style:{background:"#fbbe3c"}}),(0,t.jsx)("span",{className:r.A.dot,style:{background:"#58cb42"}})]}),(0,t.jsx)("div",{className:(0,a.A)(r.A.browserWindowAddressBar,"text--truncate"),children:n}),(0,t.jsx)("div",{className:r.A.browserWindowMenuIcon,children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:r.A.bar}),(0,t.jsx)("span",{className:r.A.bar}),(0,t.jsx)("span",{className:r.A.bar})]})})]}),(0,t.jsx)("div",{className:r.A.browserWindowBody,style:i,children:e})]})}},56151:function(e,s,n){n.d(s,{R:()=>o,x:()=>i});var t=n(96540);let a={},r=t.createContext(a);function o(e){let s=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),t.createElement(r.Provider,{value:s},e.children)}},55360:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/2.3","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/2.3/index.mdx","source":"@site/blog/releases/2.3/index.mdx","title":"Docusaurus 2.3","description":"We are happy to announce Docusaurus 2.3.","date":"2023-01-27T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":3.67,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.3","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2023-01-27T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1764857819000,"lastUpdatedBy":"dependabot[bot]","prevItem":{"title":"Docusaurus 2.4","permalink":"/blog/releases/2.4"},"nextItem":{"title":"Docusaurus 2.2","permalink":"/blog/releases/2.2"}}')}}]);