Development

#4354 (Split JavaScript helpers into 2 files)

You must first sign up to be able to contribute.

Ticket #4354 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

Split JavaScript helpers into 2 files

Reported by: francois Assigned to: FabianLange
Priority: minor Milestone: 1.2.0
Component: helpers Version: 1.2.0 DEV
Keywords: Cc:
Qualification: Accepted

Description

In symfony 1.2, JavaScript helpers have been moved to sfProtoculousPlugin, bundled by default. But the helper functions in this plugin are of two kinds:

  • Generic JavaScript helpers, not relying on Prototype/Scriptaculous, and that could be reused by some other JS libraries (e.g. javascript_tag(), javascript_cdata_section(), if_javascript(), link_to_function(), _options_for_javascript(), etc.).
  • Specific Prototype/Scriptaculous helpers, that rely on this JS lib to be bundled

In order to promote reusability of the generic helpers, the helper group shoud be split in two. The generic part should remain in the core, and the specific part stay in the plugin. The specific part would require the generic part to work.

The only problem is: how to name these helper groups to be BC? I suggest:

  • Generic: JavascriptBaseHelper
  • Plugin: JavascriptHelper

Change History

09/11/08 10:29:03 changed by FabianLange

  • owner changed from fabien to FabianLange.
  • status changed from new to assigned.
  • qualification changed from Unreviewed to Accepted.
  • milestone set to 1.2.0.

good proposal. makes sense for me. "Base" implies that all JS helpers can use this helper. Which I am not 100% sure that we should so so. But I think we can take this proposal and see how it goes. I will implement this.

09/11/08 16:23:02 changed by fabien

To be BC, we need to include the JavascriptBaseHelper? in JavascriptHelper?.

09/12/08 10:59:30 changed by FabianLange

what about "_build_callbacks" should we remove the underscore to indicate that this is a API usable for JSHelper writer to build callbacks?

PS: Fabien, of course we keep this bc :-)

09/12/08 12:03:56 changed by FabianLange

(In [11472]) [1.2] proposal for splitting javascript helper into Base and Prototype helper variant. refs #4354

09/13/08 13:22:31 changed by FabianLange

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [11510]) [1.2] split Javascript Helper into JavascriptBaseHelper?.php and JavascriptHelper?.php. Added Test for basic functionality and made some private methods public. fixes #4354