Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing workspace and code #51

Open
wants to merge 224 commits into
base: staging
Choose a base branch
from

Conversation

ashwinKumar0505
Copy link

No description provided.

@ashwinKumar0505 ashwinKumar0505 force-pushed the syncing-workspace-and-code branch 2 times, most recently from c93a71a to 8e35af1 Compare December 14, 2020 16:57
ashwinKumar0505 and others added 24 commits February 3, 2021 22:28
…componets-structure

Building meta components from its default code
@sanandnarayan sanandnarayan self-assigned this Feb 20, 2021
Copy link
Member

@sanandnarayan sanandnarayan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would recomend rambda, instead of lodash

this.plugin = declare(() => {
return {
visitor: {
ArrowFunctionExpression: (path: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the component is not a arrow function but rather a normal es5 function?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thik you can use the alias Function

}
if (childrenProp) {
dispatch.components.unexpose('children')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clickhandler is doing way too many things. and logic which needs a seperate reducer itself.

And every time a key is pressed this handler is being redefined

if (visitedComponentName === componentName) {
const attribute = toJsxAttribute('isContainerComponent', 'true')

openingElement.attributes.push(attribute)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we pushing this attribute?


const index = openingElement.attributes.findIndex(
(attribute: any) => attribute.name.name === 'isCustomComponent',
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better way to remove an attribute is to use .filter and filter it out.

import useDispatch from '../../../hooks/useDispatch'
import UnExposePropButton from '../../actionButtons/UnExposePropButton'
import CustomPropDeletionButton from '../../actionButtons/CustomPropDeletionButton'
import { checkIsCustomPage } from '../../../core/selectors/page'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic in this component is way more than what a FormControl component needs to do.

For example: this component acts differently if the form control is representing the props of a Custom Component, or the props a child components of a custom component which are exposed.

Ideally this should have been two different components itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants