🔨 bake chart view map / TAS-829 #4479
Open
+42
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bakes http://staging-site-bake-chart-views/grapher/_chartViews.json that maps chart view names to chart config IDs.
The Figma plugin uses this information for autocompletion and to fetch a chart view via UUID.
Ideally, we don't trigger a full rebuild when a chart view is created or deleted. I imagine authors creating a chart view going directly to Figma to try to import it, so there shouldn't be a too-long lag.
We wouldn't need to bake if we exposed the map on the Admin API instead, but Mojmir said auth is tricky. I wonder if we could add another auth method to our admin that would make that easier? But I don't think it's a good use of my time to think about admin auth at the beginning of the cycle, so I want to go with this for now. It would be easy to revert these changes if I reconsider during the cycle.
The map is baked to
/grapher/_chartViews.json
. I named it similarly to/grapher/_grapherRedirects.json
, but I'm happy to rename it if the name I chose is awkward.