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

Bug 1520004: Update Prism to version 1.15 #5189

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Jan 14, 2019

Resolves bug 1520004.

Extracted from #5157.


review?(@escattone, @jwhitlock)

@jwhitlock
Copy link
Contributor

Sorry for the noise. I had to close and open the PR because our TravisCI integration was broken when this was opened.

@ExE-Boss
Copy link
Contributor Author

Why has the flake8 job failed?
https://travis-ci.org/mozilla/kuma/jobs/481110184

@jwhitlock
Copy link
Contributor

TravisCI hasn't been building for a while. A PR with that error was merged to master, and your commit was based on it. We can ignore it or you can rebase on current master to get rid of it.

@ExE-Boss
Copy link
Contributor Author

Let’s ignore it and merge this.

@ExE-Boss ExE-Boss changed the title Bug 1520004: Update Prism to version 1.15 Fix bug 1520004: Update Prism to version 1.15 Jan 17, 2019
@ExE-Boss ExE-Boss changed the title Fix bug 1520004: Update Prism to version 1.15 Bug 1520004: Update Prism to version 1.15 Jan 17, 2019
@ExE-Boss
Copy link
Contributor Author

This has no conflicts with #5182 if that’s what you’re worried about.

@jpmedley
Copy link

@ExE-Boss I appreciate you thinking of me, but I have nothing to contribute here.

@ExE-Boss
Copy link
Contributor Author

I meant to write @jwhitlock

@jwhitlock
Copy link
Contributor

This has no conflicts with #5182 if that’s what you’re worried about.

I wrote a 900 word response, but I think it belongs on Discourse instead of a PR comment.

There is no code conflict, but there are conflicts:

  1. Our review and deployment focus is on the KumaScript refactor, and @escattone an @davidflanagan shouldn't take time or attention away from that.
  2. We're planning on major changes to front-end development (Epic: Move MDN to new front-end framework (Kuma.Next) sprints#766), and @davidflanagan and @schalkneethling are collaborating to make those recommendations. The bias is to delay asset changes until the new pipelines are in place.
  3. It's unclear what the benefit is of updating this library, versus the risk of breaking something. A reviewer will need to investigate what has updated from Prism 1.2 to 1.15, if others have issues with the change, if your changes are complete, etc.
  4. Syntax highlighting is used on many pages on MDN, and the effect of this change will need to be tested against real pages, preferably during the review process. This will either be a lengthy review, or committing to a series of fixes as content issues are found.

I'm assigning @schalkneethling as reviewer, but it is up to him if reviewing this is compatible with his other priorities.

@jwhitlock
Copy link
Contributor

We've shipped the KumaScript refactor, but the other blockers remain. I don't think there is much that can unblock the asset pipeline work, other than not taking time for other reviews.

For the Prism changes, it would be helpful to link to the Prism changelog, if available, and see if there are any warnings for this upgrade path.

For the content changes, it would be helpful to find the URLs of pages that would be affected by this change. Screenshots of the before and after would be super helpful. If there are no visual changes, it would be good to know if that is success (nothing broke!) or evidence that we don't need the update.

@ExE-Boss
Copy link
Contributor Author

Here’s the Prism changelog:
https://github.com/PrismJS/prism/blob/master/CHANGELOG.md

@schalkneethling
Copy link

@ExE-Boss is there a specific feature or improvement to Primsjs that makes you feel like this is a priority for us to update?

Might there be a performance hit if we add support for more programming languages? This touches almost all pages on MDN Web Docs, so I just want to be very cautious when upgrading.

We are pretty far behind, and these are dot releases but, pays to be on the safe side though ;) Let me know your thoughts, thanks!

@ExE-Boss
Copy link
Contributor Author

ExE-Boss commented Jan 29, 2019

The primary reason is that JSON syntax highlighting is now built into Prism, which means that it no longer extends the JavaScript syntax and isn’t as error prone as the current JSON syntax.

As for performance, there shouldn’t be any noticeable difference as the number of Prism language syntax definitions installed on MDN stays the same. In fact, performance should be improved, as there have been a lot of optimisations to the regexes to make them faster.

Also, Prism 1.14 added support for textual WebAssembly, which might be useful to add in a follow‑up.

@ExE-Boss
Copy link
Contributor Author

I’ve now added a section to my Prism issues page on MDN for a comparison of the current JSON syntax definition and the official Prism JSON syntax definition:
https://developer.mozilla.org/en-US/docs/User:ExE-Boss/Prism_issues#MDN_JSON_vs_Prism_JSON_syntax_highlighting

@ExE-Boss
Copy link
Contributor Author

I have now opened bug 1527533 to add the PrismJS syntax definition for the WebAssembly textual representation.

@jwhitlock jwhitlock requested review from jwhitlock and removed request for schalkneethling February 21, 2019 17:16
@jwhitlock jwhitlock self-assigned this Feb 21, 2019
@jwhitlock
Copy link
Contributor

I'm going to prepare this PR for merging today.

* prism 1.2.0 → 1.15: 3 years of updates. Some XSS mitigation (1.6.0),
  drop IE8 support, regex optimization and other syntax updates and
  additions. JSON was added in 1.4.0, so switch from custom
  syntax component to Prism's.

I ran bower-installer to update the prism package as well as the syntax
plugins and CSS
@jwhitlock
Copy link
Contributor

Force-push with more packages updated from bower-installer, plus add a commit comment.

@jwhitlock jwhitlock merged commit c892019 into mdn:master Feb 21, 2019
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.

4 participants