Task #48328

Work Package #47023: Global user interface

Rename JavaScript to new structure

Added by Sebastian Kurfuerst about 2 years ago. Updated about 2 years ago.

Status:Accepted Start date:2013-05-17
Priority:Should have Due date:
Assigned To:Aske Ertmann % Done:

14%

Category:- Spent time: -
Target version:1.0 beta 1

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.T3New

Task #48333: Clean up Content/Application and Content/ContentModuleNew

Task #48334: (maybe) re-introduce "development mode indicator" in topT...New

Task #48352: Aloha loading does not always work reliablyNew

Task #48356: !!! Fix JS buildResolved

Task #48357: get rid of window.EmberNewSebastian Kurfuerst

Task #48358: get rid of window.plupload, window.Chosen, window.Abstrac...NewSebastian Kurfuerst

Associated revisions

Revision 491cf08d
Added by Sebastian Kurfuerst about 2 years ago

[!!!][TASK] use consistent naming of JavaScript files

This is the first change which modifies big parts of the
UI JS to use Require.js in a clean way.

Related: #48328
Change-Id: Ica70eec687900c59a9dc98d1290d0792ada9da1b

Revision 81e2e761
Added by Sebastian Kurfuerst about 2 years ago

[!!!][TASK] use consistent naming of JavaScript files

This is the first change which modifies big parts of the
UI JS to use Require.js in a clean way.

Related: #48328
Change-Id: Ica70eec687900c59a9dc98d1290d0792ada9da1b

Revision 70eb6898
Added by Mattias Nilsson almost 2 years ago

[TASK] Add T3.Common.Notification as a shared resource

This adds the T3.Common.Notification as a shared resource.
Also replaces the ocurrances of the old usage in the new
JavaScript structure.

But it do not change the PageTree because of the refactoring
in the Navigate component (I393fd01266f95ece643999b4e8e59e3710dc76f5)
commit.

Change-Id: I8f14ae178c056087878a39be565db1dd5b0d57a4
Related: #48328
Reviewed-on: https://review.typo3.org/23491
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann

Revision f88e9bec
Added by Mattias Nilsson almost 2 years ago

[TASK] Add T3.Common.Util as a shared resource

This adds T3.Common.Util as a shared resource and
replaces old ocurrances.

The name Util is also changed to the more descriptive
name Utility.

Change-Id: I0b135d607a381ea2ecdd71cae5ca8c1218e96f74
Related: #48328
Reviewed-on: https://review.typo3.org/23496
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann

Revision 4a681c3d
Added by Aske Ertmann almost 2 years ago

[TASK] Change resource cache into an Ember object

Change-Id: I1b5aae2145f7aef4358f1743cc373f8641f27783
Related: #48328
Reviewed-on: https://review.typo3.org/23533
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann
Reviewed-by: Rens Admiraal

Revision bd18312b
Added by Aske Ertmann almost 2 years ago

[!!!][TASK] Upgrade Ember to 1.0.0

Breaking due to requiring clearing of session storage.

Change-Id: I85bf889cfb39d778c0e8a5954e5e4e316917bf35
Related: #48328
Reviewed-on: https://review.typo3.org/23700
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann

Revision 7e803e25
Added by Aske Ertmann almost 2 years ago

[TASK] Restructure JavaScript model objects

Change-Id: I6aa3524d1e8127669584c9befb6c56598d6d5975
Related: #48328
Reviewed-on: https://review.typo3.org/24162
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann

Revision 4f2355d4
Added by Aske Ertmann almost 2 years ago

[TASK] Use get method on configuration

Change-Id: I77d97df7538afcc215938241abdf8878f7589ef9
Related: #48328
Reviewed-on: https://review.typo3.org/24169
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann
Reviewed-by: Sebastian Kurfuerst
Tested-by: Sebastian Kurfuerst

History

#1 Updated by Sebastian Kurfuerst about 2 years ago

  • Status changed from New to Accepted
  • Estimated time set to 0.00

#2 Updated by Sebastian Kurfuerst about 2 years ago

  • Estimated time set to 0.00

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 about 2 years ago

  • Assigned To set to Aske Ertmann
  • Target version set to 1.0 beta 1
  • Estimated time set to 0.00

#4 Updated by Aske Ertmann about 2 years ago

  • Estimated time deleted (0.00)

Also available in: Atom PDF