Problem/Motivation

The module currently pulls in the Inspire Tree library via the JsDelivr CDN. This works great for most use-cases! However in farmOS one thing that has come up in the past is the desire to host local offline instances of farmOS that do not depend on an internet connection.

It would be nice if this module provided a choice between CDN or local library hosting. In farmOS, we could use Asset Packagist to pull it in via Composer during build time, in the same way that we are pulling in farmOS-map.js.

I see that the CDN URL is included directly in the inspire_tree.libraries.yml file, so I'm not sure what the options are, or what the easiest approach would be to doing this.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

m.stenta created an issue. See original summary.

pcambra made their first commit to this issue’s fork.

pcambra’s picture

@m.stenta I was thinking about this and bumped into https://www.drupal.org/node/3099614, so this basically means that the default will be cdn and if the local library is set to any "official" location, it will use that one. This is a zero config approach which I like.

  • PATH/TO/SITE/libraries (for example sites/example.com)
  • ibraries
  • PATH/TO/INSTALL_PROFILE/libraries

I think the inspire tree module is bare right now, but a lot of the behaviours we're incorporating in the farm_ui_locations module could define an #inspire_tree form element and moved here

m.stenta’s picture

That sounds good! So if I'm understanding that would require adding the Libraries module to farmOS, and a few other changes in that repo, but not in this one? That'd work. Do you want to make those changes in the branch over in #3179023: Location hierarchy drag-and-drop editor? Sounds like we can close this as "won't fix"?

pcambra’s picture

@m.stenta not at all! we just need to add the local files in any of those locations :) no extra modules

  • pcambra committed e7bfa7d on 1.x
    Issue #3209164: Allow toggling between CDN/local JS hosting
pcambra’s picture

Status: Active » Fixed

Marking this one as fixed, we can iterate on it :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.