{"id":26317,"library":"reveal-compiler-explorer","title":"Reveal Compiler Explorer","description":"A plugin for reveal.js that integrates the Compiler Explorer (godbolt.org) to display live code compilation and assembly output within presentations. Current stable version 1.6.2 (as of 2021-10-22). The package allows presenters to embed editable code snippets that compile with various compilers (GCC, Clang, MSVC) and show assembly, execution results, and optimizations. Key differentiators include tight integration with reveal.js slide decks, support for multiple languages (C, C++, Rust, etc.), and customizable compiler options. Release cadence appears low with sporadic updates. Compared to standalone Compiler Explorer embeds, this plugin provides seamless navigation and keyboard shortcuts within presentations.","status":"active","version":"3.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/dvirtz/reveal-compiler-explorer","tags":["javascript","reveal.js","compiler-explorer","godbolt"],"install":[{"cmd":"npm install reveal-compiler-explorer","lang":"bash","label":"npm"},{"cmd":"yarn add reveal-compiler-explorer","lang":"bash","label":"yarn"},{"cmd":"pnpm add reveal-compiler-explorer","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The plugin requires reveal.js to be loaded as a presentation framework. It hooks into reveal.js's plugin system.","package":"reveal.js","optional":false}],"imports":[{"note":"ESM default export. CommonJS require may work depending on bundler but is not officially supported.","wrong":"const RevealCompilerExplorer = require('reveal-compiler-explorer')","symbol":"RevealCompilerExplorer","correct":"import RevealCompilerExplorer from 'reveal-compiler-explorer'"},{"note":"When using CommonJS, the default export is under .default. The non-default require returns an object with a default property.","wrong":"const RevealCompilerExplorer = require('reveal-compiler-explorer')","symbol":"RevealCompilerExplorer","correct":"const RevealCompilerExplorer = require('reveal-compiler-explorer').default"},{"note":"The package only exports a default export, not a named export. Named import will result in undefined.","wrong":"import { RevealCompilerExplorer } from 'reveal-compiler-explorer'","symbol":"RevealCompilerExplorer","correct":"import RevealCompilerExplorer from 'reveal-compiler-explorer'"}],"quickstart":{"code":"import Reveal from 'reveal.js';\nimport RevealCompilerExplorer from 'reveal-compiler-explorer';\n\nlet deck = new Reveal({\n  plugins: [ RevealCompilerExplorer ],\n  // Optional: configure the plugin\n  revealCompilerExplorer: {\n    defaultCompiler: 'g82',\n    defaultLanguage: 'c++'\n  }\n});\ndeck.initialize();","lang":"javascript","description":"Shows how to import the plugin and add it to a reveal.js instance, with optional configuration."},"warnings":[{"fix":"Upgrade reveal.js to version 4 or later.","message":"The plugin requires reveal.js version 4.x or higher. Using with older reveal.js versions may cause undefined behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use import RevealCompilerExplorer from 'reveal-compiler-explorer' instead of the named import.","message":"In version 1.6.0, the default export changed from a named export to a default export. Previously, you had to import { RevealCompilerExplorer } from 'reveal-compiler-explorer'.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Rename 'compiler' to 'defaultCompiler' in the plugin configuration.","message":"The option 'compiler' has been renamed to 'defaultCompiler' in version 1.5.0. Using 'compiler' still works but logs a deprecation warning.","severity":"deprecated","affected_versions":">=1.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import RevealCompilerExplorer from 'reveal-compiler-explorer'","cause":"Using the named import instead of default import in an ESM environment.","error":"Uncaught TypeError: RevealCompilerExplorer is not a constructor"},{"fix":"Run npm install reveal-compiler-explorer","cause":"Package not installed or not added to dependencies.","error":"Cannot find module 'reveal-compiler-explorer'"},{"fix":"Use const RevealCompilerExplorer = require('reveal-compiler-explorer').default","cause":"Using default import with CommonJS require without accessing .default.","error":"The plugin 'RevealCompilerExplorer' is not a function."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}