Browsers have improved a lot over the past years and it is now possible to do web development without requiring any build tools. That’s what I do by serving es modules with es-dev-server on my dev environment, buildless! Here is a nice article introducing the benefits:
Recently, I was comparing solutions for creating/integrating a rich text editor and Prose Mirror (PM) looks really interesting. Unfortunately, PM published NPM packages do not work buildless with modern web apps.
I am not the first to raise a similar need:
Going buildless, especially in dev environments is more and more frequent and the trend is not going to decrease with all major browsers supporting ES modules natively.
In order to assess what changes are required to make PM work buildless, I made a Proof of Concept locally for the basic example. As a result, the changes that are required are quite minor and are non-breaking! but they involve multiple packages.
Briefly speaking, it requires adding the non-standard but commonly accepted “module” field to all PM package.json packages. All dependencies must also provide an ES6 version of the code (no problems since the source code is already packaged). Besides, PM has only a few external dependencies (and most are managed by @marijnh), it is easily feasible. From what I experienced there are only 4 external dependencies for the basic example:
prosemirror-history -> rope-sequence
prosemirror-keymap -> w3c-keyname
prosemirror-menu -> crel
prosemirror-model -> ordered-map
Once these are updated to provide an ES6 version of the code (I adapted them locally), then all is working, buildless!
My question is twofold: are there other people who would benefit from such an improvement? @marijn (Marijn Haverbeke), would you accept the required changes after review if I contribute the PRs?
PS: the module field looks like a simple, transition solution to a better solution that was introduced in NodeJS 12 and still experimental in NodeJS 13: https://nodejs.org/api/esm.html#esm_ecmascript_modules