From 1f3f6008eae69eda521ec4a06e54fafe7a9947d5 Mon Sep 17 00:00:00 2001 From: Igor Lukanin Date: Sat, 1 Feb 2025 22:05:50 +0100 Subject: [PATCH 1/5] Update deprecations --- DEPRECATION.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPRECATION.md b/DEPRECATION.md index 3c3268d637fd0..ce0c9187407a0 100644 --- a/DEPRECATION.md +++ b/DEPRECATION.md @@ -58,7 +58,7 @@ features: | Removed | [Using Redis for in-memory cache and queue](#using-redis-for-in-memory-cache-and-queue) | v0.32.0 | v0.36.0 | | Deprecated | [`SECURITY_CONTEXT`](#security_context) | v0.33.0 | | | Deprecated | [`running_total` measure type](#running_total-measure-type) | v0.33.39 | | -| Deprecated | [Top-level `includes` parameter in views](#top-level-includes-parameter-in-views) | v0.34.34 | | +| Removed | [Top-level `includes` parameter in views](#top-level-includes-parameter-in-views) | v0.34.34 | v1.2.0 | | Removed | [Node.js 16](#nodejs-16) | v0.35.0 | v0.36.0 | | Removed | [MySQL-based SQL API](#mysql-based-sql-api) | v0.35.0 | v0.35.0 | | Removed | [`initApp` hook](#initapp-hook) | v0.35.0 | v0.35.0 | @@ -349,9 +349,9 @@ to calculate running totals instead. ### Top-level `includes` parameter in views -**Deprecated in Release: v0.34.34** +**Removed in release: v1.2.0** -The top-level `includes` parameter is now deprecated. Please always use the +The top-level `includes` parameter has been removed. Instead, always use the `includes` parameter within [`cubes` and `join_path` parameters](https://cube.dev/docs/reference/data-model/view#cubes) so you can explicitly control the join path. From 17527691dff9dd37f5ac531b50b0597ae01466a9 Mon Sep 17 00:00:00 2001 From: Igor Lukanin Date: Sat, 1 Feb 2025 22:05:57 +0100 Subject: [PATCH 2/5] Update examples --- .../controlling-access-to-cubes-and-views.mdx | 31 ++++++-- docs/pages/reference/data-model/view.mdx | 74 ++++++------------- 2 files changed, 48 insertions(+), 57 deletions(-) diff --git a/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx b/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx index 91514035d9777..8f2e716312363 100644 --- a/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx +++ b/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx @@ -52,9 +52,15 @@ cubes: views: - name: total_revenue_per_customer public: {{ COMPILE_CONTEXT['securityContext']['isFinance'] }} - includes: - - orders.total_revenue - - users.company + + cubes: + - join_path: orders + includes: + - total_revenue + + - join_path: users + includes: + - company ``` ```javascript @@ -75,12 +81,25 @@ cube(`users`, { }); // total_revenue_per_customer.js -view("total_revenue_per_customer", { +view(`total_revenue_per_customer`, { description: `Total revenue per customer`, public: COMPILE_CONTEXT.securityContext.isFinance, - includes: [orders.total_revenue, users.company], -}); + cubes: [ + { + join_path: orders, + includes: [ + `total_revenue` + ] + }, + { + join_path: users, + includes: [ + `company` + ] + } + ] +}) ``` diff --git a/docs/pages/reference/data-model/view.mdx b/docs/pages/reference/data-model/view.mdx index 800bdb98b7eee..779315ddc59b7 100644 --- a/docs/pages/reference/data-model/view.mdx +++ b/docs/pages/reference/data-model/view.mdx @@ -292,8 +292,20 @@ view(`arr`, { description: `Annual Recurring Revenue`, public: COMPILE_CONTEXT.security_context.is_finance, - includes: [revenue.arr, revenue.date, customers.plan], -}); + cubes: [ + { + join_path: revenue, + includes: [ + `arr`, + `date` + ] + }, + { + join_path: customers, + includes: `plan` + } + ] +}) ``` ```yaml @@ -302,12 +314,15 @@ views: description: Annual Recurring Revenue public: COMPILE_CONTEXT.security_context.is_finance - includes: - # Measures - - revenue.arr - # Dimensions - - revenue.date - - customers.plan + cubes: + - join_path: revenue + includes: + - arr + - date + + - join_path: customers + includes: + - plan ``` @@ -340,49 +355,6 @@ views: -### `includes` (deprecated) - - - -The top-level `includes` parameter is deprecated and might be removed in -the future. Please always use the `includes` parameter with `cubes` and -`join_path` parameters so you can explicitly control the join path. - - - -The top-level `includes` parameter is used to bulk add measures or dimensions -to a view. - - - -```javascript -view(`active_users`, { - includes: [ - // Measures - users.rolling_count, - - // Dimensions - users.city, - users.created_at, - ], -}); -``` - -```yaml -views: - - name: active_users - - includes: - # Measures - - users.rolling_count - - # Dimensions - - users.city - - users.created_at -``` - - - [ref-recipe-control-access-cubes-views]: /guides/recipes/access-control/controlling-access-to-cubes-and-views From 143ff09df0125f057b3f8d0bfc12f0f951515df4 Mon Sep 17 00:00:00 2001 From: Igor Lukanin Date: Wed, 5 Feb 2025 12:15:50 +0100 Subject: [PATCH 3/5] Revert "Update deprecations" This reverts commit 1f3f6008eae69eda521ec4a06e54fafe7a9947d5. --- DEPRECATION.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPRECATION.md b/DEPRECATION.md index ce0c9187407a0..3c3268d637fd0 100644 --- a/DEPRECATION.md +++ b/DEPRECATION.md @@ -58,7 +58,7 @@ features: | Removed | [Using Redis for in-memory cache and queue](#using-redis-for-in-memory-cache-and-queue) | v0.32.0 | v0.36.0 | | Deprecated | [`SECURITY_CONTEXT`](#security_context) | v0.33.0 | | | Deprecated | [`running_total` measure type](#running_total-measure-type) | v0.33.39 | | -| Removed | [Top-level `includes` parameter in views](#top-level-includes-parameter-in-views) | v0.34.34 | v1.2.0 | +| Deprecated | [Top-level `includes` parameter in views](#top-level-includes-parameter-in-views) | v0.34.34 | | | Removed | [Node.js 16](#nodejs-16) | v0.35.0 | v0.36.0 | | Removed | [MySQL-based SQL API](#mysql-based-sql-api) | v0.35.0 | v0.35.0 | | Removed | [`initApp` hook](#initapp-hook) | v0.35.0 | v0.35.0 | @@ -349,9 +349,9 @@ to calculate running totals instead. ### Top-level `includes` parameter in views -**Removed in release: v1.2.0** +**Deprecated in Release: v0.34.34** -The top-level `includes` parameter has been removed. Instead, always use the +The top-level `includes` parameter is now deprecated. Please always use the `includes` parameter within [`cubes` and `join_path` parameters](https://cube.dev/docs/reference/data-model/view#cubes) so you can explicitly control the join path. From e3e65c58762a9265607193fda35ae16ae2d084f4 Mon Sep 17 00:00:00 2001 From: Igor Lukanin Date: Wed, 5 Feb 2025 12:27:55 +0100 Subject: [PATCH 4/5] Fixes --- .../access-control/controlling-access-to-cubes-and-views.mdx | 4 ++-- .../product/data-modeling/concepts/working-with-joins.mdx | 2 +- docs/pages/reference/data-model/view.mdx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx b/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx index 8f2e716312363..f8b9421af50d6 100644 --- a/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx +++ b/docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx @@ -58,7 +58,7 @@ views: includes: - total_revenue - - join_path: users + - join_path: orders.users includes: - company ``` @@ -93,7 +93,7 @@ view(`total_revenue_per_customer`, { ] }, { - join_path: users, + join_path: orders.users, includes: [ `company` ] diff --git a/docs/pages/product/data-modeling/concepts/working-with-joins.mdx b/docs/pages/product/data-modeling/concepts/working-with-joins.mdx index 10fa141acdb8f..7151671e37afa 100644 --- a/docs/pages/product/data-modeling/concepts/working-with-joins.mdx +++ b/docs/pages/product/data-modeling/concepts/working-with-joins.mdx @@ -756,7 +756,7 @@ views: - total_revenue - created_at - - join_path: orders.customers + - join_path: customers.orders includes: - company ``` diff --git a/docs/pages/reference/data-model/view.mdx b/docs/pages/reference/data-model/view.mdx index a92f7e7548ecb..82472bc5322da 100644 --- a/docs/pages/reference/data-model/view.mdx +++ b/docs/pages/reference/data-model/view.mdx @@ -301,7 +301,7 @@ view(`arr`, { ] }, { - join_path: customers, + join_path: revenue.customers, includes: `plan` } ] @@ -320,7 +320,7 @@ views: - arr - date - - join_path: customers + - join_path: revenue.customers includes: - plan ``` From 748bc631da25084d911fc16b67fb0f5aa356c90f Mon Sep 17 00:00:00 2001 From: Igor Lukanin Date: Wed, 5 Feb 2025 12:29:44 +0100 Subject: [PATCH 5/5] Fix --- .../pages/product/data-modeling/concepts/working-with-joins.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/product/data-modeling/concepts/working-with-joins.mdx b/docs/pages/product/data-modeling/concepts/working-with-joins.mdx index 7151671e37afa..10fa141acdb8f 100644 --- a/docs/pages/product/data-modeling/concepts/working-with-joins.mdx +++ b/docs/pages/product/data-modeling/concepts/working-with-joins.mdx @@ -756,7 +756,7 @@ views: - total_revenue - created_at - - join_path: customers.orders + - join_path: orders.customers includes: - company ```