Skip to content

Conversation

@lzxb
Copy link
Contributor

@lzxb lzxb commented Nov 4, 2025

Summary

This PR refactors the import map utility functions to have more semantically clear names that better reflect their actual purpose and functionality.

Changes

Function Renames

  • → - Better semantic meaning for creating import mappings
  • → - Better semantic meaning for creating scope mappings
  • → - More specific name indicating it fixes nested scopes in import maps
  • → - Better semantic meaning for creating complete import maps

Additional Improvements

  • Updated all function references and imports across the codebase
  • Updated comments to reflect cross-browser compatibility issues (not just Chrome-specific)
  • Updated all test cases to use the new function names
  • All tests pass successfully

Rationale

The original function names were not semantically clear:

  • functions were actually functions
  • was creating, not retrieving
  • was too generic and didn't indicate it was specifically for import maps

The new names provide better clarity about what each function actually does, improving code readability and maintainability.

Testing

  • All existing tests pass with the new function names
  • No functional changes were made, only naming improvements
  • Test coverage remains the same

Breaking Changes

This is a breaking change for any external code that imports these utility functions directly. Internal usage within the Esmx framework has been updated accordingly.

…rity

- Rename buildImportsMap → createImportsMap for better semantic meaning
- Rename buildScopesMap → createScopesMap for better semantic meaning
- Rename fixNestedScopesResolution → fixImportMapNestedScopes for better semantic meaning
- Rename getImportMap → createImportMap for better semantic meaning
- Update all function references and imports
- Update comments to reflect cross-browser compatibility issues
- Update test cases to use new function names
- All tests pass successfully
@lzxb lzxb closed this Nov 4, 2025
@lzxb lzxb deleted the refactor/import-map-function-names branch November 4, 2025 12:24
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.

2 participants