Skip to content

Conversation

Methuselah96
Copy link
Collaborator

@Methuselah96 Methuselah96 commented Dec 2, 2023

Main code changes

  • Converts to monorepo, mainly so demos can use the master version of jsondiffpatch instead of using a URL. New directory structure is:
    • packages/jsondiffpatch
    • demos/console-demo
    • demos/html-demo
    • demos/numeric-plugin-demo
  • Revamp build system
    • Remove bundling with Rollup in favor of just transpiling the modules using TypeScript
    • Switch to ESM-only. The ecosystem has enough ESM-only packages, that consumers should know how to deal with it at this point.
    • Add "exports" field to "package.json"
  • Use esbuild to bundle code for html-demo
  • Remove formatter exports from main entry-point. This allows using jsondiffpatch without depending on DOM types from the HTML formatter, and excludes importing chalk by default (fixes compile errors when not including dom types #323).

Breaking changes for consumers

  • ESM-only
  • No default export. Import using import * as jsondiffpatch from 'jsondiffpatch or import individual methods.
  • Formatters must be imported from subpaths:
    • import * as annotatedFormatter from 'jsondiffpatch/formatters/annotated';
    • import * as baseFormatter from 'jsondiffpatch/formatters/base';
    • import * as consoleFormatter from 'jsondiffpatch/formatters/console';
    • import * as htmlFormatter from 'jsondiffpatch/formatters/html';
    • import * as jsonpatchFormatter from 'jsondiffpatch/formatters/jsonpatch';
  • Updated CSS imports:
    • import 'jsondiffpatch/formatters/styles/html.css';
    • import 'jsondiffpatch/formatters/styles/annotated.css';
  • Supported Node versions: ^18.0.0 || >=20.0.0

Remaining work before next release

  • Disable text diffing by default to reduce bundle size

@Methuselah96 Methuselah96 changed the title Convert to monorepo, convert demos to TypeScript, and revamp build system Convert to monorepo and revamp build system Dec 2, 2023
@Methuselah96 Methuselah96 marked this pull request as ready for review December 2, 2023 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compile errors when not including dom types

2 participants