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

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

Merged
merged 14 commits into from
Aug 23, 2021

Conversation

peterbe
Copy link
Contributor

@peterbe peterbe commented Jun 23, 2021

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
Copy link
Contributor Author

peterbe commented Aug 17, 2021

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
Copy link
Contributor

@escattone escattone left a comment

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants