From d0d7bc4c1bb7c7f9333bba54f9cacb1bb0a461f7 Mon Sep 17 00:00:00 2001 From: "Szwarc, Barbara" Date: Fri, 7 Dec 2018 13:37:56 +0100 Subject: [PATCH 1/9] Add short README.md file about Luigi Core --- core/public/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core/public/README.md diff --git a/core/public/README.md b/core/public/README.md new file mode 100644 index 0000000000..8f1504d29b --- /dev/null +++ b/core/public/README.md @@ -0,0 +1,11 @@ +# Luigi Core + +## Overview + +Luigi Core is a micro front-end framework written in Svelte. You can use Luigi Core to build the core application, and then use the Luigi Client to communicate with the micro front-end it hosts. + +For details on Luigi Core, see [this](https://github.com/kyma-project/luigi/tree/master/core) document. + +If you want to try out Luigi, see the [examples](https://github.com/kyma-project/luigi/tree/master/core/examples). + +For further documentation on Luigi Core, see [Luigi documentation](https://github.com/kyma-project/luigi/tree/master/docs). \ No newline at end of file From 1bc32e968fa18e7076722587b08e9d9f5bb31f70 Mon Sep 17 00:00:00 2001 From: "Szwarc, Barbara" Date: Mon, 10 Dec 2018 08:16:51 +0100 Subject: [PATCH 2/9] Add improvements in the doc --- core/public/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/public/README.md b/core/public/README.md index 8f1504d29b..4efdf7b7ac 100644 --- a/core/public/README.md +++ b/core/public/README.md @@ -2,10 +2,10 @@ ## Overview -Luigi Core is a micro front-end framework written in Svelte. You can use Luigi Core to build the core application, and then use the Luigi Client to communicate with the micro front-end it hosts. +Luigi Core is a micro front-end framework written in Svelte. You can use Luigi Core to implement the core application, and then the Luigi Client to ensure communication between the application and micro front-ends it hosts. For details on Luigi Core, see [this](https://github.com/kyma-project/luigi/tree/master/core) document. -If you want to try out Luigi, see the [examples](https://github.com/kyma-project/luigi/tree/master/core/examples). +If you want to try Luigi out, see the [examples](https://github.com/kyma-project/luigi/tree/master/core/examples). -For further documentation on Luigi Core, see [Luigi documentation](https://github.com/kyma-project/luigi/tree/master/docs). \ No newline at end of file +For documentation on Luigi Core, see [Luigi documentation](https://github.com/kyma-project/luigi/tree/master/docs). \ No newline at end of file From f94a8fdcbb8c55a98496136132575336e27988bf Mon Sep 17 00:00:00 2001 From: "Szwarc, Barbara" Date: Mon, 10 Dec 2018 08:18:17 +0100 Subject: [PATCH 3/9] Minor fix --- core/public/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/public/README.md b/core/public/README.md index 4efdf7b7ac..c29100516c 100644 --- a/core/public/README.md +++ b/core/public/README.md @@ -2,7 +2,7 @@ ## Overview -Luigi Core is a micro front-end framework written in Svelte. You can use Luigi Core to implement the core application, and then the Luigi Client to ensure communication between the application and micro front-ends it hosts. +Luigi Core is a micro front-end framework written in Svelte. You can use Luigi Core to implement the core application, and then the Luigi Client to ensure communication between the application and the micro front-end it hosts. For details on Luigi Core, see [this](https://github.com/kyma-project/luigi/tree/master/core) document. From 182c6b284aa9a2c29310489efe85cccc5de0c16b Mon Sep 17 00:00:00 2001 From: Karolina Zydek Date: Mon, 10 Dec 2018 08:32:45 +0100 Subject: [PATCH 4/9] Update core/public/README.md Co-Authored-By: bszwarc --- core/public/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/public/README.md b/core/public/README.md index c29100516c..b56eed22ee 100644 --- a/core/public/README.md +++ b/core/public/README.md @@ -2,10 +2,10 @@ ## Overview -Luigi Core is a micro front-end framework written in Svelte. You can use Luigi Core to implement the core application, and then the Luigi Client to ensure communication between the application and the micro front-end it hosts. +Luigi Core is a micro front-end framework written in Svelte. Use Luigi Core to implement the core application, and Luigi Client to ensure communication between the application and the micro front-end it hosts. For details on Luigi Core, see [this](https://github.com/kyma-project/luigi/tree/master/core) document. If you want to try Luigi out, see the [examples](https://github.com/kyma-project/luigi/tree/master/core/examples). -For documentation on Luigi Core, see [Luigi documentation](https://github.com/kyma-project/luigi/tree/master/docs). \ No newline at end of file +For documentation on Luigi Core, see [Luigi documentation](https://github.com/kyma-project/luigi/tree/master/docs). From 1902414b3b2bcf83d9b116b316e9cb0d95a035e4 Mon Sep 17 00:00:00 2001 From: Krzysztof <6783567+kwiatekus@users.noreply.github.com> Date: Mon, 10 Dec 2018 08:48:31 +0100 Subject: [PATCH 5/9] Add minor improvement Co-Authored-By: bszwarc --- core/public/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/public/README.md b/core/public/README.md index b56eed22ee..75d6fae9af 100644 --- a/core/public/README.md +++ b/core/public/README.md @@ -2,7 +2,7 @@ ## Overview -Luigi Core is a micro front-end framework written in Svelte. Use Luigi Core to implement the core application, and Luigi Client to ensure communication between the application and the micro front-end it hosts. +Luigi Core is a micro front-end orchestration framework written in Svelte. Use Luigi Core to implement the core application, and Luigi Client to ensure communication between the application and the micro front-end it hosts. For details on Luigi Core, see [this](https://github.com/kyma-project/luigi/tree/master/core) document. From b91566c9b360a285fbd5851fa28a7fb085cae312 Mon Sep 17 00:00:00 2001 From: Krzysztof <6783567+kwiatekus@users.noreply.github.com> Date: Mon, 10 Dec 2018 11:34:29 +0100 Subject: [PATCH 6/9] Minor update Co-Authored-By: bszwarc --- core/public/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/public/README.md b/core/public/README.md index 75d6fae9af..acce887f57 100644 --- a/core/public/README.md +++ b/core/public/README.md @@ -2,7 +2,7 @@ ## Overview -Luigi Core is a micro front-end orchestration framework written in Svelte. Use Luigi Core to implement the core application, and Luigi Client to ensure communication between the application and the micro front-end it hosts. +Luigi is a micro front-end orchestration framework written in Svelte. Use Luigi Core to implement the core application, and Luigi Client to ensure communication between the application and the micro front-end it hosts. For details on Luigi Core, see [this](https://github.com/kyma-project/luigi/tree/master/core) document. From 30a92068d87026af3a02db3e0f5e5d51109f9dc2 Mon Sep 17 00:00:00 2001 From: Peter Kurajsky Date: Tue, 11 Dec 2018 10:19:05 +0100 Subject: [PATCH 7/9] Default child node mechanism breaks if path ends with a slash (#283) Fix for default child node mechanism breaks if path ends with a slash --- core/src/services/routing.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/src/services/routing.js b/core/src/services/routing.js index 4fd4c48be2..3e5b95652f 100644 --- a/core/src/services/routing.js +++ b/core/src/services/routing.js @@ -7,7 +7,8 @@ import { containsAllSegments, isIE, getConfigValueFromObject, - addLeadingSlash + addLeadingSlash, + trimTrailingSlash } from '../utilities/helpers'; import { getConfigValueFromObjectAsync } from '../utilities/async-helpers'; @@ -330,10 +331,11 @@ export const handleRouteChange = async (path, component, node, config) => { return; } try { - const pathUrl = path && path.length ? getPathWithoutHash(path) : ''; + const pathUrlRaw = path && path.length ? getPathWithoutHash(path) : ''; + const pathUrl = trimTrailingSlash(pathUrlRaw.split('?')[0]); const pathData = await getNavigationPath( LuigiConfig.getConfigValueAsync('navigation.nodes'), - pathUrl.split('?')[0] + pathUrl ); const hideNav = LuigiConfig.getConfigBooleanValue( @@ -345,13 +347,13 @@ export const handleRouteChange = async (path, component, node, config) => { isolateView = false, hideSideNav = false } = getLastNodeObject(pathData); - const params = parseParams(pathUrl.split('?')[1]); + const params = parseParams(pathUrlRaw.split('?')[1]); const nodeParams = getNodeParams(params); const pathParams = getPathParams(pathData.navigationPath); const viewGroup = findViewGroup(getLastNodeObject(pathData)); if (!viewUrl) { - const routeExists = isExistingRoute(path, pathData); + const routeExists = isExistingRoute(pathUrl, pathData); if (routeExists) { const defaultChildNode = await getDefaultChildNode(pathData); @@ -359,7 +361,7 @@ export const handleRouteChange = async (path, component, node, config) => { } else { const alert = { message: 'Could not find the requested route', - link: pathUrl + link: pathUrlRaw }; component.set({ alert }); @@ -370,11 +372,11 @@ export const handleRouteChange = async (path, component, node, config) => { } if (!containsAllSegments(pathUrl, pathData.navigationPath)) { - const matchedPath = await matchPath(pathUrl); + const matchedPath = await matchPath(pathUrlRaw); const alert = { message: 'Could not map the exact target node for the requested route', - link: pathUrl + link: pathUrlRaw }; component.set({ alert }); @@ -440,7 +442,7 @@ export const matchPath = async path => { const pathUrl = 0 < path.length ? getPathWithoutHash(path) : path; const pathData = await getNavigationPath( LuigiConfig.getConfigValueAsync('navigation.nodes'), - pathUrl.split('?')[0] + trimTrailingSlash(pathUrl.split('?')[0]) ); if (pathData.navigationPath.length > 0) { const lastNode = From 16ea290907e7b51239ff82f309432ce29a1c9670 Mon Sep 17 00:00:00 2001 From: Jesus Real <8238188+jesusreal@users.noreply.github.com> Date: Tue, 11 Dec 2018 12:24:24 +0100 Subject: [PATCH 8/9] exclude new README.md file from being deleted when buiding luigi core --- core/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/webpack.config.js b/core/webpack.config.js index e84a932aa7..3e5314364c 100644 --- a/core/webpack.config.js +++ b/core/webpack.config.js @@ -87,7 +87,7 @@ module.exports = { }, plugins: [ new CleanWebpackPlugin(['public'], { - exclude: ['package.json'], + exclude: ['package.json', 'README.md'], verbose: true }), new MiniCssExtractPlugin({ filename: 'luigi.css' }), From 1208240c73420f1f93da68a7729a789c1d11760a Mon Sep 17 00:00:00 2001 From: Jesus Real <8238188+jesusreal@users.noreply.github.com> Date: Tue, 11 Dec 2018 13:13:02 +0100 Subject: [PATCH 9/9] Revert "Default child node mechanism breaks if path ends with a slash (#283)" This reverts commit 30a92068d87026af3a02db3e0f5e5d51109f9dc2. --- core/src/services/routing.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/core/src/services/routing.js b/core/src/services/routing.js index 3e5b95652f..4fd4c48be2 100644 --- a/core/src/services/routing.js +++ b/core/src/services/routing.js @@ -7,8 +7,7 @@ import { containsAllSegments, isIE, getConfigValueFromObject, - addLeadingSlash, - trimTrailingSlash + addLeadingSlash } from '../utilities/helpers'; import { getConfigValueFromObjectAsync } from '../utilities/async-helpers'; @@ -331,11 +330,10 @@ export const handleRouteChange = async (path, component, node, config) => { return; } try { - const pathUrlRaw = path && path.length ? getPathWithoutHash(path) : ''; - const pathUrl = trimTrailingSlash(pathUrlRaw.split('?')[0]); + const pathUrl = path && path.length ? getPathWithoutHash(path) : ''; const pathData = await getNavigationPath( LuigiConfig.getConfigValueAsync('navigation.nodes'), - pathUrl + pathUrl.split('?')[0] ); const hideNav = LuigiConfig.getConfigBooleanValue( @@ -347,13 +345,13 @@ export const handleRouteChange = async (path, component, node, config) => { isolateView = false, hideSideNav = false } = getLastNodeObject(pathData); - const params = parseParams(pathUrlRaw.split('?')[1]); + const params = parseParams(pathUrl.split('?')[1]); const nodeParams = getNodeParams(params); const pathParams = getPathParams(pathData.navigationPath); const viewGroup = findViewGroup(getLastNodeObject(pathData)); if (!viewUrl) { - const routeExists = isExistingRoute(pathUrl, pathData); + const routeExists = isExistingRoute(path, pathData); if (routeExists) { const defaultChildNode = await getDefaultChildNode(pathData); @@ -361,7 +359,7 @@ export const handleRouteChange = async (path, component, node, config) => { } else { const alert = { message: 'Could not find the requested route', - link: pathUrlRaw + link: pathUrl }; component.set({ alert }); @@ -372,11 +370,11 @@ export const handleRouteChange = async (path, component, node, config) => { } if (!containsAllSegments(pathUrl, pathData.navigationPath)) { - const matchedPath = await matchPath(pathUrlRaw); + const matchedPath = await matchPath(pathUrl); const alert = { message: 'Could not map the exact target node for the requested route', - link: pathUrlRaw + link: pathUrl }; component.set({ alert }); @@ -442,7 +440,7 @@ export const matchPath = async path => { const pathUrl = 0 < path.length ? getPathWithoutHash(path) : path; const pathData = await getNavigationPath( LuigiConfig.getConfigValueAsync('navigation.nodes'), - trimTrailingSlash(pathUrl.split('?')[0]) + pathUrl.split('?')[0] ); if (pathData.navigationPath.length > 0) { const lastNode =