Skip to content

Commit

Permalink
refactor(compartment-mapper): Pivot to module descriptors (#2350)
Browse files Browse the repository at this point in the history
Refs: #400

## Description

XS does not support `compartment.module`. Rather than emulate it, I
chose bring SES into closer alignment with XS module descriptors and use
those instead. The Compartment Mapper is the only place we use this
feature at the moment.

### Security Considerations

None.

### Scaling Considerations

None.

### Documentation Considerations

None.

### Testing Considerations

The existing Compartment Mapper tests exercise this path rigorously.

### Compatibility Considerations

The new version of Compartment Mapper will not work with an older
version of SES. Lerna will make sure the constraint gets updated when we
release.

### Upgrade Considerations

None.
  • Loading branch information
kriskowal authored Jul 16, 2024
2 parents d7c6639 + c38ea2b commit 4040a51
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/compartment-mapper/src/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ const makeModuleMapHook = (
)}}`,
);
}
return foreignCompartment.module(foreignModuleSpecifier);
return {
compartment: foreignCompartment,
namespace: foreignModuleSpecifier,
};
}
}

Expand Down Expand Up @@ -310,7 +313,10 @@ const makeModuleMapHook = (
compartment: foreignCompartmentName,
module: foreignModuleSpecifier,
};
return foreignCompartment.module(foreignModuleSpecifier);
return {
compartment: foreignCompartment,
namespace: foreignModuleSpecifier,
};
}
}

Expand Down

0 comments on commit 4040a51

Please sign in to comment.