I am trying to get all my JavaScript projects in one frame-instance of WebStorm. The reasons for this are good:
I can refactor across all projects
I can find usages across all projects
Up until now we have had to open/reopen each project, and just hope that when we change something in project A it won't have an effect in project B. Unfortunately as the number of projects have grown, we have been getting so many errors because we can't safely refactor or 'see' the effects of a change we want to make.
The WebStorm people say that you can just add more content roots, and a 'content root' can be seen like a project.
Fine. But that still means you can only have one deployment configuration.
I'll explain :
I have two projects projectA and projectB. They both live on the web server at /projectA and /projectB respectively. They both use a common project called /ProjectCommon that needs to be deployed to BOTH /projectA and /projectB respectively.
If I set up the mappings like this :
I get an error message, or exclamation marks. The deploy of the ProjectCommon works only on the first instance it comes across (ie. it never deploys to my projectB).
This is incredibly frustrating because it seems like I almost got to multi-project functionality in WebStorm, but now we have to go back to single windows for each project... opening ....re-opening ... * sigh *
Anyone have an idea where you can have a multi-project setup in Webstorm with deployment capabilities? Eclipse can do it, so I don't see why WebStorm can't.
it's not currently possible to have the same local path mapped to multiple deployment paths. Please vote for WI-5839
Related
One of the major “selling” points of Kotlin appears to be its ability to compile both to JVM or Android and to JavaScript for the web. To make use of this, it should be possible to have a code base where some files are shared between an Android App and a browser Web App.
However, so far I found little details on how such a thing would be set up, in particularly when working with Android Studio and its underlying Gradle setup, starting from a a run of the Android Studio New Project Wizard. I don't mind if I can only build the Web App on the command line, but I'd like to maintain the Android debugging hookups that Android Studio provides. So far I know very little about Gradle and typical idioms for its use.
I'm sure that I'm not the first person to have this idea, so I'd like to know some best practices on how to set this up. Questions that come to my mind include the following:
Do I mix the kotlin2js and the kotlin-android plugin in a single build file, or do I need to have multiple build files (perhaps I should say “modules” or “projects” except I don't know which)?
If I have multiple build files, should that be two (one Android one Web) or three (one more for shared things)?
If it is two build files, how do I reference the shared sources?
If it is three build files, which plugin(s) do I use for the shared one?
Do I need to split my sources over three different source trees? Are there any conventions how these should be called?
Do I need to split my classes into three groups of packages, or can code for different targets coexist in the same package?
What configuration settings do I need to tweak to make the IDE aware of the layout of my project?
I've read the following relevant documentation, among other:
https://kotlinlang.org/docs/reference/using-gradle.html
https://docs.gradle.org/current/userguide/intro_multi_project_builds.html
https://docs.gradle.org/current/userguide/composite_builds.html
https://kotlinlang.org/docs/tutorials/kotlin-android.html
I would recommend using IDEA wizard to create a simple multiplatfrom project for you (File -> New -> Project -> Kotlin -> Kotlin (Multiplatform - experimental) ). Community edition should suffice.
Answering your questions:
You don't mix plugins. You create a separate module for your common code and use 'kotlin-platform-common' plugin for it.
Three modules, special plugin 'kotlin-platform-common'
Use common sense for source splitting. Put whatever you want/able to reuse in the common code. Put platform-specific code in platform modules.
No package restrictions. You can put everything in the same package if you so desire =)
Pretty sure it should just work. If not, try re-importing.
I'm trying to build a business-network-definition for Hyperledger using Fabric (based on generator-hyperledger-fabric). So far it's worked pretty good, but now that we're working on a PoC, a couple of questions have come up:
Is the logic files (stored in the /lib dir) CommonJS modules? Mainly so we split them into reusable utilities to use within our transactions code.
Can we import and use NPM packages?
What's globally available in the logic files? I know there's some function callse like getParticipantRegistry or getFactory (among others), but where are they documented? Where can I get a detailed documentation about them? I'm happy reading code, I just need some one to nudge me into the right direction.
NOTE Please kindly let me know when and if any of my questions don't make sense, I'm still trying to learn Hyperledger and make something useful out of it ;) Also, feel free to point me to docs, I love reading docs, but for some reason I can't find
they're not CommonJS modules per se - they're JS script files. In future releases of Composer there will be the ability to use requires and use modules. Current smart contract / transaction logic is written as one or more .js files in the lib/ directory and deployed to the Composer runtime on the blockchain network (the business network is replicated to the peers and whatever channel was defined).
As above - in a later release you will be able to do this and be able to write native NodeJS chaincode.
See the API reference -> https://hyperledger.github.io/composer/api/api-doc-index and also here for searching on the modules and classes etc. -> https://hyperledger.github.io/composer/jsdoc/ - our main docs site (with concepts and architecture info is here -> https://hyperledger.github.io/composer
Does anyone know of a recent blog post or tutorial on which angular 2 .js files along with the appropriate d.ts files I need so I can just drop them into an existing VS solution without using NPM? I see that I can get the angular files here, but not sure which ones I need. According to the Angular docs, I need do nothing to get typings files for library packages that include d.ts files—as all Angular packages do., but again, when I look thru a sample Angular app, don't know which d.ts files I need.
I can't stand bloat and clutter. Below is a brand new asp.net core on .net 4.6 on the left, the same thing on the right after following this blog:
I can't stomache having to add over 13,000 files to get ahold of maybe 20?, 30? files.
Maybe I'm being too OCD about this, but right now I'll take any suggestions to avoid that bloat, even going with another front-end framework. I've briefly looked at Aurelia, which I like, but again, NPM. Not sure React is appropriate.
My business domain includes Category, which is a self-referencing class/table, and I'm after an intuitive UI where the user can quickly create their own Category structure without having to do a bunch of post-backs to the server. Seems with either Angular2 or Aurelia, I'd only need a couple of Components to accomplish this in the browser.
I know Angular 1.5 added Components, and I may explore that if need be. From what I understand about React, it's not for data management.
So to reiterate my questions, can I get just the Angular2 files along with their d.ts files so I can code in typescript? If not, the same question for Aurelia. And if not, any way that I can keep bloat down yet still write some elegant front-end code.
Any help will be appreciated
Ok so for Development purposes yes your Angular 2 stuff will be massive (its annoying but necissary) however as I am sure you know, once you build your angular app for production (using angular cli for example) it cuts all those 40,000 files down to about 10. for example this is my application before and after production...
and after
So I would guess you want to build your angular stuff out first and then drop it in you application
Got a few issues setting up a project to do the full Java, Angular.js, TDD/BDD stack. So far these issues aren't a blocker, but they might turn into one.
I'm using Eclipse 4.6.0 Neon with the WTP, JSDT and Angular plugins.
The 2 red flags that I see waving at the moment are:
in the "Javascript Resources" folder, Eclipse is showing an "ECMA 3 browser support library". This should be ECMAscript 5 surely? (If not 6!) Since Neon just came out, it's a bit of surprise that I can't even change it as I can change the Java version for instance in the project facets dialog.
the HTML and CSS files are buried in src/main/webapp. I shouldn't have to do 3 clicks to get to them, they should be as easy to click to as the Java or JS files. How come there's no "Web Resources" to match the "Java Resources" and "Javascript Resources" in my project in the Project Explorer view?
Like I said at this point neither of these /seem/ to matter but I'd hate to waste loads of time on a problem in the future and find out I should have set up my project differently. I'm also quite happy to hear that this is impossible and I should split the technologies out into separate projects, like one for just web services and one for JS. To follow that train of thought to its conclusion, I'm also happy to hear that I should ditch Eclipse and go back to the command line.
Update 2016-08-01
The Eclipse project went into a nose-dive, locked into some never-ending process which I couldn't stop and couldn't identify after I created a bower.json project file.
I will separate the Java and JS into separate projects and take it from there. There is no need to keep them together except the benefit of having only one deployable artifact not 2, and right now that doesn't seem like such a big deal.
Answer for 2nd item [src/main/webapp requiring 3 clicks to drill down into (unlike the Java files)]:
You should be able to right-click on the /webapp/ folder, then select "Build Path" > "Use as Source Folder", and it will then be displayed at the same level as the Java (src/main/java) folder is, enabling you to drill into it with one click.
Here is how it looks in Eclipse's 'Package Explorer':
I found it easier to set up the Javascript / Angular.js, HTML and CSS in a separate project in Eclipse because the Eclipse project config probably went up the creek as I continually bashed away at it.
This means there have to be 2 deployable artifacts but at this point that's acceptable. When it comes to production and definitely if it becomes easier as the Eclipse JS tooling matures, I will recombine then into one project.
All the google top-ranking JS / Angular HOWTOs out there on the net assume no java or maven at all will come into it, but I have a variety of use-cases where I want the HTML in JSP files rather than as static files, so I created a project as Javascript, Java and Maven.
Also, there is an awesome looking Maven plugin frontend-maven-plugin
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
which is, quote:
Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins.
So this will take care of the continuous integration of browserify and grunt or gulp tasks.
It's easy to split out the HTML and CSS resources and put them into the WebContent directory that is automatically created for an Eclipse Dynamic Web Module. That makes them reachable with one click of the mouse in the folder tree (compared to 3 clicks in src/main/webapp).
In fact using the maven-war-plugin it is simple enough to tell Eclipse where to assemble the various parts from:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warSourceDirectory>${project.basedir}/WebContent</warSourceDirectory>
<webResources>
<webResource>
<directory>${project.basedir}/src/main/javascript</directory>
</webResource>
</webResources>
</configuration>
</plugin>
To bring in ECMAScript 5 or 6 support, I installed the Tern Eclipse plugin which doesn't quite take over the project configuration since Eclipse still shows the ECMA 3 Browser library in its properties dialog, but it provides code completion and validation.
Apparently this whole thing is easier with IntelliJ but hopefully this was the last big session on the Eclipse project config that I'll need to do for a while, so I won't be going there just yet. No idea about Netbeans.
Update 2016-09-23:
The Eclipse project configuration isn't very stable. At first the Angular plugin couldn't find my Angular code and flagged up errors in the HTML unless the Javascript is in the same directory or subdirectory where the HTML is. I discovered that these errors just disappeared after I recreated the Eclipse project from scratch.
The default validations carried out by Eclipse are also not good. They check everything in node_modules and bower_components unless turned off or reconfigured with a filter to exclude those directories (there are over 25 separate validation configurations to do).
Also, the Javascript outline view breaks when it tries to scan in the code in 3rd party libraries like angular.min.js or d3.min.js - there is a release 4.6.1 due at the end of September this year 2016 with a fix for this.
I want to know if someone has experienced problems editing code on a development team with members using eclipse and others phpstorm.
Thanks in advance.
In general, there should be no problem if team members use different IDEs. I use both on the same project in parallel, because each of the IDEs has its strengths and weaknesses.
One potential problem is that projects meta information is persisted in different forms between phpstorm and eclipse. Eclipse use a .project (and some other .* files depending on the project type) file in the root of the project directory. JetBrains products use a directory called '.idea`.
So, changes to the project settings made in phpstorm are not visible in eclipse and visa versa. That means changes in settings has to be communicated in other ways.
There is always the question if you should check in the .project and the .idea files. If everybody uses the same IDE I'd say yes. If team members use different IDEs it may not be clear what to do.
If you open the same project in two IDEs in the same time,
you should just remember to save files before switching to other IDE.
If any issues arise of differences, you should try how it works from command line.
For more general case see #Michael_Scharf answer