Reputation: 2410
If I try the demo app from a tutorial on Dojo's page I receive tens of lines of syntax errors in the console. Is that normal? I pasted bellow just a small part of the errors (there are actually 243 lines with errors)
09:44:58.523 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead touch.js:15
09:44:58.523 Error: http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dojo/touch.js is being assigned a //# sourceMappingURL, but already has one
09:44:58.525 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead main.js:3
09:44:58.538 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead string.js:10
09:44:58.538 Error: http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dojo/string.js is being assigned a //# sourceMappingURL, but already has one
09:44:58.539 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead window.js:14
09:44:58.544 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead cache.js:9
09:44:58.544 Error: http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dojo/cache.js is being assigned a //# sourceMappingURL, but already has one
09:44:58.556 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead a11y.js:6
09:44:58.564 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead focus.js:9
09:44:58.567 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead Destroyable.js:3
09:44:58.567 Error: http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dijit//Destroyable.js is being assigned a //# sourceMappingURL, but already has one
09:44:58.569 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead Stateful.js:11
09:44:58.569 Error: http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dojo/Stateful.js is being assigned a //# sourceMappingURL, but already has one
09:44:58.577 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead hccss.js:10
09:44:58.577 Error: http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dojo/hccss.js is being assigned a //# sourceMappingURL, but already has one
09:44:58.583 SyntaxError: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead _AttachMixin.j
And the tested link is: http://dojotoolkit.org/documentation/tutorials/1.9/themes_buttons_textboxes/demo/Button.php The browser is Firefox
So it should be something pretty basic, right? I am interested if you have more information about this framework. Is it reliable? Should I start using it, or I should look elsewhere?
Thank you
Upvotes: 1
Views: 1772
Reputation: 1381
It is not clear from your question which browser you are using? It would be helpful to know this so other users can replicate the errors you have received.
Firstly, in answer to your question: "Is Dojo.js obsolete"? - No
Dojo is in active development, the team are currently working on the v1.10 release. The project is very much alive and well. See: Built With for information on current usage accross the web. Also see answer to question, "Is there a list of commercial support companies for dojo?". The framework is extremely reliable and robust.
The errors appear as warnings in my console (using Firefox) and are related to how the console maps source code back to the original unbuilt code. Most Javascript frameworks/toolkits (eg. Dojo, AngularJs, JQuery, ...etc) use built code. Code is built to reduce its size and remove unnecessary clutter (eg. comments).
Built code is not easy to read so it is useful if the console can link back to the original. See: "Introduction to JavaScript Source Maps - HTML5Rocks" for information on how this linking is achieved.
I don't want to complicate the answer too much; basically, the demo is using a built version of the code from Google, which has a old source mapping format. The HTML5Rocks link above explains how the method for linking these maps has been changed; the errors/warning are a result of using this old format.
The demo buttons work as expected for me in Firefox and Chrome but I do get the warnings the same as you. They are not really errors and are only related to the functioning of console not to actual page code. Hope that makes sense?
Upvotes: 4
Reputation: 2258
No. Dojo is fine and works (also 1.8, also 1.9. versions).
Also popularity of Dojo is growing quite fast.
This is my jsFiddle sample which works with latest Dojo.
http://jsfiddle.net/ondrek/kQhaz/
HTML:
<div data-dojo-type="dijit/layout/BorderContainer">
<div data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="splitter:true, region:'leading'">
Hello, I'm on left pane!
</div>
<div data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="splitter:true, region:'center'">
Hello, I'm center pane!
</div>
</div>
Javascript:
require([
"dojo/parser",
"dojo/domReady!",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane"
], function(parser){
parser.parse();
});
CSS:
html, body, .dijitBorderContainer {
height: 100%;
}
If you want primitive sample for a button, just add require
and markup.
It will works.
My demo for form/Select:
http://jsfiddle.net/ondrek/MMKdL/
My demo for Dialog:
http://jsfiddle.net/ondrek/3L4Gf/
Upvotes: 2