dakala / fullcalendar

Fork of Fullcalendar Drupal 8 module
3 stars 9 forks source link

Add dependency on fullcalendar_library #25

Open acrollet opened 6 years ago

acrollet commented 6 years ago

Fixes #7. (And possibly #16)

acrollet commented 6 years ago

Hmmm, don't review just yet - not working as well as I thought ;p

acrollet commented 6 years ago

Ok, this is ready for a look - be sure you're using 8.x-1.0-beta3 of fullcalendar_library

acrollet commented 6 years ago

Hi @dakala, any update on this? :)

dakala commented 6 years ago

@acrollet Apologies for the silence. Loading external libraries via CDN is definitely a good feature especially in production. However, there are instances when a local copy of a library is indispensable.

That's why I prefer an approach similar to Bootstrap - supporting both with an option to toggle settings between them. See the screenshots in case you don't use Bootstrap.

What do you think?

bootstrap-settings bootstrap-settings2
acrollet commented 6 years ago

Sorry if it's not clear, but a local copy of the library will always be used if present - the module only pulls from a CDN if it is not found.

acrollet commented 6 years ago

note: the site status report notes when a CDN is used for the library and provides instructions of where to store the local copy...

dakala commented 6 years ago

Great. But can't we download the library too? Core does something similar withcore.libraries.yml. And a setting where you opt to use CDN or no CDN.

acrollet commented 6 years ago

@dakala can you expand on what you mean by downloading the library?

dakala commented 6 years ago

In core.libraries.yml you'll find third-party libraries e.g. backbone, domready etc. This is what the ckeditor looks like:

ckeditor:
  remote: https://github.com/ckeditor/ckeditor-dev
  version: "4.7.2"
  license:
    name: GNU-GPL-2.0-or-later
    url: https://github.com/ckeditor/ckeditor-dev/blob/4.7.2/LICENSE.md
    gpl-compatible: true
  js:
    assets/vendor/ckeditor/ckeditor.js: { preprocess: false, minified: true }

We should be able to do something like this for fullcalendar. I'll try it tomorrow as I'm not 100% sure if this works like make files in D7

dakala commented 6 years ago

@acrollet Looks like handling of 3rd-party libraries isn't as straightforward as I tried to suggest yesterday.

https://www.drupal.org/node/2605130 https://www.drupal.org/project/drupal/issues/2873160

Other projects are trying different solutions e.g. Chosen (http://cgit.drupalcode.org/chosen/tree/README.txt?h=8.x-2.x)

However, I'm still in favour of being able to switch between local and CDN copy of the library like Bootstrap.