Skip to content

Use esm syntax for replay defaults and related maintenance#1176

Merged
matux merged 1 commit intomasterfrom
matux/rrweb-esm-export-defaults
Apr 28, 2025
Merged

Use esm syntax for replay defaults and related maintenance#1176
matux merged 1 commit intomasterfrom
matux/rrweb-esm-export-defaults

Conversation

@matux
Copy link
Copy Markdown
Contributor

@matux matux commented Apr 28, 2025

Description of the change

Description by Copilot.

This pull request refactors the module export structure across several files to adopt ES module syntax (export/import) instead of CommonJS (module.exports). The changes improve consistency, readability, and alignment with modern JavaScript standards.

Refactoring to ES module syntax:

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

@matux matux requested a review from Copilot April 28, 2025 10:49
@matux matux self-assigned this Apr 28, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors several files to adopt ES module syntax from CommonJS, improving consistency and modernizing the codebase. Key changes include:

  • Converting default exports in the browser defaults file to ES module exports.
  • Rewriting fixture files to use named exports and removing redundant export statements.
  • Removing the CommonJS module.exports block in the types definitions file.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/browser/replay/defaults.js Converted module.exports to export default for the default options object.
test/fixtures/replay/rrwebSyntheticEvents.fixtures.js Changed syntheticEvents to export const and removed redundant export statement.
test/fixtures/replay/rrwebEvents.fixtures.js Changed rrwebEvents to export const and removed redundant export statement.
test/fixtures/replay/types.js Removed the module.exports block in favor of individual exports.

@matux matux merged commit 00c0c2b into master Apr 28, 2025
4 checks passed
@matux matux deleted the matux/rrweb-esm-export-defaults branch April 28, 2025 11: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