EmberJS in combination with Ember-Runner - node.js

Good day,
I just started with EmberJS in combination with Ember-Runner. I found an working example on Github.
Ember-runner automaticly adds all your template files and JS (at least that is what I thought) together and generarates a singe HTML / JS / templates / CSS file from your own files every time you save. (And optionally minify's and such). A build tool, just like it says in the description.
This is what it does for the CSS and templates part, however for the JS part it only seems to include only one file in my JS folder which is called 'main.js'. Is it possible to scan that dir for other files so it includes those as well? (So I can have separate controller / model files and such).
I hope my question is clear.
Kind regards,
Matthijn Dijkstra

Related

Vue js : Extract actual code from production version minimized files

We had a vue js code for one of the functionality which we have deployed in production in Production minimized form.
Now I have lost the actual code (Vue js project) so I only left with minimized files (app.js, manifest.js, vendor.js and app.css) because of this I am not able to make any changes for that functionality.
Is there any way to extract the code from production files in vue js project and modify some of the logic.
There is no right anwser for this. You can only try to "hack" some way into webpack minified files. You can do it in Chrome Dev Tools when inspecting the minified file, then click on "Pretty Print" brackets below to format your code in a regular manner, but still all your original source code variables, fnames etc. are changed.. Only if you know some specific values, for examples hard-coded strings you can orient your way around it, but its a long shot...

What does .sprite file refers to?

I'm using Liferay Portal 6, The .sprite file is not specified in the source code, however, it's included in the URL with a slash dot, then it's blocked by a security program.
When I delete those file in theme/docroot/images and I deploy the project, they are generated again.
I would like to know how to manage those files or rename them?
You can open those files: It's combined images - look up "CSS Sprite" for a thorough documentation. They're used to limit the number of requests that go back to the server. Without sprites, you'd have every theme image loaded individually. With them you only need the sprite once, resulting in a significant performance boost: You want to have as few http-requests per page as possible, and sprites are one automatically handled way to help you achieving this.

Style tags and Javascript in Template files

I'm looking through a project built by a foreign team. I am looking through some of the template files ending in ".ejs" and ".tmp", but from my limited knowledge, there is some bad convention here, can some of you confirm? Here are a few things I see on each template file:
1) The doctype, html tags and head are re-defined in each template file (stylesheet and JS files are linked on every one, but a different number of stylesheets and JS files linked depending on which template file it is).
2) there are Style Tags with a bunch of CSS in it, and Script tags with Javascript in it. So I'm guessing they did that because they only need those styles/JS in that particular template, but isn't it bad convention?
This is a node/express app I'm talking about. Is this a sign of bad convention/organization, or is it some sort of performance enhancement/convention I do not understand? Please advise me on this!

Nodejs alternative template paths for template engine

Is there any solution to configure template engine use some alternative paths, as described below?
i.e.
templates/{file}.jade
../template2/{file}.jade
../../template/{file}.jade
at first resolves 1st path, if file doesnot exist, runs for 2nd and so on..
i'm using express and jade.
As far as I know, no. Jade uses the usual directory path structure not arbitrary file mapping, to map file to paths.
This is the natural and correct way. The directory structure would work for you too. If you want to implement a fallback, do it in node.js (for different files) or with express (for different requests). To be more precise do it in code, don't use include headers/lookup strategy to accomplish that.

SUSY organization files?

I use method mobile first or a reponive webite and i use susy. How organize files _forms _typo _layout,_mixins etc.. for mobile (default) and breakpoints (tablet, desktop) and to have output files :
mobile.css
tablet.css
desktop.css
Thanks
Sass/Compass+Susy will create a file for every file in your source directory that is not preceded by an underscore.
So, simply place the code you want generated for those style sheets in files located in the source directory using any mixins from your own partials (files preceded by an underscore) or any of the extensions you're including on your project (such as susy)
A great document that talks about structuring your project is here: http://compass-style.org/help/tutorials/extensions/
Something else to look at: http://compass-style.org/help/tutorials/best_practices/
Great
i understand the technics with '_' files not generated but i search sample organization iles or responive website with susy .
if i use multiple files for layout header etc... (include or each at-breakpoint) the css file result contains miltiple declaration #media.... and not grouped .

Resources