Task #48074

Neos backend no conflict mode

Added by Aske Ertmann about 2 years ago. Updated over 1 year ago.

Status:Resolved Start date:2013-05-08
Priority:Must have Due date:
Assigned To:Adrian Föder % Done:

100%

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

Description

Currently the JavaScript for the Neos backend is not properly contained so it breaks when a page has its own version of jQuery or RequireJS. This needs to be fixed to allow using Neos with all kinds of templates.

RequireJS has already some support of loading things asynchronously and with different versions at the same time, which could probably be used to solve some of the issues.


Related issues

related to TYPO3.Neos - Bug #47510: Content editing is broken when page uses RequireJS Resolved 2013-04-23
related to TYPO3.Neos - Bug #53883: Mismatched anonymous define() module Resolved 2013-11-22

Associated revisions

Revision 856803b4
Added by Rens Admiraal over 1 year ago

[BUGFIX] Neos backend breaks if the frontend uses requirejs

When the frontend of a website is using requirejs the backend of
Neos does not load, or the content editing does not work. This change
puts all Neos requirejs configuration in the 'neos' context and
wraps requirejs to prevent a double declaration of requirejs.

It also changes the way requirejs is included as the data-main
attribute will not work if requirejs is already defined in the
frontend.

Change-Id: I166593bd6d53a24b4f65e29c2622a4a9f437d2d7
Fixes: #47510
Fixes: #48074
Fixes: #53883
Releases: master
Reviewed-on: https://review.typo3.org/26487
Reviewed-by: Rens Admiraal
Tested-by: Rens Admiraal
Reviewed-by: Robert Lemke

History

#1 Updated by Aske Ertmann about 2 years ago

  • Assigned To set to Adrian Föder

Hey Adrian

I believe you have some insight to this, could you maybe provide some more information about the issues you have experienced?

Thanks

#2 Updated by Christian Müller about 2 years ago

  • Status changed from New to Needs Feedback

We merged a big change that should improve this a lot. Please try if it is better for you, then we could close this issue for now.

#3 Updated by Adrian Föder about 2 years ago

sorry missed the assignment; my problem was that I already included require.js on my own, hence no backend at all was loaded. I assume this is a side-effect of requirejs because once it's loaded (the one I provided), it stops looking for data-main arguments anywhere, hence the one Neos provides.

#4 Updated by Aske Ertmann about 2 years ago

Just to be clear have you tried it again or? We improved a lot of the conflicts, but AFAIK RequireJS still conflicts. Most other JS frameworks shouldn't however.

#5 Updated by Adrian Föder about 2 years ago

I tried it and it's definitely not gone.

This is, IMO, a plain requireJS issue because I think requireJS starts itself as soon as it's executed, hence no further DOM loading happened. RequireJS then searches for the last <script> tag until that moment and finds out "its" script tag then.
Then it looks at the data-main attribute on that tag and starts its actual work.

When included manually, requireJS starts itself, does not find a relevant data-main attribute and does nothing. Later in the DOM building process, the neos-<script> with its data-main attribute is there, but the new loaded (neos) require.js does nothing because another require.js is already present.

#6 Updated by Aske Ertmann about 2 years ago

Will you try to have a go fixing this or should we assign this to Sebastian or Rens for a possible solution to the issue?

#7 Updated by Aske Ertmann about 2 years ago

  • Target version set to 1.0 beta 1

#8 Updated by Alexander Schnitzler over 1 year ago

Any update on this one? Beta1 is released so what's the plan here?

It sound's a little mean but I want to manage modern pages with Neos, not the ones I did in the late 90s. Don't take me too serious but this one is really an issue here.

I just opened another bug report as this error also occures with foundation 5 now. Cannot exactly say who is to blame here but I cannot turn off my local js everytime I want to edit my content. Though, being able to sell this, I would be rich a lot sooner. ;-)

#9 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Needs Feedback to Under Review

Patch set 5 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/26487

#10 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/26487

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/26487

#12 Updated by Rens Admiraal over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:856803b48053815be74706044477cbae6f850e27.

Also available in: Atom PDF