How do you provide custom module/loader resolve logic to webpack? - plugins

Creating this question for reference.
The answer was provided by Webpack Core contributor Tobias Koppers

Tobias' Answer:
You can write a resolver plugin for this. resolve.modules is
translated into plugins here:
https://github.com/webpack/enhanced-resolve/blob/master/lib/ResolverFactory.js#L177-L182
Write a similar plugin for your own needs. You can pass it to
resolve.plugins.
A demo sample was created here: https://github.com/jchip/webpack-resolve-plugins-sample

Related

Manatee.Trello: Webhook Code Sample

I am looking for a code sample on how to use Manatee.Trello Webhook feature.
I found some documentation here: https://bitbucket.org/gregsdennis/manatee.trello/wiki/Webhooks, but it's not clear enough for me.
It only demonstrates how to create a Webhook, but doesn't demonstrate how the real-time updates are received and processed. Tried the Updated event on the Webhook, Card and Actions - but clearly I am not doing something correctly.
Any help would be appreciated.
This article demonstrates webhooks in general:
https://blogs.msdn.microsoft.com/webdev/2015/09/04/introducing-microsoft-asp-net-webhooks-preview/
Basically, there is a NuGet package Microsoft.AspNet.WebHooks.Receivers.Trello that you can install that does all the heavy lifting.
Once the NuGet package is installed I can override the built-in Controller and use Webhook.ProcessNotification() as Greg Dennis had suggested.
Hope someone out there finds this useful.
You'll need to set up the web portion yourself. This can be done with an ApiController (or others).
Once you receive a POST message, read the content as a string (don't deserialize), and pass that to Webhook.ProcessNotification(). Manatee.Trello well take care of the rest.
This will trigger the Updated events.
EDIT
I have created some better docs. Here is the example you seek!
https://gregsdennis.github.io/Manatee.Trello/examples/webhook.html#processing-a-webhook-notification

What is the 'transaction' command in Firebase-Unity Plugin?

I'm trying to use Firebase-Unity plugin. (https://www.firebase.com/blog/2015-12-18-firebase-unity.html)
Does anybody know what is the transaction command in this plugin?
Is it implemented in the plugin? If yes, can I see the sample code?
The Firebase-Unity plugin does not expose the complete underlying SDK functionality. The transaction() method of the Firebase SDK is one of the methods that is not exposed.
The author of the plugin recently commented somewhere on how to add such methods yourself. I'll see if I can find that link for you.
The tutorial that you've linked, https://www.firebase.com/blog/2015-12-18-firebase-unity.html is a good tutorial if not missing some steps.
Try this library out while following the tutorial above from Firebase: https://github.com/firebase/Firebase-Unity
Does that help?

Use Reference Documents for Lookups - Couchbase

Does anyone have an example related to reference documents for couchbase?
I have found this example: http://www.couchbase.com/docs/couchbase-devguide-2.0/reference-docs-and-lookup-pattern.html
But I need an example for the Java SDK.
Thanks
Nothing special here, as M03geek stated in his comment you have to do the same using the Java SDK.
I have created a gist for you:
https://gist.github.com/tgrall/6105234

Plugins in ViewModel

I'm new on MvvmCross and I want to use my plugin in my Model/ViewMode. I use the v3.
In some example I see IMvxServiceConsumer and GetService, but I guess that is the annotation for vNext but it seems to be different in the v3.
So, how can I do that?
Thanks
IMvxServiceConsumer<T> and GetService<T> were replaced with Mvx.Resolve<T> in v3.
Further, v3 provides constructor injection of dependencies - see http://slodge.blogspot.co.uk/2013/03/v3-new-viewmodel-lifecycle.html for information about how this decision was reached.
For plugins, N=8 in the tutorial series gives a quick and easy introduction to using the Location plugin. For more info see:
blog - http://slodge.blogspot.co.uk/2013/05/n8-location-location-location-n1-days.html
youtube - https://www.youtube.com/watch?v=AomjbED9AzM&list=PLR6WI6W1JdeYSXLbm58jwAKYT7RQR31-W&index=10
If you want to write a new plugin, then :
the up-to-date sample is https://github.com/slodge/MvvmCross-Tutorials/tree/master/GoodVibrations
there are some notes on this sample in https://speakerdeck.com/cirrious/plugins-in-mvvmcross

What is the use GWT generator?

I have seen that GWT framework is having generator feature.
In what case we have to use gwt generator option and why it is needed?
Can anyone tell me simply why,what is gwt generator? Done some googling. But not much helpful stuffs...
From this tutorial:
Generators allow the GWT coder to generate Java code at compile time and have it then be compiled along with the rest of the project into JavaScript.
This tutorial uses the example of generating a Map of values at compile time based on a properties file.
I've done GWT development for 3 years now and I've written one generator :) I've written a couple of linkers for experimental purposes so I think they are more common, though still rare. The classic case is where you want to write
X x = GWT.create(X.class)
and have the particular subclass or implementation of X constructed at compile time based on, perhaps, annotations in the provided X class or interface. GWT uses them for things like the CSSResource.
Search for "GWT Generator Experiments" site:development.lombardi.com on google for some info about what I did.
One of the use cases is to mimic reflection on the client side by building a factory class on the fly. I remember answering a question posted by you earlier on how to do this
How to create new instance from class name in gwt?
So i guess you already know the application. What else are you looking for? Can you be precise?
I've started using GWT Generators where I needed Java Reflection. I've documented One of the use cases for using GWT generators here:
http://jpereira.eu/2011/01/30/wheres-my-java-reflection/
Hope it helps.
If you refer to code generator, yes, there will a tool supporting GWT 2.1 code generation. For more details and a quick start, see http://www.springsource.org/roo/start
A general roo intro is here http://blog.springsource.com/2009/05/01/roo-part-1/
Another visual tutorial is at http://www.thescreencast.com/2010/05/how-to-gwt-roo.html
Check out this implementation:
http://samuelschmid.blogspot.com/2012/05/using-generator-for-generic-class.html
You can create new Instances of classes on client with foo.newInstance("fully.qualified.class.name");