Currently, /init.js loads /embed as a full HTML document, then manually pulls the stylesheet and scripts out of it and into the user's page.
Instead, we should provide /carnival.css and /carnival.js directly.
The benefits are:
A simpler, more easily understood mechanism (a lot less code all around)
Users concerned with stability or performance can easily download the CSS/JS directly and self-host
We juggle two Carnival objects right now (the one in /init.js and the one in /embed) and still support a CarnivalOptions global, we could reduce that to one, simpler object with usage like new Carnival({ ... }).load()
This doesn't have to block product launch, but doing it later would require a deprecation cycle on the /init.js approach.
Currently,
/init.js
loads/embed
as a full HTML document, then manually pulls the stylesheet and scripts out of it and into the user's page.Instead, we should provide
/carnival.css
and/carnival.js
directly.The benefits are:
Carnival
objects right now (the one in/init.js
and the one in/embed
) and still support aCarnivalOptions
global, we could reduce that to one, simpler object with usage likenew Carnival({ ... }).load()
This doesn't have to block product launch, but doing it later would require a deprecation cycle on the
/init.js
approach.