PrismJS / PrismJS/prism

Changing asynchronous highlighting

Open
#3,035 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

core
Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Motivation

We recently had an issue with WebPack and async highlighting. The problem was that our current WebWorker approach assumes that the script file of Prism Core only contains Prism code. This is obviously not the case with WebPack since it tries to bundle dependencies together, so async highlighting caused the worker to crash because the bundle didn't expect to be run in a worker.

It seems like our current async highlighting is incompatible with bundlers.

Async highlighting also has a problem with Autoloader. Since the main Prism instance and the web worker don't share language definitions, the web worker can't do any useful highlighting.

Description

Since we can break some stuff in v2: What do we want to do with async highlighting?

@LeaVerou @mAAdhaTTah @Golmote

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Prism Core’s current async highlighting and WebWorker approach, then compare how Autoloader shares language definitions with the worker under WebPack bundling. The issue is done when a v2 direction is agreed for bundler compatibility and worker language support.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.