Public
Edited
Apr 24, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bundled = bundle(uuidUrl)
Insert cell
Insert cell
uuidCode = bundled.code
Insert cell
uuid = eval(uuidCode)
Insert cell
uuid.v4()
Insert cell
Insert cell
workerCode = `
addEventListener("fetch", event => {
event.respondWith(new Response(uuid.v4()))
})

const uuid = ${uuidCode}
`
Insert cell
Insert cell
async function bundle(url) {
const warnings = [];
const rollupConfig = {
input: url,
plugins: [rollup_plugin_fetchUrl()],
onwarn(warning) {
warnings.push(warning);
},
output: {
format: "iife"
}
};

const bundle = await rollup(rollupConfig);
const generated = await bundle.generate(rollupConfig.output);
await bundle.close();

return { warnings, code: generated.output[0].code, ...generated };
}
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more