Skip to content

Simplify and modernize Docsify #2104

Closed
Closed
@trusktr

Description

@trusktr

We have some baggage,

  • support for CommonJS build from ES Modules, and code that is CommonJS
  • old code to support ancient browsers like IE 11, which is dead
  • experimental and incomplete SSR that no one has had been interested in or had time for finishing, and some of us believe there is a better way forward
  • old .styl syntax for our CSS. CSS has lots of new language features, including CSS Nesting which is out in all browser (Firefox with a flag), container queries, etc.

I propose:

v5

(Any chained pull requests are in the same order as in this list)

Future release if not v5

Non breaking changes:

Potentially Breaking changes:

  • We have both /index.html and docs/index.html. Do we need duplicate code? Delete one.
  • Update dependencies so that we can delete CommonJS from Rollup config
  • Delete Stylus, write vanilla CSS (using postcss for now only until CSS Nesting lands in Firefox). These changes should be backwards compatible for docsify-themeable. Someone with a build system might consume these files, so major version bump.
  • Convert DOM creation/manipulation parts to Solid.js. We'll replace the first attempt at convert DOM creation/manipuation code to concise Solid JSX #1716 with a new one. Someone with a build might need an update, so major bump. Most people will be unaffected.
    • Solid has several features including reactivity primitives, a component system, and DOM templating. For this task, we will use Solid's component system and templating to encapsulate the DOM parts of Docsify, and output the DOM in a nicer way that will set us up for a better SSR and SSG future.
    • f.e.
      const div = <div>Some <span>{content}</span></div> // returns an HTMLDivElement.
  • Possibly convert to TypeScript? Have the best intellisense and self-documented code! (Eventually I need to convert to a strict type-safe subset of TypeScript to compile it to WebAssembly). Someone building source may break, so major bump.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions