Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Fully offline export #443

Open
2 tasks done
aehlke opened this issue Sep 25, 2023 · 1 comment
Open
2 tasks done

Feature: Fully offline export #443

aehlke opened this issue Sep 25, 2023 · 1 comment

Comments

@aehlke
Copy link

aehlke commented Sep 25, 2023

Type of feature

✨ Feature

Current behavior

No response

Suggested feature

When building for example html and JS and then exporting it, ideally (especially for headless mode in CI-like use) there'd be a way to also get an output with all dependencies bundled into the one HTML file or perhaps the file plus the external modules copied locally. This would also simplify the prefix: import map complexity when integrating this output into other projects or deployments/automation, by being able to "vendor" the full deployment rather than inherit the complexity of pulling modules in from various 3rd party CDNs.

One use case is to have github files that are available locally. JSDelivr is good for deployment, but for dev steps, it forces a long cache unless you contact them, unless you update URLs with specific hashes of files as you update them... there's no default way to just use "latest" / @main for repos. So it could be easier for some users to export html + dependencies as a directory to rehost, or optionally one big html file with dependencies baked-in. It could also be useful to switch back to JSDelivr for prod deployments, and local paths / local github repos during dev (which can be loaded in via parent contexts using the SDK also...) Thanks

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs
@hatemhosny
Copy link
Collaborator

hi @aehlke

so there are different points here:

In case you need to use (frequently updated) scripts that you push to GitHub, and want to get the latest version, push to a gh-pages branch. This triggers deploy to GitHub pages, and you can import from there. The deploy feature in LiveCodes works that way.

If you want to get it from a CDN with shorter cache, may be try https://statically.io/

Cache Control

All files will be cached on the CDN for 1 year, except for these listed branch that are cached for only 1 day:

main
master
dev
develop
gh-pages

from: https://statically.io/docs/using-staticzap/

Exporting a full bundle for dependencies is not a straight forward feature. It is not currently in the scope of LiveCodes.
Having said that, rollup and esbuild can run in the browser. May be this feature can be added later. This is not in the near future.

May be try: https://bundlejs.com/
Bundlejs has an API which you can use directly in LiveCodes to import modules from.
https://twitter.com/jsbundle/status/1634455567321255936?s=20

Let's just leave this issue open, till we decide about bundling as a feature.

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

No branches or pull requests

2 participants