Autoloader: Add plugin support
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Motivation
Autoloader can be used to load languages but not plugins. This is a problem because plugins, like languages, can have dependencies.
Right now, Autoloader is the only officially provided tool that supports CDNs.
Description
Add an API to Autoloader that allows users to load plugins as well. A data-* attribute API should also be supported.
As for the actual functions: I'd like to propose this API:
Prism.plugins.autoloader.loadPlugins(
plugins: string | PluginInfo | (string | PluginInfo)[],
successCallback: () => void,
errorCallbackl: () => void
): void;
interface PluginInfo {
id: string;
/** A record of `data-*` attributes added to the `<script>` tag of the plugin. */
data?: Record<string, string>;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Autoloader documentation linked in the issue and inspecting the existing language-loading API. Determine how plugin dependencies and script data-* attributes should fit the proposed loadPlugins API; the work is done when plugins can be loaded through the API and the data-* attribute interface is supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100