-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Writing down some info and thoughts that might useful to other Dash component developers that want to support Julia
Release v1.3.1 is the first release which made DashTextareaAutocomplete functional in PackageCompiler compiled apps.
We did so by adding a Artifact.toml to this project (more info on Julia Artifacts here). Julia artifacts only support publicly-available URLs of tarballs as targets, so we tar'ed the min.js and min.js.map files in deps/ in an extra build sub-command. After npm publish, this tarball is then available on unpkg.com e.g. at https://unpkg.com/[email protected]/deps/deps.tar.gz
In postbuild_fixups.sh, we:
- include the
Pkg.Artifactsmodule insrc/DashTextareaAutocomplete.jland addPkgin theProject.tomldeps - use the
artifact""string macro to include the tarball content insrc/DashTextareaAutocomplete.jlupon initialisation (see Resolve resource path during init #21) - update the
Artifact.tomlspecifications accordingly
(along with patching for #11)
PR #25 may eventually streamline this process a little bit more and perhaps make it more robust as well.
Drawbacks
-
We can't install
DashTextareaAutocompletebefore wenpm publish(asPkg.addrequires the unpkg.com URL to download the artifact). That is, we can't install a dev version ofDashTextareaAutocompletefrom e.g. a github URL.Using
RelocatableFolders.jlas demonstrated in TryRelocatableFolders.jl#20 would fix this problem, but this would perhaps uncover new problems such as adding a0.xdependency toDashTextareaAutocompleteand potentially leading to slower performing apps. -
Some of the operations in
postbuild_fixups.share non trivial.The modifications of
src/DashTextareaAutocomplete.jlby thepostbuild_fixups.shscript could eventually make their way to dash'sdash-generate-componentsjulia component logic. Creating a tarball withmin.jsandmin.js.mapfiles from python wouldn't be too hard either.But trying to replicate the "update Artifact.toml specifications" step in python might be tricky (can we replicate the behaviour of
Tar.tree_hashandsha256identically in python?) and a bit of a moving target (what if Julia artifacts undergo a breaking change in a future release?). So, I think it would be safer to use a Julia script, but then maybe asking for all Dash component devs to have julia installed to build their components is too much?