Giter VIP home page Giter VIP logo

Comments (3)

briancavalier avatar briancavalier commented on June 18, 2024

Hi @dizzib,

It's currently possible to compute the module id of a wire spec and pass it to wire, either when using wire as an AMD plugin or as a regular module. Below, getWireSpecId() can do anything it wants/needs to do to construct the module id of a wire spec:

// As AMD plugin
var mySpec = getWireSpecId();
require(['wire!' + mySpec], function(context) { ... });
// As AMD module
require(['wire'], function(wire) {
    var mySpec = getWireSpecId();
    wire(mySpec).then(function(context) { ... });
});

If you want the ability to determine the full url of the spec (i.e. crossing hostnames, etc.), you can configure your AMD loader (are you using curl?) to map wire spec ids (since they are just AMD modules) to whatever path/host/url you'd like.

Does that help? If not, could you provide some code examples that show what you are doing now, and what you would like to be able to do?

from wire.

dizzib avatar dizzib commented on June 18, 2024

That helps enormously!

Following your advice I've added the plugin-path to my curl paths, thereby causing my plugin code to be pulled off the internet.

Then to eliminate the hardcoding, I mix-in the computed plugin-path to my static curl config and pass this into curl just before the child gets wired.

Anyway, it's working a treat! Thanks for your help on this Brian, really appreciated :-)

from wire.

briancavalier avatar briancavalier commented on June 18, 2024

Great, glad that worked for you!

from wire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.