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

Announcing Scala.js 1.16.0. #631

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Announcing Scala.js 1.16.0. #631

merged 1 commit into from
Mar 19, 2024

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Mar 17, 2024

For announcement on Tuesday, assuming everything goes well.

@sjrd sjrd requested a review from gzm0 March 17, 2024 21:51
title: Announcing Scala.js 1.16.0
category: news
tags: [releases]
permalink: /news/2023/01/26/announcing-scalajs-1.16.0/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong date?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Good catch.

This is why Scala.js has leveraged Closure since the very first relase.
Closure's so-called "advanced optimizations" assume that the JavaScript program fits in a specific subset of semantics, which allows it to rename properties.

Unfortunately, despite ECMAScript modules being standard for several years now, Closure has never supported them in the way we need it to.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sentence is a bit misleading. IIUC we could use GCC with CJS modules because it doesn't support (i.e. ignores) them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rephrased. Is it better now?

@sjrd sjrd requested a review from gzm0 March 18, 2024 12:28
Copy link
Contributor

@gzm0 gzm0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This has resulted in large bundle sizes for users of ES modules.

Our minifier, which is aware of our types and of Scala.js semantics, fills that gap between Closure and general-purpose minifiers.
When combined with a general-purpose minifier such as the one bundled with Vite, the new optimizations bring code size around 15% bigger than Closure.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjrd @gzm0 Thanks so much for this highly awaited feature.

Just curious, what are the reasons Closure can still be better than the new Scala.js optimizer and a good general-purpose minifier? Are there hopes for a better than Closure fullOpt ES modules optimizer solution?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Closure had several engineers working on it for more than a decade, probably. ;)

More precisely, because we don't do everything that could be done. At least not yet. It's likely that we will get progressively closer, over time.

@sjrd sjrd merged commit 83737a9 into scala-js:main Mar 19, 2024
1 check passed
@sjrd sjrd deleted the scalajs-1.16.0 branch March 19, 2024 10:38
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.

3 participants