The project templates for Visual Studio 2012 contain a reference package with javascript, localization files and styles.
What I am wondering is how to build a custom reference package with my code, locales and styles. There is absolutely no information about this on the web, I tried referring to MSDN, but it did not give me any clue as to how I can do this. Please share any useful information that you may have about this.
It turns out Microsoft do have documentation on Extension SDKs.
Update:
I actually managed to get the reference/framework package. It all works really well except when opening Expression Blend with my package referenced. Notice the reference is there and I can actually see all components and their description but I'm still getting an error in the design surface. Here is what the error looks like (I know, it's very descriptive):
Update:
When trying to deploy an app referencing the framework package I have created I being given an error saying that it cannot find my framework but instead finds some framework with trailing symbols that I did not put there while packaging it. It appends the processor architecture as well as the package family name trailing symbols. Here's a screenshot:
The item you are looking at is a "Framework Package". While it is possible for you to generate a package that looks like a framework package (look at the appxmanifest.xml for the WinJS package in \Program Files\WindowsApps), you cannot get that package ingested into the store.
This is something that is not supported in Win8 -- you'll need to include the files you need in each package you build.
Related
I was wondering if there is a way to use NPM packages in Android project with Kotlin. I know there is a Gradle plugin kotlin.js and it seems to work with a standalone project like a demo provided by JetBrains, but when I try to use it with Android I get this error:
Cannot add extension with name 'kotlin', as there is an extension already registered with that name.
There is even a little tutorial on how to setup kotlin/js, also provided by JetBrains, but there is nothing new.
I'm asking because I want to start a little multiplatform project, but the core part of it is a library, which I had written some time ago, but it is in Java, and it is heavily dependant on BouncyCastle and some other libraries that handles XML serialization, so there is no luck with that. But I found a similar library in JavaScript. And since I can not use any Java dependency with kotlin/multiplatform there are two options for me, either find a way to make Kotlin/JS work with Android project or move on to React-Native, which I like, but I would prefer Kotlin.
I am playing around with Electron and WebStorm as part of a project preparation and I am struggling with different problems. Therefore I want to start simple by creating very basic stuff and working my way up.
So I have a very simple project setup in WebStorm and my first Electron app is running. But WebStorm keeps saying that it cannot resolve function names.
Electron and electron-prebuilt are added to the package.json and Node.js coding assistance is enabled. Therefore require('electron') is recognised correctly.
I saw the blog entry by JetBrains on how to start with Electron in WebStorm and found also another similar answer here on StackOverflow.
JetBrains' blog entry
StackOverflow answer
It is said, that one should add github-electron to the JavaScript library from the communitie-stubs repositories. But these seems outdated, as there is no github-electron anymore and all other electron entries are ambiguous.
So my question is: How to setup WebStorm for plain JS ES6 correctly, beginning by eliminating the "unresolved" messages?
So, after digging into the topic more and more and climbing the steep learning curve, I finally found the answer by myself.
Here we go:
Go to WebStorm's Preferences / Languages & Frameworks / TypeScript
Make sure Use TypeScript Service is enabled
Open up WebStorm's Terminal panel (as it will automatically point to your project's working directory) and install the type definitions for TypeScript via NPM:
npm install #types/electron
You don't need to use the --save / --save-dev tags, as the types are needed solely for WebStorm's code assistance and have no impact on your project.
You'll get a new entry inside your node_modules folder containing the type definitions.
And that's it. WebStorm does not show any unresolved function or method messages for this particular module anymore.
This works for theoretically every other module, as long as there are type definitions available. But chances are good, as there are a lot of them. Way more than what WebStorm's JavaScript library download functionality offers.
Have a nice day, everyone!
Martin
install the electron library. Since the github-electron has renamed to electron.
Sorry if this is a dumb question, I've tried to google for the answer and can't find anything definitive.
I added the following package https://atmospherejs.com/rcy/nouislider
by entering the command meteor add rcy:nouislider
I am unsure if there any more steps from here. Do I need to import the package at the top of my JS file or can I go ahead and just start using it without any other steps?
Atmosphere packages should not need to be imported. The older packaging system did that for you, and the global variable 'noUiSlider' should be available to your code for you to use like in the documentation.
If you are interested, you can download the package code and see how it's put together. Just like a Meteor project there is client and server code. See here for more details: https://guide.meteor.com/writing-atmosphere-packages.html
I was going through the React codebase, and I noticed how React's require doesn't quite behave like in Nodejs. I don't get what's going on here.
Looking at line 19 on ReactClass.js for instance, there's a require('emptyObject'), but emptyObject isn't listed in package.json, nor does it say anywhere where that module's coming from.
https://github.com/facebook/react/blob/master/src/isomorphic/classic/class/ReactClass.js#L19
I did find "emptyObject" on npmjs, but the API there seems different from the one used in React; the .isEmpty grepped in React isn't related to emptyObject.
So where is emptyObject getting loaded from, and how is React's require doing what it's doing? This is not intuitive. At all.
The location of the emptyObject module which React refers to is https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/emptyObject.js#L9 Note that it doesn't follow the CommonJS module system.
To make it easier for Facebook to share and consume our own JavaScript. Primarily this will allow us to ship code without worrying too much about where it lives, keeping with the spirit of #providesModule but working in the broader JavaScript ecosystem.
From https://github.com/facebook/fbjs#purpose
The way of defining a module by adding #providesModule in the license header and loading those modules with require in Node is called Haste, a customized module system built for Facebook's open source projects.
In fact, unless you would like to understand the inner workings of React or contribute to Facebook's open source projects, you don't need to know that. In other words, it's not recommended to use Haste to write your own project.
Along the same lines, the invariant module being loaded at line 10 of ReactClass.js is declared at https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/__forks__/invariant.js#L9
As far as I know, both Eclipse and WebStorm don't support Haste so IDE can't help. But with Haste, the name of file and module should be the same, so you can find a module by searching for the filename, i.e. double shift in Webstorm and Ctrl+Shift+r in Eclipse. However, the emptyObject you asked about or invariant are not part of React so it's still cumbersome to find their origin.
Otherwise, there is a team that shares and organizes what they learn from hacking React that I contribute to occasionally and they have linked those requires by following Haste to the corresponding origin file e.g. https://annot.io/github.com/facebook/react/blob/cc3dc21/src/isomorphic/classic/class/ReactClass.js?l=19 You may want to see that.
I noticed how React's require doesn't quite behave like in Nodejs.
Right. Facebook has its own module loader. All modules have unique identifiers, provided by the #providesModule directive in each module. This allows you to use the identifier to load the module, instead of the file path.
Of course that doesn't work in a Node.js based environment. So when React or any other Facebook project is published to npm, all require calls are rewritten automatically to something that Node understands.
This functionality is provided by fbjs which contains shared dependencies and build helpers for all Facebook projects. This is where you find the emptyObject module.
If you look at React's gulp file, you can see how the module maps are constructed and that a custom Babel plugin is used to convert all require calls.
I'm trying to incorporate a Twitter Bootstrap template with Meteor and I'm having trouble understanding how I should include files. For example, let's start with Bootstrap itself, should I install it with Meteor/Meteorite or do it manually with script includes? Same for other javascript plugins (e.g. jquery <- this one is builtin to Meteor right?, lightbox.js.. etc.)
Hope I'm making sense, thanks!
By default meteor already includes jquery.
It's best to look to get your plugins installed via Meteorite. So something like this could get you started
sudo -H npm install -g meteorite
Then in your project directory
mrt add bootstrap-3
For other plugins you can't find on atmosphere add the files into a directory in your project /client/lib. Meteor will automatically reference the files for you, both css and js.
This way they only run on the client side and are loaded first. (such as lightbox.js)
You might have to modify a few files with Meteor, though. In meteor each file's variables are file-scoped. So you can't access them from other files. (meteor basically throws a (function() {..}).call() around the code.
So if you get some kind of issue about a variable being undefined look for the variable and remove the var keyword and remove it so that the variable/method becomes global. With jquery plugins this usually isn't a problem.
Most that have the variable scoping issues are on http://atmosphere.com so you shouldn't run into too many problems.
The most common libraries such as jQuery and Bootstrap (v2.3.0) are provided by the Meteor core (v0.6.6.3). They can be listed using meteor list and included with meteor add.
As referred before, Atmosphere is a collection of unofficial Meteor packages giving an easy way with Meteorite to include even 3rd party solutions to your own project.
Moreover, you should learn the Meteor App structure. Directories created on your project have different preferences in terms of files visibility and loading order. I recommend reading Ritik Malhotra's presentation about the App structure at http://www.slideshare.net/RitikM/building-a-production-ready-meteor-app. There's also a Youtube video about his presentation that can be watched here http://www.youtube.com/watch?v=gfFGjmiKfnA.