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

ReactCDK: Express Infrastructure Resources using React JSX/TSX #10334

Closed
pfeilbr opened this issue Sep 13, 2020 · 5 comments
Closed

ReactCDK: Express Infrastructure Resources using React JSX/TSX #10334

pfeilbr opened this issue Sep 13, 2020 · 5 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. jsii This issue originates in jsii, or this feature must be implemented in jsii. needs-design This feature request needs additional design work. needs-triage This issue or PR still needs to be triaged.

Comments

@pfeilbr
Copy link
Contributor

pfeilbr commented Sep 13, 2020

Support the expression of cloud infrastructure resources via React JSX / TSX. Cloud solutions are composed of many services. Being able to efficiently and naturally express the composition is a developer ergonomics/DX concern.

Hello ReactCDK app concept gist

  • custom react renderer / reconciler where cloud (cfn) is it's render target getting there via CDK language layer.
  • ReactCDKBaseComponent (class or functional component/hooks friendly)
  • ReactCDKPatternComponent - pre-composed infra for common use cases.
  • leverage React ecosystem adjacencies (e.g. react storybook, etc.)
  • mapping from react concepts of props, state, children, render props to typescript CDK constructors, params, hierarchical nesting (parent), etc.

    a clean mapping needs to be proven as is area for more digging**

  • special cases of lambda function code being webpack + babel + etc being transpiled, bundled, etc. and handed over to CDK provisioning layer.

    this is a bit more involved and also needs research. this is the blending of app code and infra resources it interacts with.
    This is somewhat similar to Meteor, but instead of only mongodb, it's every cfn supported AWS service. Need to not make same mistakes as meteor.

  • step function special cases where the components that make it up are customized for developer ergonomics/dx.
  • wrap these ReactCDK components for Amplify “Backend” library
  • this is additional alternative to amplify add [backend] (e.g. api, auth, etc.)

Use Case

  • Library / framework support is a natural evolution on top of already supported CDK languages.
  • React is familiar to a large group of developers, not scary. It's a generalized tech that allows devs to naturally express composition, which is the core tenet of serverless / serviceful solutions.
  • This eases developers into more advanced AWS usage and therefore enabling them to get more value from the platform.
  • Library/framework support on top of already supported language
    (ts) via jsii

Resources

@pfeilbr pfeilbr added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 13, 2020
@SomayaB SomayaB added the jsii This issue originates in jsii, or this feature must be implemented in jsii. label Sep 14, 2020
@rrrix
Copy link

rrrix commented Sep 18, 2020

React is familiar to a large group of developers, not scary.

This is very debatable. I'm familiar with React and it totally scares me. I saw this issue title and had to click in to read more... because I feel this is just so... scary 😆. If I have to manage my CDK Stack state in Redux I'm going to quit and become a carrot farmer.

I think perhaps instead of JSX/TSX, a more Functional (vs Class based) paradigm would be a bigger hit (and probably ease the transition to React style Components).

Anyways, very curious to see where this goes (for better or for worse)... sub'd 🧐

@pfeilbr
Copy link
Contributor Author

pfeilbr commented Sep 18, 2020

thanks for your feedback @rrrix. very helpful in determining if there would be demand for something like. an idea at this point, and will benefit from more perspectives like yours.

@RomainMuller RomainMuller added the needs-design This feature request needs additional design work. label Sep 22, 2020
@RomainMuller
Copy link
Contributor

As this sounds like a fairly ambitious (and, judging by the epidermic reaction this triggered on @rrrix, possibly contentious) endeavor, I think the right place to start with this feature request would be for 😉 someone 😉 writing an RFC to get the conversation going.

In the very early days of CDK, we had mused with the similarity between the CDK component model and React's; and if memory serves, @eladb had lightly toyed with the idea of a react-style infrastructure modeling approach (this might well be the reason why jsii includes jsx configurations in it's generated tsconfig.json. We however drifted a little further away from this so as you're noting here... more work would be needed to fully introduce this capability.

@RomainMuller RomainMuller added the @aws-cdk/core Related to core CDK functionality label Sep 22, 2020
@pfeilbr
Copy link
Contributor Author

pfeilbr commented Sep 22, 2020

Thanks @RomainMuller for your feedback and guidance. I wasn't aware of the RFC process and agree this scope of change/add belongs there. I will create an RFC.

@pfeilbr pfeilbr closed this as completed Sep 22, 2020
@pfeilbr
Copy link
Contributor Author

pfeilbr commented Sep 27, 2020

RFC created. RFC tracking issue @ aws/aws-cdk-rfcs#256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. jsii This issue originates in jsii, or this feature must be implemented in jsii. needs-design This feature request needs additional design work. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants