FLUID-4162: Allow the creation of an autoInit component and namespace registration with the same name to occur in any order

Metadata

Source
FLUID-4162
Type
Improvement
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Colin Clark
Reporter
Antranig Basman
Created
2011-03-29T00:57:37.812-0400
Updated
2014-03-03T13:12:05.099-0500
Versions
  1. 1.3.1
Fixed Versions
  1. 1.4
Component
  1. Framework

Description

It is a helpful practice for users of a component to be able to structure a namespace around the name of its creator function. Whilst this is done in code, this always involves some amount of time-dependent "juggling" as the Javascript function object must be created FIRST, and it can never be interchanged with an object of the same name. Now that all of this machinery is automated in the framework, it is possible to provide a better experience for both developers and users. Right now the same time-dependency is present - that if, for example, issuing

fluid.defaults("fluid.myComponent",
gradeNames: ["fluid.littleComponent", "autoInit"

and THEN issuing

fluid.registerNamespace("fluid.myComponent.subNamespace") etc.
will work, the opposite order will not, since the autocreation of the component's creator will blast the existing namespace contents. We should update the "autoInit" pipeline so it "grandfathers in" any existing contents of the record.