Community
Participate
Working Groups
I still can't open a JavaScript editor in this build: On Chrome I get: Uncaught Error: Mismatched anonymous require.def modules built-edit.js:380Uncaught Error: declare dijit.TooltipDialog: mixin #0 is unknown. Did you use dojo.require to pull it in? On Firefox 7.0.1 I get: declare dijit.TooltipDialog: mixin #0 is unknown. Did you use dojo.require to pull it in? [Break On This Error] define("dijit/_base/wai",["dojo","diji...)?"addClass":"removeClass"](b.body(),
This is a build problem. The requirejs build has an optimization step where it statically rewrites anonymous module definitions into named ones and resolves their dependencies. This magic only works for simple cases: it literally just walks the AST looking for a call to "define" or "require". It can't deal with the "(define || defineGlobal(..))(deps, callback)" pattern used by the editor code. The result is that every editor file gets dumped into built-js as an anonymous module, and that causes the runtime error (requirejs does not allow more than 1 anonymous module in a file).
can this be fixed in the build ?
(In reply to comment #2) > can this be fixed in the build ? Not really... the code that does this comes from RequireJS. I think we have to play well with whatever they're doing.
I pushed a possible fix to a new branch. This fix declares the function define if it is not declared yet. The new function has the same signature of the requireJS define function with an extra paramater at the "end" for the moduleName. Would this fix the build? http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/log/?h=bug362674
(In reply to comment #4) > I pushed a possible fix to a new branch. This fix declares the function define > if it is not declared yet. The new function has the same signature of the > requireJS define function with an extra paramater at the "end" for the > moduleName. Would this fix the build? > > http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/log/?h=bug362674 I hope this work, IMO this solution is the cleanest solution for the non-requirejs case. +1
(In reply to comment #4) > I pushed a possible fix to a new branch. This fix declares the function define > if it is not declared yet. The new function has the same signature of the > requireJS define function with an extra paramater at the "end" for the > moduleName. Would this fix the build? > > http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/log/?h=bug362674 It looks like requireJS will tolerate the extra parameter, so I think this will work. +1 also
The change we made last night fixed the problem. If you guys prefer Silenio's new style feel free to push those changes to master and I will run another build.
And reviewing the changes, I like Silenio's pattern too.
I pushed the code to master http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f649e26807181eb10d4f0204e75c73e6b75c8867 please try a build.
(In reply to comment #9) > I pushed the code to master > http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f649e26807181eb10d4f0204e75c73e6b75c8867 > > please try a build. I started build I20111103-1522.