Skip to content

Useless exports, and broken IIFE #343

Closed
@bytestream

Description

@bytestream
  • Echo Version: 1.12.0
  • Laravel Version: 9.18.0
  • PHP Version: 8.1.7
  • NPM Version: 8.11.0
  • Node Version: 16.15.1

Description:

In v1.11.5 the IIFE distribution file was broken by #333. In my opinion, the new exports are completely useless given classes are already exported in their own right:

They can be used without modification to the library, by simply:

import { PresenceChannel } from 'laravel-echo/src/channel'

The changes break the IIFE distribution by exporting multiple objects. The change results in new usage:

var myEcho = new Echo.default({});

This was highlighted in #336 already, but closed as unsupported. If that's the case, then I would suggest that the IIFE distribution is removed. However, that seems unnecessary given the changes in #333 are unnecessary and if they were to be reverted then the IIFE distribution would work again...

Steps To Reproduce:

Use the dist/echo.iife.js file:

<script src="echo.iife.js"></script>
<script>var myEcho = new Echo({});</script>
Uncaught TypeError: Echo is not a constructor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions