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

Statically import SockJS in both modern and legacy bundles. #9985

Merged
merged 1 commit into from Jun 12, 2018

Conversation

benjamn
Copy link
Contributor

@benjamn benjamn commented Jun 12, 2018

Not including SockJS in the modern JS bundle was a nice bundle size savings (28KB before gzip), but SockJS works better than a native WebSocket for clients that are stuck in unusual networking situations, and the fallback of using dynamic import() to load SockJS when the native WebSocket failed was much slower than simply including SockJS in the bundle and using it from the start.

Moreover, the new meteor create --minimal starter app does not use socket-stream-client (nor DDP), so going back to including SockJS in both the modern and the legacy bundles should have no impact on the minimal modern bundle size.

If you want to continue using a native WebSocket instead of SockJS, you can always pin the older version of the socket-stream-client package:

meteor add socket-stream-client@0.2.1

Once this change is published, the workaround I suggested to @p3pp8 here will no longer be necessary: #9917 (comment)

Not including SockJS in the modern JS bundle was a nice bundle size
savings (28KB before gzip), but SockJS works better than a native
WebSocket for clients that are stuck in unusual networking situations, and
the fallback of using dynamic import() to load SockJS when the native
WebSocket failed was much slower than simply including SockJS in the
bundle and using it from the start.

Moreover, the new `meteor create --minimal` starter app does not use
socket-stream-client (nor DDP), so going back to including SockJS in both
the modern and the legacy bundles should have no impact on the minimal
modern bundle size.

If you want to continue using a native WebSocket instead of SockJS, you
can always pin the older version of the socket-stream-client package:

  meteor add socket-stream-client@0.2.1
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.

None yet

1 participant