Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

move kumascript .json files to content (yari) - #4081

Merged
escattone merged 14 commits into
mdn:mainfrom
peterbe:move-kumascript-json-files-to-content-yari
Aug 23, 2021
Merged

escattone merged 14 commits into
mdn:mainfrom
peterbe:move-kumascript-json-files-to-content-yari

Conversation

@peterbe

@peterbe peterbe commented Jun 23, 2021 •

Copy link
Copy Markdown
Contributor

To test this, you'll need to checkout mdn/content@mdn:main...peterbe:migrate-kumascript-jsondata-to-content-repo too.

Basically, I moved all the kumascript/macros/*.json files that are used to content/files/jsondata/ in the content repo.
That's about it! Then I simply replaced all the JSON.parse(await template("GroupData")) with web.getJSONData("GroupData"), for example, and made sure there were no new MacroExecutionError.

The whole point of this is to move those files over to mdn/content where they belong.

This PR is a draft because it's just a prototype and to make this land we'd need to:

  • Fix all the kumascript unit tests that break now
  • Write a GitHub Action CI workflow, in mdn/content, that runs the kumascript unit tests in Yari
  • Make sure that any open PRs, like this one is merged in and updated
  • Somewhere there's a guide page about editing these pages. That would need updating to change links too.

Bonus! Because the reads of the JSON are memoized in when process.env.NODE_ENV==='production' there's actually going to be a slight performance boost to the total build time. Before we used to read those files, and JSON.parse(), 26,017 times just for en-US alone. Now, it becomes 1 per each .json file once.

@peterbe

peterbe commented Aug 17, 2021

Copy link
Copy Markdown
Contributor Author

This PR is now blocked on #4487 being merged into main.

@escattone
escattone marked this pull request as ready for review August 23, 2021 21:01

@escattone escattone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @peterbe!

@escattone
escattone merged commit 7839698 into mdn:main Aug 23, 2021
astearns added a commit to astearns/content that referenced this pull request Nov 14, 2021
I was looking at how to fix an incorrect spec link, and found some instructions made out-of-date by mdn/yari#4081. 

I have updated this section based on what I think is now the correct workflow with an updated example (based on the most-recent PR I found).
wbamberg added a commit to mdn/content that referenced this pull request Dec 23, 2021
* Update instructions for adding new macros

I was looking at how to fix an incorrect spec link, and found some instructions made out-of-date by mdn/yari#4081. 

I have updated this section based on what I think is now the correct workflow with an updated example (based on the most-recent PR I found).

* lint fixes

* macro/value distinction

* values, not strings

* Perhaps do it this way?

* Update to:  Making a change that depends on external content

* Fix md-lint errors, hopefully

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Will Bamberg <will@bootbonnet.ca>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants