Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

rm EmbedSVG.ejs and Embed_text.ejs #1047

Merged
merged 1 commit into from
Jan 22, 2019

Conversation

wbamberg
Copy link

Resubmitting #1040:


These macros were used in 1 en-US and 50-odd pages across all locales. Most of the time they made you a helpful table like this:

screen shot 2019-01-16 at 1 46 45 pm

In these cases I just deleted the table. In a few cases the SVG code was actually there, so I just copied it into a static code block.

Now these macros are no longer called by any Wiki pages:
https://developer.mozilla.org/en-US/search?kumascript_macros=Embed_text&locale=*&page=1&topic=none
https://developer.mozilla.org/en-US/search?locale=*&kumascript_macros=EmbedSVG&topic=none

...and they're not called internally by any other macros:
https://github.com/mdn/kumascript/search?utf8=%E2%9C%93&q=Embed_text&type=
https://github.com/mdn/kumascript/search?utf8=%E2%9C%93&q=EmbedSVG&type=

Copy link
Contributor

@jwhitlock jwhitlock left a comment

Choose a reason for hiding this comment

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

Confirmed, not used on any indexed pages. Thanks @wbamberg!

These are the last pages to use the env.files interface. This data was passed as a HTTP header at render time, and resulted in very large headers on pages with lots of files, whether they use the data or not. After a node.js security update, this broke rendering on pages with many attachments (see bug 1520574).

If you need functionality like this in the future, we can add file data to the $json API, or find other ways to get this data.

for(let aFile of env.files) {
if ($0 === aFile.filename) {
found = true;
%><pre class="brush: <%= syntaxe %>"><%= await MDN.getFileContent(aFile) %></pre><%
Copy link
Contributor

@ExE-Boss ExE-Boss Mar 30, 2019

Choose a reason for hiding this comment

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

Fun fact: this would have broken anyway due to a logic error in MDN.getFileContent(…):

kumascript/src/api/mdn.js

Lines 127 to 135 in 4807e01

async getFileContent(fileObjOrUrl) {
var url = fileObjOrUrl.url || fileObjOrUrl;
if (!url) return '';
let base_url = '';
// New file urls include attachment host, so we don't need to
// prepend it
var fUrl = url.parse(url);

See also: #1107 (review)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants