remove private api from MissingExport hook - #1987
Conversation
| legacy: boolean; | ||
| load: (id: string) => Promise<SourceDescription | string | void>; | ||
| handleMissingExport: MissingExportHook; | ||
| handleMissingExport: (module: Module, name: string, otherModule: string, start?: number) => void; |
There was a problem hiding this comment.
I take it module is the importer here, and start is the index in the importer? How about exportName, importingModule, importedModule, importerStart?
There was a problem hiding this comment.
updated the wording and order.
guybedford
left a comment
There was a problem hiding this comment.
Much better, would be great to get this in.
I'd still be interested to hear more background on the use cases here.
|
https://github.com/jmurphyau/ember-truth-helpers/blob/v2.0.0/app/helpers/not-eq.js#L1 define('ember-truth-helpers/helpers/not-equal', ['exports'], function (exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.notEqualHelper = notEqualHelper;
function notEqualHelper(params) {
return params[0] !== params[1];
}
exports.default = Ember.Helper.helper(notEqualHelper);
});define('my-app/helpers/not-eq', ['exports', 'ember-truth-helpers/helpers/not-equal'], function (exports, _notEqual) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function () {
return _notEqual.default;
}
});
Object.defineProperty(exports, 'notEq', {
enumerable: true,
get: function () {
return _notEqual.notEq;
}
});
});This is why I need a missing export hook, and a way to continue the graph traversal for backwards compatibility. The hook allows me to return true so rollup can continue without stopping, and a way to print a deprecation message to Ember users. Does that make sense? |
709ce83 to
81f6753
Compare
|
Completely, thanks for explaining it to me here! The thing to note is that this won't ever support the So ideally we should actually remove the missing export from the analysis entirely so that tracing can go on without it I think. |
|
Actually thinking through the cases here I believe this will output correctly even for es modules with code splitting, as we only create the import/exports where tracing succeeds. So this looks good to merge here to me. |
81f6753 to
7beb866
Compare
Closes #1973.
I don't think calling
Modulefunctions is going to be necessary after all.