rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Add RecordProperty AST type

Open JLHwung opened this issue 5 years ago • 2 comments

View Rendered Text

This PR proposes a new node type RecordProperty which shares the same interface with ObjectProperty. This type is only valid in RecordExpression.

The new node type also paves the way for proper AST support on the stage-1 Deep Path Properties in Record Literals.

cc @rickbutton

JLHwung avatar Jun 09 '20 21:06 JLHwung

My only concern is that the deep path properties proposal is also investigating usage with objects, although the proposal explainer hasn't been updated to reflect that. There was significant support for usage with objects in TC39, so splitting out a RecordProperty might not prove useful if ObjectProperty needs to support the additional syntax as well.

Deep Path Properties is also very early, and the syntax has a decent chance of changing. I would be hesitant to recommend additional work on your side with the expectation that deep path properties lands as designed.

rickbutton avatar Jun 09 '20 21:06 rickbutton

Given that it has not been decided whether DPP (Deep Path Properties) should be supported for object, I am good with holding off this proposal and delaying parser support on DPP.

I will leave this proposal open for community feedbacks. However, if decision is not made in the next 6 months, this proposal should be closed with respect to the RFC process.

Related: https://github.com/tc39/proposal-deep-path-properties-for-record/issues/11

JLHwung avatar Jun 10 '20 12:06 JLHwung