Task #48328

Work Package #47023: Global user interface

Rename JavaScript to new structure

Added by Sebastian Kurfuerst over 8 years ago. Updated over 8 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2013-05-17
Due date:
% Done:

14%

Estimated time:
(Total: 0.00 h)

Description

======================
Rules
======================

* UpperCamelCase
* Handlebars in same folder and same name as file
* View do NOT leak into global scope (REMOVE T3.*)
* we do NOT use Ember Router and the related naming conventions for content module.
* Abstract classes -> AbstractXY in terms of naming

Referencing Helper Views
------------------------

Furthermore, if a view needs another view for working (f.e. from the `shared` namespace), we explicitely
load it as dependency and then make it a property of a view. Example:

    define(
        ['Shared/MyHelperView'],
        (MyHelperView) ->

            StuffView = E.View.extend {
                # in contrast to other properties of an object, we use
                # UpperCamelCase naming conventions here to show that we
                # reference another *class*, and not an *instance*
                MyHelperView: MyHelperView
            }
    )

Inside the Handlebars template of the view, we can then reference this view using:

    {{view view.MyHelperView}}

This way, we do not need to put helpers into any global namespace.

======================
NAMING
======================

Neos-built.js --> shoudl be in some "DIST" folder
ModuleBootstrap.js (for ...)
ContentModuleBootstrap.js (former contentmodule-main.js / Ember.Application)
Content/
    ContentModule.js (MAIN ENTRY POINT)
    PreviewMode.js
    WireframeMode.js

    LibraryExtensions?

        LinksAlohaPlugin/
        UiAlohaPlugin/
        CreateWidgets/
        HalloWidgets/

    Model/

        DocumentContext.js (singleton)
        NodeSelection.js (Singleton)
        PublishableNodes.js (Singleton)
        NodeActions (Singleton)

    InlineEditing/
        InlineEditing.js (former create.js)
        InlineEditingHandles.js
        AlohaLoader.js
        HalloLoader.js
        NewContentChooser.js?

    Components/
        AbstractPopoverButton.js
        AbstractButton.js
        AbstractToolbar.js
        AbstractToggleButton.js

    Menu/
        NodeTree
        ContextStructure

    Inspector/
        Inspector.js

        Editors/
            AbstractEditor?
            ImageEditor
            HtmlEditor
        Validation/
            ...

Shared/
    Components/
        Navigate (is only the "base container"; does NOT contain f.e. a tree)
        Menu
        ContextBar

    ResourceCache.js
    Ember/
        DictionaryObject.js


Subtasks

Task #48329: Remove leftover window.T3New2013-05-17

Actions
Task #48333: Clean up Content/Application and Content/ContentModuleNew2013-05-17

Actions
Task #48334: (maybe) re-introduce "development mode indicator" in topToolbarTemplateNew2013-05-17

Actions
Task #48352: Aloha loading does not always work reliablyNew2013-05-17

Actions
Task #48356: !!! Fix JS buildResolved2013-05-17

Actions
Task #48357: get rid of window.EmberNewSebastian Kurfuerst2013-05-17

Actions
Task #48358: get rid of window.plupload, window.Chosen, window.AbstractChosen etc, window.GENTICSNewSebastian Kurfuerst2013-05-17

Actions
#1

Updated by Sebastian Kurfuerst over 8 years ago

  • Status changed from New to Accepted
  • Estimated time set to 0.00 h
#2

Updated by Sebastian Kurfuerst over 8 years ago

  • Estimated time set to 0.00 h

Hey everybody,

today we (Aske, Rens, Markus, Sebastian Hens, myself) discussed an updated naming structure for JavaScript files which will help us to more easily find our way through them, and to more reliably manage dependencies between them.

You'll find the updated structure as we plan it on: http://forge.typo3.org/issues/48328 -- and I pushed (and merged) a first changeset, implementing this scheme for about 70 % -- https://review.typo3.org/#/c/20869/ and https://review.typo3.org/#/c/20874/ .

During the restructuring, I was able to remove many JS classes from our global "T3.*" namespace, which is a great step towards not interacting with the JS of the "host page" at all, not requiring any global scope.

I needed to disable the Continuous Integration JS build, as we still have a weird problem with the minified version (http://forge.typo3.org/issues/48356) in some cases. I'll try to hunt that down this evening and re-enable the build as soon
as possible. Sorry for the inconveniences!

This evening or on next Wednesday I'll continue with that; but the remaining structure / file changes will be a lot smaller and less disrupting than the current one.

Greets, Sebastian

#3

Updated by Aske Ertmann over 8 years ago

  • Assignee set to Aske Ertmann
  • Target version set to 1.0 beta 1
  • Estimated time set to 0.00 h
#4

Updated by Aske Ertmann over 8 years ago

  • Estimated time deleted (0.00 h)

Also available in: Atom PDF