Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [9.1.1-alpha.1](https://github.com/parse-community/parse-dashboard/compare/9.1.0...9.1.1-alpha.1) (2026-04-07)


### Bug Fixes

* Broken CSS styling for components with underscore class names ([#3328](https://github.com/parse-community/parse-dashboard/issues/3328)) ([2048abe](https://github.com/parse-community/parse-dashboard/commit/2048abe1322f27f08497d62f141c2540cf7a4eb6))

# [9.1.0-alpha.12](https://github.com/parse-community/parse-dashboard/compare/9.1.0-alpha.11...9.1.0-alpha.12) (2026-04-07)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse-dashboard",
"version": "9.1.0",
"version": "9.1.1-alpha.1",
"repository": {
"type": "git",
"url": "https://github.com/parse-community/parse-dashboard"
Expand Down
74 changes: 74 additions & 0 deletions src/lib/tests/CssModules.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright (c) 2016-present, Parse, LLC
* All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/

const webpack = require('webpack');
const path = require('path');
const fs = require('fs');
const os = require('os');

function runWebpack(config) {
return new Promise((resolve, reject) => {
webpack(config, (err, stats) => {
if (err) {
return reject(err);
}
if (stats.hasErrors()) {
return reject(new Error(stats.toJson().errors.map(e => e.message).join('\n')));
}
resolve(stats);
});
});
}

describe('CSS modules', () => {
let tmpDir;

beforeAll(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'css-modules-test-'));

fs.writeFileSync(
path.join(tmpDir, 'test.scss'),
'.test_underscore_class { color: red; }\n.testCamelCase { color: blue; }\n'
);

fs.writeFileSync(
path.join(tmpDir, 'entry.js'),
'const styles = require("./test.scss");\n'
);
});

afterAll(() => {
fs.rmSync(tmpDir, { recursive: true, force: true });
});

it('preserves underscore class names in exports', async () => {
const baseConfig = require('../../../webpack/base.config.js');
const scssRule = baseConfig.module.rules.find(r => r.test.toString().includes('scss'));

await runWebpack({
mode: 'production',
entry: path.join(tmpDir, 'entry.js'),
output: {
path: tmpDir,
filename: 'bundle.js',
},
module: {
rules: [{ test: /\.scss$/, use: scssRule.use }],
},
});

const bundle = fs.readFileSync(path.join(tmpDir, 'bundle.js'), 'utf8');

// Class names with underscores must be preserved as-is in the JS exports,
// not converted to camelCase (e.g. testUnderscoreClass).
// This broke when css-loader was bumped from v6 to v7, which changed the
// default exportLocalsConvention from 'asIs' to 'camelCaseOnly'.
expect(bundle).toContain('test_underscore_class');
expect(bundle).toContain('testCamelCase');
}, 30000);
});
1 change: 1 addition & 0 deletions webpack/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
options: {
modules: {
namedExport: false,
exportLocalsConvention: 'as-is',
},
importLoaders: 2,
},
Expand Down
Loading