プロジェクト

全般

プロフィール

Vote #73307

未完了

CDN support to jquery/ui lib

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Administration_8
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
8
version_id:
32
issue_org_id:
13088
author_id:
60821
assigned_to_id:
0
comments:
9
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

  1. add CDN support to jquery/ui lib -> include css and image files
  2. Supports multiple CDN. (Google, Microsoft, jquery.com, etc.) -> maybe from config file?
  3. jQuery version is automatically detected -> no duplicated
  4. Automatically fallback to local bundled if CDN is down or unreachable

journals

1. and 4. could be integrated with something like this (from HTML5 Boilerplate)
@<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.0.min.js"><\/script>')</script>@

2. The first line of the above mentioned code could be dynamic, which is generated depending on the settings in the administration.
There could be something like a pulldown (just local, jquery, microsoft, google, etc.)

3. Hm, well an automatic detection could be tricky. Example: jQuery updates to jQuery 2.x which possibly remove some function or change some function definition. This could break some features. I would prefer, that the developers choose which version should be used or not.
--------------------------------------------------------------------------------
Don't forget that Redmine can be deployed on a LAN not connected to the Internet.
--------------------------------------------------------------------------------
Etienne Massip wrote:
> Don't forget that Redmine can be deployed on a LAN not connected to the Internet.
Wouldn't that match case no 4?
--------------------------------------------------------------------------------
> 3. Hm, well an automatic detection could be tricky. Example: jQuery updates to jQuery 2.x which possibly remove some function or change some function definition. This could break some features. I would prefer, that the developers choose which version should be used or not.

I mean what versioin of lib we get from CDN should be same as the version from local bundled.
so it is same API whatever from CDN or local.
--------------------------------------------------------------------------------
Etienne Massip wrote:
> Don't forget that Redmine can be deployed on a LAN not connected to the Internet.

Well this would be handled by my mentioned code above. If the extern server isn't available, the local code would be handled.
OR:
See my point two. If the user selects "none", just the local source would be used.
--------------------------------------------------------------------------------
I'm not sure Redmine should handle CDN configuration; administrators who want to have assets delivered by CDN should already be able to do such with some config:

<pre><code class="ruby">
ActionController::Base.asset_host = Proc.new { |source|
if source ~= /.*jquery.*/
"//ajax.googleapis.com/ajax/libs/jquery"
end
}
</code></pre>

(this is a hand-written untested probably nonfunctional example)

You can add fallback mechanism, etc.

See http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html.

--------------------------------------------------------------------------------
JQuery and JQuery-UI are merged in Redmine assets so it wouldn't work. It's hacky anyway and would make the upgrade process painfull. That's the purpose of this request to make using a CDN straightforward.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> JQuery and JQuery-UI are merged in Redmine assets so it wouldn't work.

That was a non-functionnal example for demonstration purpose.

> It's hacky anyway

It's Rails configuration?

> and would make the upgrade process painfull.

Why would it be? Could be in @config/additional_environment.rb@, couldn't it?

> That's the purpose of this request to make using a CDN straightforward.

IMHO this should be handled by the Rails stack since it can be, rather than Redmine.

--------------------------------------------------------------------------------
Sure, you can do pretty much everything in @additional_environment.rb@ if you know about Rails configuration (which changes quite often BTW), Ruby, regexp and all but that's not what we can call "configuration". What I see here is a way to enable a CDN by simply uncommenting something like @jquery_cdn: google@ in @configuration.yml@.
--------------------------------------------------------------------------------

Admin Redmine さんが約2年前に更新

  • カテゴリAdministration_8 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0