Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

FuseBox Event - import #341

Closed
leon-andria opened this issue Mar 3, 2017 · 6 comments
Closed

FuseBox Event - import #341

leon-andria opened this issue Mar 3, 2017 · 6 comments

Comments

@leon-andria
Copy link
Contributor

We know that we have before-import and after-import.
To keep consistence of the events, it is possible to have import on the line below https://github.com/fuse-box/fuse-box/blob/master/modules/fuse-box-loader-api/fusebox.js#L262 ?
It should looks like below:

if (file.locals && file.locals.module) {
    var args = [file.locals.module.exports, file.locals.require, file.locals.module, validPath, fuseBoxDirname, pkgName];
    $trigger("import", args);
    return file.locals.module.exports;
}

With this, if we are subscribing to import event so it looks like the other events.
Up to the developer to be responsible of his code.
On my use case, all events are activated on { debug: true }

@nchanged
Copy link
Contributor

nchanged commented Mar 4, 2017

That line happens on cache and a circular dependency call. I though we discussed it already

@leon-andria
Copy link
Contributor Author

I tested and there is no circular dependency call. Otherwise, i should reach a stack overflow, right?
Except you do it volontary on your code but this is a developer issue, not fusebox.

@leon-andria
Copy link
Contributor Author

leon-andria commented Mar 4, 2017

@nchanged Is there a chance to get a plan for this? This feature is required to make running our use cases.
If you don't want to make it, I need to know before changing a strategy and not relying on fusebox to make it.
Thanks,

@nchanged
Copy link
Contributor

nchanged commented Mar 4, 2017

@leon-andria there is now standalone : true option. Which will allow you to override the API. would that work for you?

@nchanged
Copy link
Contributor

nchanged commented Mar 4, 2017

The problem is that it adds a lot of kb to the API, and it's bloated already. We can make a different dist for your purpose.

@nchanged
Copy link
Contributor

nchanged commented Mar 4, 2017

#343

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants