cedar-policy / vscode-cedar

Cedar policy language extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=cedar-policy.vscode-cedar
Apache License 2.0
15 stars 3 forks source link

Support Cedar 3.x #10

Open hakanson opened 5 months ago

hakanson commented 5 months ago

Category

Cedar editing features, Cedar validation features

Describe the feature you'd like to request

Cedar 3.0.0 released on 2023-12-15 and 3.0.1 on 2023-12-21. The CHANGELOG covers new features, such as the is operation as described in RFC 5.

This is a feature request for the main branch and the Visual Studio Marketplace release to align with Cedar 3.0 release. This means that extension installs from inside Visual Studio code will get this version. Most of the features of Cedar are backwards-compatible, but this requires the end-user to avoid newer features. All new IDE integration features will assume Cedar 3.x.

Describe alternatives you've considered

A few alternatives exists for continuing to support both 2.4.x and 3.x:

  1. The Visual Studio Marketplace release is Cedar 3.0 and any person that needs Cedar 2.4.x can either build or download and then "side load" a .vsix version of the extension. While a Cedar 2.4.x release branch would require security updates, new feature development will likely stall.
  2. Use the Visual Studio Marketplace "pre-release" process to leave 2.4.x and primary and 3.x as pre-release. This is a possible short term strategy, but "pre-release" is better served for releasing support of upcoming RFCs not yet include in Cedar 3.x.
  3. Support both 2.4.x and 3.x in the same extension using a mechanism like project configuration to select which language version. This will likely double the size of the binary distribution and source code. The most recent vscode-cedar-0.6.0.vsix is 997k, so doubling it to 2M is not too concerning. Most of the size comes from compiling Rust code to WebAssembly, so this option requires a .wasm package for each version, and "if checks" in the TypeScript source to use the corresponding version. Supporting this logic may be time consuming, and similar concern that new feature development will stall.

Additional context

The feat/hakanson/cedar-3.0.1 branch is a work-in-progress for Cedar 3.0 support.

Looking for community discussion on this issue to determine the best alternative.

Is this something that you'd be interested in working on?

hakanson commented 4 months ago

Created prerelease branch with Cedar 3.0.1 support and published as "v0.7.1 (pre-release)" in Visual Studio Marketplace

chrnorm commented 2 months ago

+1 on the Visual Studio Marketplace supporting 3.x by default. Our product uses 3.x and our development docs are more complicated because we require switching to the prerelease:

Install the extension by clicking the Install button on the VS Code marketplace listing.

Common Fate uses Cedar v3. Currently, Cedar v3 is supported in the pre-release version of the Cedar extension.

After you’ve installed the extension, change to the pre-release version by navigating to the Extensions sidebar then choosing Cedar from the list of installed extensions. Click the Switch to Pre-Release Version button.