Closed wegry closed 2 months ago
I assume this is intended as a stepping stone toward not bundling the InboxSDK at all.
It seems like this would switch us to publishing using ESM instead of CommonJS. Could this break users who were doing import InboxSDK from '@inboxsdk/core';
(instead of import * as InboxSDK from '...';
)? Does that work currently? If it did, we would need to decide whether to document that as a breaking change or to add a default export to make that still work.
I assume this is intended as a stepping stone toward not bundling the InboxSDK at all.
@Macil that's my intention. Ultimately, I think, we'd want a named exports for what are currently "namespaces" in the InboxSDK
global.
It seems like this would switch us to publishing using ESM instead of CommonJS. Could this break users who were doing import InboxSDK from '@inboxsdk/core'; (instead of import * as InboxSDK from '...';)?
This actually would break in the reverse in 994571d2ec679e1242fa09dae6b4edbd584dbbaa. I'd prefer to ultimately only support the wildcard form of import. That'd be another breaking change if we didn't include it with this though. edit: cb0084c only supports the wildcard form of import.import InboxSDK from '@inboxsdk/core'
(default import) would work. import * from '@inboxsdk/core
(wildcard import) would stop working.
Does that work currently? If it did, we would need to decide whether to document that as a breaking change or to add a default export to make that still work.
Yeah, this is a breaking change. My understanding is that CJS being consumed by a bundler with support for it will work with either a default or wildcard import. Switching to ESM from UMD also removes the InboxSDK
global provided by webpack's entry.library.name
.
This PR may sit until Streak moves off of MV2 SDK support.
We now depend on the importing project's dependencies. Common dependencies like
lodash
being shared makes the package much lighter. It also highlights some older libraries we should probably remove.This is a potentially breaking change for
@inboxsdk/core
consumers. Among other things:@inboxsdk/core
is now published as ESM only.@inboxsdk/core
. Useimport * as InboxSDK from '@inboxsdk/core'
instead.Closes #981.