Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] difficulties porting plugin to Orion 4.0 RC2

I think we should consider folding this into plugin.js (for 5.0). Our story in the past was that plugin.js had everything a plugin author needed for communication with the main page. That is a nice clean story, and as soon as they need to start pulling in other scripts it becomes more complicated for them - where do they get the extra scripts, when are they needed, are they versioned, etc. It is one more script they need to copy or include to get their plugin working.

John



From:        Mark Macdonald <mamacdon@xxxxxxxxx>
To:        Orion developer discussions <orion-dev@xxxxxxxxxxx>,
Date:        11/01/2013 12:06 AM
Subject:        Re: [orion-dev] difficulties porting plugin to Orion 4.0 RC2
Sent by:        orion-dev-bounces@xxxxxxxxxxx




Rafael,

You're right, this is an important point that we should call out. I will update the API docs.


On Thu, Oct 31, 2013 at 4:09 PM, Rafael Chaves <rafael@xxxxxxxxxxxx> wrote:
Hi Simon,

Thanks for clarifying - I had done what you suggested but until you replied wasn't sure that was the right thing to do.

It seems to me the implicit dependency on Deferred should be made more visible in the docs for plugin development, since for implementing services such as the edit.outliner, caling getText() on the editorContext will fail in a non-obvious way (becuase it is supposed to return a deferred).   

Thanks,

Rafael


On Thu, Oct 31, 2013 at 2:57 PM, Simon Kaegi <Simon_Kaegi@xxxxxxxxxx> wrote:
Hi Rafael,

That boiler plate gorp at the top of orion/PluginProvider (sometimes called UMD - unified module definition) is used to allow Orion plugins to be used in different module environments (e.g. Node, RequireJS/AMD, and as globals). It sounds like you're not using RequireJS in your plugin so are in the "global" definition camp.


Plugin.js optionally depends on orion/Deferred to handle cases where we need to use promises to handle async logic so in your case the reason you are getting the Deferred symbol as "undefined" is because you don't have a script tag contributing it.


Try adding something like:
<script src=""> to your plugin.


Now, with that said I'm not sure that is the problem here as the dependency on Deferred is again "optional" and not needed for simple plugin cases. If however your plugin is firing "events" or passing "object references" then you will need this.
Let us know if you figure out more and we'll help you upgrade.


Hope that helps...
-Simon



Inactive hide details for Rafael Chaves ---10/31/2013 11:27:34 AM---Hi all. I am in the process of porting a plugin from Orion Rafael Chaves ---10/31/2013 11:27:34 AM---Hi all. I am in the process of porting a plugin from Orion 1.0 (RC2) to Orion


From:

Rafael Chaves <
rafael@xxxxxxxxxxxx>

To:

Orion developer discussions <
orion-dev@xxxxxxxxxxx>,

Date:

10/31/2013 11:27 AM

Subject:

[orion-dev] difficulties porting plugin to Orion 4.0 RC2

Sent by:

orion-dev-bounces@xxxxxxxxxxx





Hi all.

I am in the process of porting a plugin from Orion 1.0 (RC2) to Orion
4.0 (RC2). Right now I am having a hard time getting the plugin to
work with the new plugin.js. I am by no means experienced with JS so
that is probably the reason of my struggle. But I am seeing the
plugin.js ending up with the "Deferred" symbol being undefined.
Basically, in this code:

   if (typeof define === "function" && define.amd) { //$NON-NLS-0$
       define(["orion/Deferred"], factory);
   } else if (typeof exports === "object") { //$NON-NLS-0$
       module.exports = factory(require("orion/Deferred"));
   } else {
       root.orion = root.orion || {};
       root.orion.PluginProvider = factory(root.orion.Deferred);
   }

the last else is the block executing, and since root.orion is
undefined, it falls back to {}, so root.orion,Deferred of course will
be undefined as well.

I suspect that my root issue may originate before this initialization
code runs but I have no idea of what it is. Any tips?

Rafael

_______________________________________________
orion-dev mailing list

orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev




_______________________________________________
orion-dev mailing list

orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



_______________________________________________
orion-dev mailing list

orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev

_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev


Back to the top