From a11c2dfa7cef3985a87d566ca6dc9c5be9b68bad Mon Sep 17 00:00:00 2001 From: hang-up Date: Tue, 5 Dec 2023 17:12:54 -0500 Subject: [PATCH 1/3] Removed website from editUrl of docusaurus. --- docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 6a794e4a5..5fa36d3fa 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -153,7 +153,7 @@ module.exports = { docs: { path: 'docs', sidebarPath: require.resolve('./sidebars.json'), - editUrl: `${repoUrl}/blob/master/website/`, + editUrl: `${repoUrl}/blob/master/`, // sidebarCollapsible: false, }, theme: { From 4f6bbe537a90e4e26ab80d401576549cea0a4c2b Mon Sep 17 00:00:00 2001 From: hang-up Date: Tue, 5 Dec 2023 17:14:15 -0500 Subject: [PATCH 2/3] Updated ecosystem-vue custom prop section. --- versioned_docs/version-5.x/ecosystem-vue.md | 68 +++++++++------------ versioned_docs/version-6.x/ecosystem-vue.md | 68 +++++++++------------ 2 files changed, 58 insertions(+), 78 deletions(-) diff --git a/versioned_docs/version-5.x/ecosystem-vue.md b/versioned_docs/version-5.x/ecosystem-vue.md index 9bf8ef5af..92d6872db 100644 --- a/versioned_docs/version-5.x/ecosystem-vue.md +++ b/versioned_docs/version-5.x/ecosystem-vue.md @@ -83,7 +83,15 @@ const vueLifecycles = singleSpaVue({ Vue, appOptions: { render(h) { - return h(App); + return h(App, { + props: { + // single-spa props are available on the "this" object. Forward them to your component as needed. + // https://single-spa.js.org/docs/building-applications#lifecycle-props + name: this.name, + mountParcel: this.mountParcel, + singleSpa: this.singleSpa, + } + }); }, router, }, @@ -132,35 +140,40 @@ export const unmount = vueLifecycles.unmount; ## Custom props -[Single-spa custom props](/docs/building-applications/#custom-props) can be passed to your root component like so: +[Single-spa custom props](/docs/building-applications/#custom-props) can be passed to your root component. In your application's entry file, add the props to your root component: + +### Vue 2 ```js -// main.js const vueLifecycles = singleSpaVue({ Vue, appOptions: { render(h) { return h(App, { - mountParcel: this.mountParcel, - otherProp: this.otherProp, + props: { + otherProp: this.otherProp, + }, }); }, - router, }, }); ``` +### Vue 3 -```vue -// App.vue - - +```js +const vueLifecycles = singleSpaVue({ + Vue, + appOptions: { + render(h) { + return h(App, { + // Notice that this is not within a props object! + otherProp: this.otherProp, + }); + }, + router, + }, +}); ``` ## Shared dependencies @@ -232,29 +245,6 @@ const vueLifecycles = singleSpaVue({ }); ``` -## Custom Props - -[single-spa custom props](/docs/building-applications#custom-props) are available in the `render()` function in your main file. They can be passed as custom props to your App component. - -```js -const vueLifecycles = singleSpaVue({ - Vue, - appOptions: { - render(h) { - return h(App, { - props: { - // single-spa props are available on the "this" object. Forward them to your component as needed. - // https://single-spa.js.org/docs/building-applications#lifecycle-props - name: this.name, - mountParcel: this.mountParcel, - singleSpa: this.singleSpa, - }, - }); - }, - }, -}); -``` - ## Parcels ### Creating a parcel diff --git a/versioned_docs/version-6.x/ecosystem-vue.md b/versioned_docs/version-6.x/ecosystem-vue.md index 9bf8ef5af..92d6872db 100644 --- a/versioned_docs/version-6.x/ecosystem-vue.md +++ b/versioned_docs/version-6.x/ecosystem-vue.md @@ -83,7 +83,15 @@ const vueLifecycles = singleSpaVue({ Vue, appOptions: { render(h) { - return h(App); + return h(App, { + props: { + // single-spa props are available on the "this" object. Forward them to your component as needed. + // https://single-spa.js.org/docs/building-applications#lifecycle-props + name: this.name, + mountParcel: this.mountParcel, + singleSpa: this.singleSpa, + } + }); }, router, }, @@ -132,35 +140,40 @@ export const unmount = vueLifecycles.unmount; ## Custom props -[Single-spa custom props](/docs/building-applications/#custom-props) can be passed to your root component like so: +[Single-spa custom props](/docs/building-applications/#custom-props) can be passed to your root component. In your application's entry file, add the props to your root component: + +### Vue 2 ```js -// main.js const vueLifecycles = singleSpaVue({ Vue, appOptions: { render(h) { return h(App, { - mountParcel: this.mountParcel, - otherProp: this.otherProp, + props: { + otherProp: this.otherProp, + }, }); }, - router, }, }); ``` +### Vue 3 -```vue -// App.vue - - +```js +const vueLifecycles = singleSpaVue({ + Vue, + appOptions: { + render(h) { + return h(App, { + // Notice that this is not within a props object! + otherProp: this.otherProp, + }); + }, + router, + }, +}); ``` ## Shared dependencies @@ -232,29 +245,6 @@ const vueLifecycles = singleSpaVue({ }); ``` -## Custom Props - -[single-spa custom props](/docs/building-applications#custom-props) are available in the `render()` function in your main file. They can be passed as custom props to your App component. - -```js -const vueLifecycles = singleSpaVue({ - Vue, - appOptions: { - render(h) { - return h(App, { - props: { - // single-spa props are available on the "this" object. Forward them to your component as needed. - // https://single-spa.js.org/docs/building-applications#lifecycle-props - name: this.name, - mountParcel: this.mountParcel, - singleSpa: this.singleSpa, - }, - }); - }, - }, -}); -``` - ## Parcels ### Creating a parcel From a7e4d726a1efb777cd113f5854147f6b17185c5f Mon Sep 17 00:00:00 2001 From: hang-up Date: Tue, 5 Dec 2023 17:19:24 -0500 Subject: [PATCH 3/3] Additional removal of website from editUrl of docusaurus. --- src/components/Showcase/index.js | 2 +- src/components/Sponsors/index.js | 2 +- versioned_docs/version-4.x/getting-started-overview.md | 2 +- versioned_docs/version-5.x/getting-started-overview.md | 2 +- versioned_docs/version-6.x/getting-started-overview.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Showcase/index.js b/src/components/Showcase/index.js index 2c812fedd..0fcea6e24 100644 --- a/src/components/Showcase/index.js +++ b/src/components/Showcase/index.js @@ -37,7 +37,7 @@ export const Showcase = ({ showAll }) => { <>

Are you using this project?

Add your company diff --git a/src/components/Sponsors/index.js b/src/components/Sponsors/index.js index 5e11ab024..36a10afa1 100644 --- a/src/components/Sponsors/index.js +++ b/src/components/Sponsors/index.js @@ -37,7 +37,7 @@ export const Sponsors = ({ showAll }) => { <>

Are you sponsoring this project?

Add your company diff --git a/versioned_docs/version-4.x/getting-started-overview.md b/versioned_docs/version-4.x/getting-started-overview.md index 08198aa70..49d5e6b7d 100644 --- a/versioned_docs/version-4.x/getting-started-overview.md +++ b/versioned_docs/version-4.x/getting-started-overview.md @@ -161,4 +161,4 @@ Read our [contributing guide](https://reactjs.org/contributing/how-to-contribute See [user showcase](/users). -Is your company or project using single-spa? Let us know by submitting a PR to [this section](https://github.com/single-spa/single-spa.js.org/blob/master/website/src/data/users.js)! +Is your company or project using single-spa? Let us know by submitting a PR to [this section](https://github.com/single-spa/single-spa.js.org/blob/master/src/data/users.js)! diff --git a/versioned_docs/version-5.x/getting-started-overview.md b/versioned_docs/version-5.x/getting-started-overview.md index 2d537e94b..a9602854d 100644 --- a/versioned_docs/version-5.x/getting-started-overview.md +++ b/versioned_docs/version-5.x/getting-started-overview.md @@ -165,4 +165,4 @@ Read our [contributing guide](/docs/contributing-overview/) to learn about our d See [user showcase](/users). -Is your company or project using single-spa? Let us know by submitting a PR to [this section](https://github.com/single-spa/single-spa.js.org/blob/master/website/src/data/users.js)! +Is your company or project using single-spa? Let us know by submitting a PR to [this section](https://github.com/single-spa/single-spa.js.org/blob/master/src/data/users.js)! diff --git a/versioned_docs/version-6.x/getting-started-overview.md b/versioned_docs/version-6.x/getting-started-overview.md index 2d537e94b..a9602854d 100644 --- a/versioned_docs/version-6.x/getting-started-overview.md +++ b/versioned_docs/version-6.x/getting-started-overview.md @@ -165,4 +165,4 @@ Read our [contributing guide](/docs/contributing-overview/) to learn about our d See [user showcase](/users). -Is your company or project using single-spa? Let us know by submitting a PR to [this section](https://github.com/single-spa/single-spa.js.org/blob/master/website/src/data/users.js)! +Is your company or project using single-spa? Let us know by submitting a PR to [this section](https://github.com/single-spa/single-spa.js.org/blob/master/src/data/users.js)!