Nodeclipse / nodeclipse

Nodeclipse-1 : Eclipse plugin for Node.js, PhantomJS development (Nodeclipse core plugin); Maven and Gradle (with Android) plugins
https://nodeclipse.github.io/
158 stars 78 forks source link

`doctype 5` is deprecated, you must now use `doctype html` #121

Closed ghost closed 6 years ago

ghost commented 10 years ago

Hello,

Creating a brand new express / jade project in nodeclipse 0.1.0 then running it as a node application is raising the following error:

doctype 5 is deprecated, you must now use doctype html

Simple enough to solve by replacing "doctype 5" by "doctype html" in layout.jade: better forget about "doctype 5" for next releases, don't you think?

paulvi commented 10 years ago

I guess you mean Nodeclipse 0.10.0... Express Wizard is using express for generating content. It is likely that there is newer express version. What version do you use?

ghost commented 10 years ago

Yes indeed: I meant v0.10.0 - too many '0' probably ;+)

When you create a new express / jade project in 0.10.0, npm is automatically installing express and jade in the project - which is nice. So YES: I'll assume it's the newer 'stable' version...

In package.json file it says:

"dependencies": { "express": "3.2.6", "jade": "*" }

Installed jade version being 1.1.5 according to jade's package.json file...

I didn't install anything in this project myself - was just creating a brand new express / jade project in nodeclipse using New > Node Express project so I'll assume reproducing it should be quite easy.

After the project was built, just run app.js as "Node Application": server runs on port 3000 - so far so good. Now connect it from localhost:3000 and you'll get the debug trace in the browser...

paulvi commented 10 years ago

When the project is created the command line that is executed is shown in Nodeclipse Console.

I just run Express Wizard and it was C:\Program Files\nodejs\node.exe C:\Users\pverest\AppData\Roaming\npm\node_modules\express\bin\express C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257/NodeExpress2

So actually default setting in wizards. The only parameter is where to create the project.

In other words. Nothing was change in Express wizard in v9 or v10. I guess there is some bug in newer jade library or express version you have tried.

Please leave the issue open, because other user are likely to run into it.

ghost commented 10 years ago

I am not sure to understand how the layout.jade file is produced when we create a new express / jade project but a similar issue was already raised here: https://github.com/visionmedia/express/pull/1875

... if "doctype 5" was really deprecated then we could hardly blame express or jade for this issue: the script that generates the layout.jade file in nodeclipse project should be fixed accordingly IMHO - to keep the platform current and to run new projects from scratch without such glitches. Not @todo immediatly indeed since the fix is so simple but for v0.11.0 may be?

paulvi commented 10 years ago

This is how files are produced, they are copied from what express creates. From Nodeclipse log:

C:\Program Files\nodejs\node.exe C:\Users\pverest\AppData\Roaming\npm\node_modules\express\bin\express C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257/NodeExpress2 
RelativityFileSystemStructureProvider.cllectFiles() called. file count=7
RelativityFileSystemStructureProvider.getContents() called. elemnt=C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257\NodeExpress2\app.js
RelativityFileSystemStructureProvider.getContents() called. elemnt=C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257\NodeExpress2\package.json
RelativityFileSystemStructureProvider.getContents() called. elemnt=C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257\NodeExpress2\public\stylesheets\style.css
RelativityFileSystemStructureProvider.getContents() called. elemnt=C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257\NodeExpress2\routes\index.js
RelativityFileSystemStructureProvider.getContents() called. elemnt=C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257\NodeExpress2\routes\user.js
RelativityFileSystemStructureProvider.getContents() called. elemnt=C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257\NodeExpress2\views\index.jade
RelativityFileSystemStructureProvider.getContents() called. elemnt=C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257\NodeExpress2\views\layout.jade
templateRoot: D:\Progs\Enide-Monster-08-kepler-win32\eclipse\configuration\org.eclipse.osgi\bundles\606\1\.cp\templates\common-templates
RelativityFileSystemStructureProvider.getContents() called. elemnt=D:\Progs\Enide-Monster-08-kepler-win32\eclipse\configuration\org.eclipse.osgi\bundles\606\1\.cp\templates\common-templates\.jshintrc
RelativityFileSystemStructureProvider.getContents() called. elemnt=D:\Progs\Enide-Monster-08-kepler-win32\eclipse\configuration\org.eclipse.osgi\bundles\606\1\.cp\templates\common-templates\.settings\com.eclipsesource.jshint.ui.prefs
RelativityFileSystemStructureProvider.getContents() called. elemnt=D:\Progs\Enide-Monster-08-kepler-win32\eclipse\configuration\org.eclipse.osgi\bundles\606\1\.cp\templates\common-templates\.settings\org.eclipse.wst.jsdt.core.prefs
RelativityFileSystemStructureProvider.getContents() called. elemnt=D:\Progs\Enide-Monster-08-kepler-win32\eclipse\configuration\org.eclipse.osgi\bundles\606\1\.cp\templates\common-templates\README.md

This issue came not from Nodeclipse, so it should not be fixed here. What should be done is make logging less verbose to make it clear how those files are produced.

paulvi commented 10 years ago

Well, while checking code, I don't see where to decrease logging message number, as it happens inside Eclipse code.

https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/wizards/ExpressProjectWizard.java#L101-165

So logging stays as above.

ghost commented 10 years ago

Issue submitted to jade: https://github.com/visionmedia/jade/issues/1400

ghost commented 10 years ago

@PaulVI express version used by nodeclipse 0.10.0 is 3.2.6 when express lastest version in github is 3.4.8 (17 days ago). Assuming the deprecated doctype issue was fixed recently in express - what about using a newer version of express in nodeclipse? Which leads to the new project's package.json file: this one is generated by nodeclipse - isn't it?

paulvi commented 10 years ago

No, I have showed it above

C:\Program Files\nodejs\node.exe C:\Users\pverest\AppData\Roaming\npm\node_modules\express\bin\express C:\Users\pverest\AppData\Local\Temp\express-work\1391084883257/NodeExpress2 

that is calling express tempfolder

That mean that the default express is used. Path to express to use can be configured in Preferences.

paulvi commented 6 years ago

closing as old