Optimal plugins and project to use IntelliJ IDEA for JavaScript? [closed] - javascript

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 8 years ago.
Improve this question
I'm building a web application using a MEAN stack: MongoDB, Express, Angular, and Node.js, based on Daftmonk's angular-fullstack Yeoman generator.
Because most of my work is Java, I'm using IntelliJ IDEA however I'd like optimal introspection and workflow for this JavaScript module.
In order to achieve to most possible introspection, and least possible confusion, what plugins and project configuration should I use?

Here's the best I've been able to do so far.
There are some crucial IntelliJ plugins to install:
.gitignore support
AngularJS
Base64 for IDEA and Storm
BashSupport
Bootstrap
CSS Support
Database Support
ddescriber for jasmine
Git Integration
GitHub
HAML
Heroku integration
HTML Tools
Jade
JavaScript Debugger
JavaScript Intention Power Pack
JavaScript Support
JS Toolbox
JUnit
Karma
LESS CSS Compiler
LESS support
Markdown
Mongo Plugin
NodeJS
Require.js plugin
REST Client
Spy-js
SvgViewer 2
Terminal
W3C Validators
YAML
As a peace offering to the mighty IntelliJ, use Java as project SDK:
I prefer to configure four separate modules, to help separate back-end vs. front-end JavaScript dependencies:
Add the bower_components library to the client module, and the node_modules library to the server module:
And be sure to enable JavaScript libraries in the editor.
Per best practices, we do not commit the local IntelliJ IDEA configuration folder (/.idea/) to the repository, instead adding it to the .gitignore file like so:
# IntelliJ IDEA local workspace
.idea
Happy coding!

Related

How to run an old angular project? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
In my company there is an old angular (Not even sure what version) client that no one touched for at least 2 years and I got the "lucky" job of changing some feature in this client.
The confusing part starts when I noticed there are no package.json, package-lock.json and angular.json files in the project but the whole node modules directory and compiled js files are stored in the git repository.
The problem is that I have no idea of how to rebuild this project after I change the typescript files. In addition, I want to remove the node modules directory from the git repository and have package.json instead.
No one that originally worked on this project is still in the company (Not surprised after I seen this mess).
The backend is written in asp.net framework and contains .cshtml files so I suspect there is some relation between the client and the server
Can someone help me rescue this project?
Sounds like a bit of a nightmare! You can try these steps to start but I'm sure you will have issues. Persevere as I think you can do it! Once you get some errors to work from it will be easier. Good luck
Look in node_modules for #angular/ folder and find the angular
version (if there isn't one then its AngularJS).
Create a brand new project using angular-cli using the version you just found.
copy the contents of the app folder (at least) to the new project.
Search through imports to see which libraries are used and npm install them.

Using Require with React in a web page without node [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I know this might be a silly question to some of you, but I am beginner in React, and I wish to create a really simple application.
I found a sample in which every component is saved in a separate js file, which looks very good for modularity and re-usage.
The only thing I need to take care of now is using export/require. However, I don't need to be dependent on nodejs. I just need a simple html/js application that can run on any cheap web server.
I read somewhere that I can use "Browserify", but after looking at it, it seems like a node library.
Is there any library that I can use from a web page (via cdn for example) that allow me to use require? If not, does that mean I can not separate react components in different files?
However, I don't need to be dependent on nodejs.
Use NodeJS. It is how React applications are designed to be built.
I just need a simple html/js application that can run on any cheap web server
NodeJS is only required at build time. You run it on your development workstation. The output is static files that you can upload to any webserver.
(NB: React applications are often designed to make HTTP requests to get dynamic data. Some tutorials cover using Node to build a server to listen for and make responses to those requests. Make sure you don't conflate the program to transpile the React application to ES5 (which runs at build time) with the program to run a webserver (at runtime) even if both are written using Node).
If you don't want to use Node, you can use webpack: https://webpack.github.io/
you will generate a static/bundle.js . If you want to learn more about it, I sugest http://survivejs.com/
What you need is a build step that packs the separate files into one or more packages that can be loaded in the browser.
Browserify can be used to do that, but WebPack is also popular.
These tools require some configuration, so I think that the best way to start is with a tool like create-react-app which is easy to install and has commands for developing as well as packing your app for deployment.
It uses webpack internally (along with some other tools) but saves you the hassle of configuring it yourself. If at any time you need advanced configurations beyond what create-react-app provides, it has an 'eject' command that exposes the raw configuration files.
Getting started is simple (taken from their readme):
npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start

What is the workflow when including scripts in web pages with npm? [closed]

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 6 years ago.
Improve this question
There are many JS libraries and frameworks (e.g. jquery) that suggest doing this:
npm install foo
This gives you a node_modules directory in which there would be a foo directory. For most JS libraries that are meant for use in web pages, there will be a dist directory inside consisting of the required JS files that can be used.
I can now include JS with something like <script src="/node_modules/foo/dist/foo.js">, but I haven't found a single website doing that. Of course, this folder could be symlinked to something like js and then that could be used as js/foo/dist/foo.js, although I'm not sure if this is a good idea or whether it is even done in real life.
To me, copying scripts from online sources and putting them in my project repository seems like a better idea, although the advantages of automatic package management are lost in that case.
I do understand the workflow of npm when developing node.js-based server side applications, however, I'm having trouble understanding where the case involves scripts to be included in web pages. What exactly is the workflow in such cases?
Well, do use NPM installed scripts in a web you have to use some bundler/builder which adds additional layer package management in your application. This would allow using modules like in server side. After bundling your modules into single or multiple chunks include these in your web like any other JavaScript files.
There are multiple tools for such job:
http://browserify.org/
https://webpack.github.io/
http://rollupjs.org/
Loading JavaScript in the browser is usually done through a module system, for which there are several competing standards (AMD, CommonJS) and implementations. One such implementation is Browserify, which assembles (at build time) the scripts you actually require into a single bundle.js file, which you can then easily include in HTML. (Other module systems work differently, for instance by loading each file separately when it is first needed).

Is it possible to use Maven to develop Frontend/Web apps? [closed]

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 6 years ago.
Improve this question
I have worked with Gulp, Grunt and Webpack. I feel that so far the best build tool I've worked with is Maven. Simple and concise, in my opinion.
For this reason I would like to know if it is possible to use Maven as an alternative to Gulp, Grunt and Webpack, to deploy my web apps.
Simultaneously I would love to use Kotlin instead of JavaScript.
Is there any possible way where I could mount a boilerplate web project having these technologies:
Maven instead of Gulp, Grunt, Webpack
Kotlin instead of JavaScript
SASS instead of CSS
And have the following libs integrated: VueJS, FlexboxGrid or similar, Font-Awesome and C3js?
Thanks!
it is possible to use Maven as an alternative to Gulp, Grunt and Webpack, to deploy my web apps.
Gulp and Grunt - tasks runners.
Webpack - modern bundler with a lot nice features (like webpack-dev-server and hot module replacement).
Maven - is task runner plus dependency manager. In JS world you usually use npm for dependency management.
Maven instead of Gulp, Grunt, Webpack
For web development you shouldn't use maven, you can call webpack or anything else when you building both java and frontend, but for development i recommended stay with webpack and npm.
So - no, use webpack for build UI.
SASS instead of CSS
If you stay with webpack - it's very simple to stay with sass, just use node-sass and sass-loader.
On other side maven has sass-maven-plugin, i'm not sure about their quality, and looks like it dead. So I highly recommended to build your sass files with webpack.
Kotlin instead of JavaScript
Currently JavaScript target for Kotlin is under active development, so you can run into bugs and not yet implemented features. But it possible, and there are already few projects. You can write code in Kotlin, compile to JS and use it in webpack. If you doesn't want to learn a lot things yourself i recommend wait for Kotlin 1.1.

Angular 2 and NodeJS project setup [closed]

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 6 years ago.
Improve this question
I've got some basic questions concerning the project structure of a MEAN-app including Angular2. I've followed the starting tutorial of angular.io to build a really basic Angular2 app. Now I try to integrate this app inside a NodeJS project following this tutorial. The problem is that this tutorial was written at the time of the first Angular.
My questions are:
where should I put the npm packages of my Angular2 app? Inside the
public folder (so the app has an own packages.json) or inside the
node packages.json?
how should the tsc compiler should be implemented?
Bruno
I've had a very similar problem, when first starting to migrate towards angular2. The Angular.io tutorial uses System.js for its modules, which is basically incompatible with Node, which uses CommonJS. This leaves you with two options.
Setup the Typescript compiler and Node modules for Client and Server individually.
Use CommonJS modules with something like Browserify on the Client.
Now for me, only the second option is a good option. Setting things up twice defeats the whole purpose of having the same language across Client & Server.
I have prepared a Boilerplate for Angular 2 to start with Browserify quickly.
You can check it out right here.
Now all you have to do is create a public folder for your client app and also create static routes for your node modules. It could look something like this:
app.use(express.static(__dirname + '/public'));
app.use("/node_modules",express.static(__dirname + '/../node_modules'));
Personally I use a VS Code Task to compile my Typescript and then use Watchify on the client side to bundle it all together. On the Server Side I use nodemon to watch for any changes and restart the Server on compile.

Categories