Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I struggle to find any suggestions how to organize RactiveJs code.
Currently I just put RactiveJs code to the bottom of the page. It was okay till my scripts were small. But the bigger they are the more problem it causes. I'm considering moving the RactiveJs code to separate js files, may be using some pattern (Module?).
Are there any guidelines in this regards?
There is a spec for component-per-file: https://github.com/ractivejs/component-spec/ and there are loaders that allow you to incorporate them into the page.
However, Ractive doesn't force you to use this pattern. You are free to experiment whatever convention works for you.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I've been looking for the past few days, but I haven't found a single sample code or article that discusses how to combine (not separate them as API Service & Frontend Service) Nest JS with Sapper (Svelte). Does anyone have any references in this regard?
I struggled with the same issue and found this template repository on GitHub. I've tested it out and it works pretty well.
The only "downside" is that it uses Svelte instead of Sapper.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Is this a good practice? I mean is it good if all of my codes(behavior,presentation,structure) are inside on my .js(for example, since I'm making a website) file? Why? Sorry for my bad english.
Obviously it is not good practice, the recommended practice is to split all the code into its designated file. The simplest method is to use multiple script tags with src.
If you're really interested in dividing up your code efficiently, I would suggest learning BoostrapJS or AngularJS.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
_I've seen both pure CSS menus and JavaScript based menus and I can't see that there is anything gained using JavaScript.
Is there something I'm missing.
The google search pulls up SO articles from a good while back.
Here is an SO article from about 5 years ago.
What is the current state of CSS menus?
Unless you want something that can't be done with CSS, you gain absolutely nothing by using JS instead of CSS.
JS was the way to do animated things before CSS3 brought its transitions and animations, and is now becoming a standard because it's simpler and performs better (in those few things it can do).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
This code snippet is from a teammate of mine, his title is "Full Stack Developer". He mostly writes PHP. I found this code at the end of a .php file and asked him to move it to a separate .js file for testability, maintainability... just some best practices.
He denied, he actually said this code is "extremely simple" and refactoring just makes it more complicated without any benefits. He talked about KISS, about performance...
Just tell him story about Spaghetti code, design patterns, etc. and then fire him.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
What are the advantages of using requireJS if all the script files are merged into one in production?
Im working on a multiple page project.
You only merge the files for staging and production. In development you keep them separate.
This lets you manage your JavaScript by dividing it into discrete units. This makes it easier to test, easier to reuse and easier to find the piece of code you need to change.