Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(umd): fix the UMD bundle export names so they don't conflict and overwrite each other #318

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

trxcllnt
Copy link
Member

@trxcllnt trxcllnt commented Jan 26, 2021

Importing multiple UMD bundles into the same page was causing the global Ix object to be replaced
each time, rather than augmented. Exporting them to distinct global objects based on the file name
causes them not to conflict.

Here's an example of something that would currently conflict. Depending on which file was imported, either from or flatMap wouldn't be available:

<!DOCTYPE html>
<html><body>
<script src="/targets/esnext/umd/Ix.dom.asynciterable.js"></script>
<script src="/targets/esnext/umd/Ix.dom.asynciterable.operators.js"></script>
<script type="text/javascript">
const { from } = IxAsynciterable;
const { flatMap } = IxAsynciterableOperators;
from([0, 1, 2])
  .pipe(flatMap((x) => [x + 1]))
  .forEach((x) => console.log(x))
</script>
</body></html>

…overwrite each other

Importing multiple UMD bundles into the same page was causing the global Ix object to be replaced
each time, rather than augmented. Exporting them to distinct global objects based on the file name
causes them not to conflict.
@trxcllnt trxcllnt merged commit c45eaa8 into master Jan 26, 2021
@trxcllnt trxcllnt deleted the fix/umd-export-names branch January 26, 2021 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant