Skip to content

removed unused classNameCompressionMap to simplify code#1921

Merged
pancaspe87 merged 1 commit into
masterfrom
feat/removed-unused
Jul 15, 2026
Merged

removed unused classNameCompressionMap to simplify code#1921
pancaspe87 merged 1 commit into
masterfrom
feat/removed-unused

Conversation

@pancaspe87

@pancaspe87 pancaspe87 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

What is this change?

As discussed in #1920 (comment), we are removing classNameCompressionMap, a feature that was create over 3 years ago and was never shipped. This allows us to simplify codebase ahead of changes to the hash algorithm.


PR checklist

Don't delete me!

I have...

  • Updated or added applicable tests
  • Updated the documentation in website/ -> will do in another PR, I am tracking this in a ticket
  • Added a changeset (if making any changes that affect Compiled's behaviour)

@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for compiled-css-in-js canceled.

Name Link
🔨 Latest commit 41badc1
🔍 Latest deploy log https://app.netlify.com/projects/compiled-css-in-js/deploys/6a56d25447ded1000874254f

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 41badc1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@compiled/babel-plugin Major
@compiled/css Major
@compiled/react Major
@compiled/parcel-transformer Major
@compiled/webpack-loader Major
@compiled/vite-plugin Major
@compiled/babel-plugin-strip-runtime Major
@compiled/parcel-optimizer Patch
@compiled/parcel-optimizer-test-app Patch
@compiled/parcel-transformer-test-app Patch
@compiled/parcel-transformer-test-custom-resolve-app Patch
@compiled/parcel-transformer-test-custom-resolver-app Patch
@compiled/parcel-transformer-test-extract-app Patch
@compiled/parcel-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

t.arrayExpression(classNames),
])
);
path.replaceWith(t.callExpression(t.identifier('ax'), [t.arrayExpression(classNames)]));

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

get-runtime-class-name-library.ts is one of the files we deleted. Its only job was to decide which runtime function to emit:

return meta.state.opts.classNameCompressionMap ? 'ac' : 'ax';

ac = the compression-aware runtime (looks up compressed class names)
ax = the standard runtime (plain atomic class merging)
Since we removed compression entirely, this decision no longer exists — it's always ax.

@pancaspe87
pancaspe87 requested a review from xtan-atlas July 15, 2026 00:23
@@ -0,0 +1,17 @@
---
'@compiled/babel-plugin': major

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

feature is unused within Atlassian, setting it to major for other consumers

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We finally got a 1.0 🎉

preserveLeadingComments(path);

appendRuntimeImports(path, state);
appendRuntimeImports(path);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We removed state because the only reason it needed state was to check state.opts.classNameCompressionMap to decide whether to import ac or ax; it is no longer needs to know anything about state in packages/babel-plugin/src/utils/append-runtime-imports.ts

@pancaspe87
pancaspe87 merged commit f34e80d into master Jul 15, 2026
16 of 18 checks passed
@pancaspe87
pancaspe87 deleted the feat/removed-unused branch July 15, 2026 00:40
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