PromucFlow_constructor/app/client/src/utils/metaWidgetState.ts

1003 lines
25 KiB
TypeScript
Raw Normal View History

import { getAssetUrl } from "ee/utils/airgapHelpers";
import { ASSETS_CDN_URL } from "constants/ThirdPartyConstants";
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type { MetaWidgetsReduxState } from "reducers/entityReducers/metaWidgetsReducer";
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
export const metaWidgetState: MetaWidgetsReduxState = {
baowuczcgg: {
isVisible: true,
parentColumnSpace: 1,
parentRowSpace: 1,
defaultImage: getAssetUrl(`${ASSETS_CDN_URL}/widgets/default.png`),
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
imageShape: "RECTANGLE",
maxZoomLevel: 1,
enableRotation: false,
enableDownload: false,
objectFit: "cover",
image: "{{((currentItem) => currentItem.img)(Image1.currentItem)}}",
widgetName: "Image1",
version: 1,
animateLoading: true,
type: "IMAGE_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Image",
key: "zqar6ryg82",
iconSVG: "/static/media/icon.52d8fb963abcb95c79b10f1553389f22.svg",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "image",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "baowuczcgg",
renderMode: "CANVAS",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 0,
rightColumn: 16,
topRow: 0,
bottomRow: 8,
parentId: "xbbs7cls18",
currentItem: "{{List1.listData[Image1.currentIndex]}}",
currentView: "{{{}}}",
currentIndex: 0,
children: [],
referencedWidgetId: "baowuczcgg",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
xy20z9gxsc: {
isVisible: true,
parentColumnSpace: 1,
parentRowSpace: 1,
text: "{{((currentItem) => currentItem.name)(Text1.currentItem)}}",
fontSize: "1rem",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "Text1",
shouldTruncate: false,
overflow: "NONE",
version: 1,
animateLoading: true,
searchTags: ["typography", "paragraph", "label"],
type: "TEXT_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Text",
key: "eezvtpz4sw",
iconSVG: "/static/media/icon.97c59b523e6f70ba6f40a10fc2c7c5b5.svg",
textStyle: "HEADING",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "text",
},
{
key: "fontFamily",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "xy20z9gxsc",
renderMode: "CANVAS",
fontFamily: "{{appsmith.theme.fontFamily.appFont}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 16,
rightColumn: 28,
topRow: 0,
bottomRow: 4,
parentId: "xbbs7cls18",
currentItem: "{{List1.listData[Text1.currentIndex]}}",
currentView: "{{{}}}",
currentIndex: 0,
children: [],
referencedWidgetId: "xy20z9gxsc",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
tsdy8whhl1: {
isVisible: true,
parentColumnSpace: 1,
parentRowSpace: 1,
text: "{{((currentItem) => currentItem.id)(Text2.currentItem)}}",
fontSize: "1rem",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "Text2",
shouldTruncate: false,
overflow: "NONE",
version: 1,
animateLoading: true,
searchTags: ["typography", "paragraph", "label"],
type: "TEXT_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Text",
key: "eezvtpz4sw",
iconSVG: "/static/media/icon.97c59b523e6f70ba6f40a10fc2c7c5b5.svg",
textStyle: "BODY",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "text",
},
{
key: "fontFamily",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "tsdy8whhl1",
renderMode: "CANVAS",
fontFamily: "{{appsmith.theme.fontFamily.appFont}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 16,
rightColumn: 24,
topRow: 4,
bottomRow: 8,
parentId: "xbbs7cls18",
currentItem: "{{List1.listData[Text2.currentIndex]}}",
currentView: "{{{}}}",
currentIndex: 0,
children: [],
referencedWidgetId: "tsdy8whhl1",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
xbbs7cls18: {
isVisible: true,
widgetName: "Canvas2",
version: 1,
detachFromLayout: true,
type: "CANVAS_WIDGET",
hideCard: true,
isDeprecated: false,
displayName: "Canvas",
key: "rhrv9ccmof",
containerStyle: "none",
canExtend: false,
children: ["baowuczcgg", "xy20z9gxsc", "tsdy8whhl1"],
minHeight: 1,
widgetId: "xbbs7cls18",
renderMode: "CANVAS",
boxShadow: "none",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
accentColor: "{{appsmith.theme.colors.primaryColor}}",
isLoading: false,
parentColumnSpace: 1,
parentRowSpace: 1,
leftColumn: 0,
rightColumn: 1,
topRow: 0,
bottomRow: 1,
parentId: "e3bqqc9oid",
dynamicBindingPathList: [
{
key: "borderRadius",
},
{
key: "accentColor",
},
{
key: "currentView",
},
],
currentView: "{{{}}}",
currentIndex: 0,
referencedWidgetId: "xbbs7cls18",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
e3bqqc9oid: {
isVisible: true,
parentColumnSpace: 1,
parentRowSpace: 1,
backgroundColor: "white",
widgetName: "Container1",
containerStyle: "card",
borderColor: "#E0DEDE",
borderWidth: "1",
boxShadow: "{{appsmith.theme.boxShadow.appBoxShadow}}",
animateLoading: true,
children: ["xbbs7cls18"],
version: 1,
searchTags: ["div", "parent", "group"],
type: "CONTAINER_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Container",
key: "b33ov8lfex",
iconSVG: "/static/media/icon.1977dca3370505e2db3a8e44cfd54907.svg",
isCanvas: true,
dragDisabled: true,
isDeletable: false,
disallowCopy: true,
disablePropertyPane: true,
openParentPropertyPane: true,
widgetId: "e3bqqc9oid",
renderMode: "CANVAS",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 0,
rightColumn: 64,
topRow: 0,
bottomRow: 12,
parentId: "8ari8fii6k",
dynamicBindingPathList: [
{
key: "borderRadius",
},
{
key: "boxShadow",
},
{
key: "data",
},
],
gap: 0,
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
data: "{{\n {\n \n Image1: { image: Image1.image,isVisible: Image1.isVisible }\n ,\n Text1: { isVisible: Text1.isVisible,text: Text1.text }\n ,\n Text2: { isVisible: Text2.isVisible,text: Text2.text }\n \n }\n }}",
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
currentIndex: 0,
referencedWidgetId: "e3bqqc9oid",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
u2jvh7h1f1: {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
defaultImage: getAssetUrl(`${ASSETS_CDN_URL}/widgets/default.png`),
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
imageShape: "RECTANGLE",
maxZoomLevel: 1,
enableRotation: false,
enableDownload: false,
objectFit: "cover",
image:
"{{((currentItem) => currentItem.img)(List1_Image1_u2jvh7h1f1.currentItem)}}",
widgetName: "List1_Image1_u2jvh7h1f1",
version: 1,
animateLoading: true,
type: "IMAGE_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Image",
key: "zqar6ryg82",
iconSVG: "/static/media/icon.52d8fb963abcb95c79b10f1553389f22.svg",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "image",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "u2jvh7h1f1",
renderMode: "CANVAS",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 0,
rightColumn: 16,
topRow: 0,
bottomRow: 8,
parentId: "ze1bnh8dpw",
currentItem: "{{List1.listData[List1_Image1_u2jvh7h1f1.currentIndex]}}",
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 1,
children: [],
referencedWidgetId: "baowuczcgg",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
pawh54e2lk: {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
text: "{{((currentItem) => currentItem.name)(List1_Text1_pawh54e2lk.currentItem)}}",
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
fontSize: "1rem",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "List1_Text1_pawh54e2lk",
shouldTruncate: false,
overflow: "NONE",
version: 1,
animateLoading: true,
searchTags: ["typography", "paragraph", "label"],
type: "TEXT_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Text",
key: "eezvtpz4sw",
iconSVG: "/static/media/icon.97c59b523e6f70ba6f40a10fc2c7c5b5.svg",
textStyle: "HEADING",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "text",
},
{
key: "fontFamily",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "pawh54e2lk",
renderMode: "CANVAS",
fontFamily: "{{appsmith.theme.fontFamily.appFont}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 16,
rightColumn: 28,
topRow: 0,
bottomRow: 4,
parentId: "ze1bnh8dpw",
currentItem: "{{List1.listData[List1_Text1_pawh54e2lk.currentIndex]}}",
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 1,
children: [],
referencedWidgetId: "xy20z9gxsc",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
o6yxt84kj5: {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
text: "{{((currentItem) => currentItem.id)(List1_Text2_o6yxt84kj5.currentItem)}}",
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
fontSize: "1rem",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "List1_Text2_o6yxt84kj5",
shouldTruncate: false,
overflow: "NONE",
version: 1,
animateLoading: true,
searchTags: ["typography", "paragraph", "label"],
type: "TEXT_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Text",
key: "eezvtpz4sw",
iconSVG: "/static/media/icon.97c59b523e6f70ba6f40a10fc2c7c5b5.svg",
textStyle: "BODY",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "text",
},
{
key: "fontFamily",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "o6yxt84kj5",
renderMode: "CANVAS",
fontFamily: "{{appsmith.theme.fontFamily.appFont}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 16,
rightColumn: 24,
topRow: 4,
bottomRow: 8,
parentId: "ze1bnh8dpw",
currentItem: "{{List1.listData[List1_Text2_o6yxt84kj5.currentIndex]}}",
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 1,
children: [],
referencedWidgetId: "tsdy8whhl1",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
ze1bnh8dpw: {
isVisible: true,
widgetName: "List1_Canvas2_ze1bnh8dpw",
version: 1,
detachFromLayout: true,
type: "CANVAS_WIDGET",
hideCard: true,
isDeprecated: false,
displayName: "Canvas",
key: "rhrv9ccmof",
containerStyle: "none",
canExtend: false,
children: ["u2jvh7h1f1", "pawh54e2lk", "o6yxt84kj5"],
minHeight: 1,
widgetId: "ze1bnh8dpw",
renderMode: "CANVAS",
boxShadow: "none",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
accentColor: "{{appsmith.theme.colors.primaryColor}}",
isLoading: false,
parentColumnSpace: 1,
parentRowSpace: 1,
leftColumn: 0,
rightColumn: 1,
topRow: 0,
bottomRow: 1,
parentId: "4b5r4c3kp7",
dynamicBindingPathList: [
{
key: "borderRadius",
},
{
key: "accentColor",
},
{
key: "currentView",
},
],
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 1,
referencedWidgetId: "xbbs7cls18",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
"4b5r4c3kp7": {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
backgroundColor: "white",
widgetName: "List1_Container1_4b5r4c3kp7",
containerStyle: "card",
borderColor: "#E0DEDE",
borderWidth: "1",
boxShadow: "{{appsmith.theme.boxShadow.appBoxShadow}}",
animateLoading: true,
children: ["ze1bnh8dpw"],
version: 1,
searchTags: ["div", "parent", "group"],
type: "CONTAINER_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Container",
key: "b33ov8lfex",
iconSVG: "/static/media/icon.1977dca3370505e2db3a8e44cfd54907.svg",
isCanvas: true,
dragDisabled: true,
isDeletable: false,
disallowCopy: true,
disablePropertyPane: true,
openParentPropertyPane: true,
widgetId: "4b5r4c3kp7",
renderMode: "CANVAS",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 0,
rightColumn: 64,
topRow: 12,
bottomRow: 24,
parentId: "8ari8fii6k",
dynamicBindingPathList: [
{
key: "borderRadius",
},
{
key: "boxShadow",
},
{
key: "data",
},
],
gap: 0,
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
data: "{{\n {\n \n Image1: { image: List1_Image1_u2jvh7h1f1.image,isVisible: List1_Image1_u2jvh7h1f1.isVisible }\n ,\n Text1: { isVisible: List1_Text1_pawh54e2lk.isVisible,text: List1_Text1_pawh54e2lk.text }\n ,\n Text2: { isVisible: List1_Text2_o6yxt84kj5.isVisible,text: List1_Text2_o6yxt84kj5.text }\n \n }\n }}",
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
resizeDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 1,
referencedWidgetId: "e3bqqc9oid",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
"8ari8fii6k": {
parentRowSpace: 1,
isVisible: true,
widgetName: "Canvas1",
version: 1,
detachFromLayout: true,
type: "CANVAS_WIDGET",
hideCard: true,
isDeprecated: false,
displayName: "Canvas",
key: "rhrv9ccmof",
containerStyle: "none",
dropDisabled: true,
openParentPropertyPane: true,
noPad: true,
children: ["e3bqqc9oid", "4b5r4c3kp7", "3g3bxw6q2z"],
minHeight: 400,
widgetId: "8ari8fii6k",
renderMode: "CANVAS",
boxShadow: "none",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
accentColor: "{{appsmith.theme.colors.primaryColor}}",
isLoading: false,
parentColumnSpace: 1,
leftColumn: 0,
rightColumn: 505.5,
topRow: 0,
bottomRow: 400,
parentId: "hwgin979n4",
dynamicBindingPathList: [
{
key: "borderRadius",
},
{
key: "accentColor",
},
],
isMetaWidget: true,
creatorId: "hwgin979n4",
},
"3vmg2xwodp": {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
defaultImage: getAssetUrl(`${ASSETS_CDN_URL}/widgets/default.png`),
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
imageShape: "RECTANGLE",
maxZoomLevel: 1,
enableRotation: false,
enableDownload: false,
objectFit: "cover",
image:
"{{((currentItem) => currentItem.img)(List1_Image1_3vmg2xwodp.currentItem)}}",
widgetName: "List1_Image1_3vmg2xwodp",
version: 1,
animateLoading: true,
type: "IMAGE_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Image",
key: "zqar6ryg82",
iconSVG: "/static/media/icon.52d8fb963abcb95c79b10f1553389f22.svg",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "image",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "3vmg2xwodp",
renderMode: "CANVAS",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 0,
rightColumn: 16,
topRow: 0,
bottomRow: 8,
parentId: "gb0vgfvp68",
currentItem: "{{List1.listData[List1_Image1_3vmg2xwodp.currentIndex]}}",
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 2,
children: [],
referencedWidgetId: "baowuczcgg",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
squbljzvqv: {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
text: "{{((currentItem) => currentItem.name)(List1_Text1_squbljzvqv.currentItem)}}",
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
fontSize: "1rem",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "List1_Text1_squbljzvqv",
shouldTruncate: false,
overflow: "NONE",
version: 1,
animateLoading: true,
searchTags: ["typography", "paragraph", "label"],
type: "TEXT_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Text",
key: "eezvtpz4sw",
iconSVG: "/static/media/icon.97c59b523e6f70ba6f40a10fc2c7c5b5.svg",
textStyle: "HEADING",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "text",
},
{
key: "fontFamily",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "squbljzvqv",
renderMode: "CANVAS",
fontFamily: "{{appsmith.theme.fontFamily.appFont}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 16,
rightColumn: 28,
topRow: 0,
bottomRow: 4,
parentId: "gb0vgfvp68",
currentItem: "{{List1.listData[List1_Text1_squbljzvqv.currentIndex]}}",
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 2,
children: [],
referencedWidgetId: "xy20z9gxsc",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
zoq1nw5wke: {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
text: "{{((currentItem) => currentItem.id)(List1_Text2_zoq1nw5wke.currentItem)}}",
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
fontSize: "1rem",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "List1_Text2_zoq1nw5wke",
shouldTruncate: false,
overflow: "NONE",
version: 1,
animateLoading: true,
searchTags: ["typography", "paragraph", "label"],
type: "TEXT_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Text",
key: "eezvtpz4sw",
iconSVG: "/static/media/icon.97c59b523e6f70ba6f40a10fc2c7c5b5.svg",
textStyle: "BODY",
boxShadow: "none",
dynamicBindingPathList: [
{
key: "text",
},
{
key: "fontFamily",
},
{
key: "borderRadius",
},
{
key: "currentItem",
},
{
key: "currentView",
},
],
dynamicTriggerPathList: [],
widgetId: "zoq1nw5wke",
renderMode: "CANVAS",
fontFamily: "{{appsmith.theme.fontFamily.appFont}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 16,
rightColumn: 24,
topRow: 4,
bottomRow: 8,
parentId: "gb0vgfvp68",
currentItem: "{{List1.listData[List1_Text2_zoq1nw5wke.currentIndex]}}",
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 2,
children: [],
referencedWidgetId: "tsdy8whhl1",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
gb0vgfvp68: {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
widgetName: "List1_Canvas2_gb0vgfvp68",
version: 1,
detachFromLayout: true,
type: "CANVAS_WIDGET",
hideCard: true,
isDeprecated: false,
displayName: "Canvas",
key: "rhrv9ccmof",
containerStyle: "none",
canExtend: false,
children: ["3vmg2xwodp", "squbljzvqv", "zoq1nw5wke"],
minHeight: 1,
widgetId: "gb0vgfvp68",
renderMode: "CANVAS",
boxShadow: "none",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
accentColor: "{{appsmith.theme.colors.primaryColor}}",
isLoading: false,
leftColumn: 0,
rightColumn: 1,
topRow: 0,
bottomRow: 1,
parentId: "3g3bxw6q2z",
dynamicBindingPathList: [
{
key: "borderRadius",
},
{
key: "accentColor",
},
{
key: "currentView",
},
],
currentView: "{{{}}}",
resizeDisabled: true,
disablePropertyPane: true,
dragDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 2,
referencedWidgetId: "xbbs7cls18",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
"3g3bxw6q2z": {
parentColumnSpace: 1,
parentRowSpace: 1,
isVisible: true,
backgroundColor: "white",
widgetName: "List1_Container1_3g3bxw6q2z",
containerStyle: "card",
borderColor: "#E0DEDE",
borderWidth: "1",
boxShadow: "{{appsmith.theme.boxShadow.appBoxShadow}}",
animateLoading: true,
children: ["gb0vgfvp68"],
version: 1,
searchTags: ["div", "parent", "group"],
type: "CONTAINER_WIDGET",
hideCard: false,
isDeprecated: false,
displayName: "Container",
key: "b33ov8lfex",
iconSVG: "/static/media/icon.1977dca3370505e2db3a8e44cfd54907.svg",
isCanvas: true,
dragDisabled: true,
isDeletable: false,
disallowCopy: true,
disablePropertyPane: true,
openParentPropertyPane: true,
widgetId: "3g3bxw6q2z",
renderMode: "CANVAS",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
isLoading: false,
leftColumn: 0,
rightColumn: 64,
topRow: 24,
bottomRow: 36,
parentId: "8ari8fii6k",
dynamicBindingPathList: [
{
key: "borderRadius",
},
{
key: "boxShadow",
},
{
key: "data",
},
],
gap: 0,
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
data: "{{\n {\n \n Image1: { image: List1_Image1_3vmg2xwodp.image,isVisible: List1_Image1_3vmg2xwodp.isVisible }\n ,\n Text1: { isVisible: List1_Text1_squbljzvqv.isVisible,text: List1_Text1_squbljzvqv.text }\n ,\n Text2: { isVisible: List1_Text2_zoq1nw5wke.isVisible,text: List1_Text2_zoq1nw5wke.text }\n \n }\n }}",
feat: List V2 (#15839) ## Description TL;DR This is a complete architectural change of of List widget works to support all widgets we currently have and should automatically support any future widgets. It also introduces nested List widgets i.e a list widget can have a another list widget which in turn can have another list widget. Fixes #18206 Fixes #6775 Fixes #13211 Fixes #16582 Fixes #11739 Fixes #15094 Fixes #6840 Fixes #10841 Fixes #17386 Fixes #18340 Fixes #16898 Fixes #17555 Fixes #6858 Fixes #9568 Fixes #17480 Fixes #18523 Fixes #18206 Fixes #16586 Fixes #18106 Fixes #16576 Fixes #14697 Fixes #9607 Fixes #19648 Fixes #19739 Fixes #19652 Fixes #18730 Fixes #19503 Fixes #19498 Fixes #19437 Fixes #5245 Fixes #19150 Fixes #18638 Fixes #11332 Fixes #17901 Fixes #19043 Fixes #17777 Fixes #8237 Fixes #15487 Fixes #15988 Fixes #18621 Fixes #16788 Fixes #18110 Fixes #18382 Fixes #17427 Fixes #18105 Fixes #18287 Fixes #19808 Fixes #14655 ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Cypress - Jest - Manual ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --------- Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
2023-02-14 16:07:31 +00:00
resizeDisabled: true,
dropDisabled: true,
ignoreCollision: true,
disabledResizeHandles: [
"left",
"top",
"right",
"bottomRight",
"topLeft",
"topRight",
"bottomLeft",
],
currentIndex: 2,
referencedWidgetId: "e3bqqc9oid",
isMetaWidget: true,
creatorId: "hwgin979n4",
},
};