Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ses): Replace Rollup with Endo bundle #715

Merged
merged 2 commits into from
May 11, 2021
Merged

Conversation

kriskowal
Copy link
Member

@kriskowal kriskowal commented May 10, 2021

This change replaces the Rollup based bundle distribution files with bundles generated using the compartment mapper’s rudimentary bundler.

One negative consequence is that the minified bundle size increases by 2⨉ to 85KB.

Refs #175

merge target must be changed to master before merge

Copy link
Contributor

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +28 to +36
await write('dist/ses.cjs', bundle);
await write('dist/ses.mjs', bundle);
await write('dist/ses.umd.js', bundle);
await write('dist/ses.umd.min.js', terse);

await write('dist/lockdown.cjs', bundle);
await write('dist/lockdown.mjs', bundle);
await write('dist/lockdown.umd.js', bundle);
await write('dist/lockdown.umd.min.js', terse);
Copy link
Contributor

Choose a reason for hiding this comment

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

The fact that there are only two, but with eight names, is amusing. No change suggested.

Copy link
Member Author

Choose a reason for hiding this comment

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

True. This is the effect of architectural drift in this case. Before I changed the SES shim to effect its API strictly using globals, there was a difference between the CJS, MJS, and UMD treatments. Rollup continued to emphasize the difference in its configuration options, but the difference amounted to nothing except a vestigial SES global introduced by the UMD version. The lockdown versions were of course briefly different. We’re retaining all of these only to ease the migration path. In the end, we really only need ses.cjs (with the CJS extension strictly to navigate RESM to NESM portability) and ses.umd.min.js.

@@ -0,0 +1,37 @@
import '../index.js';
import fs from 'fs';
Copy link
Contributor

Choose a reason for hiding this comment

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

We should adopt some convention that we can check, for making sources of static authority stand out in our source files. Just noting. No change suggested at this time. Attn @dckc

Copy link
Member Author

Choose a reason for hiding this comment

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

This should also be a script that we run with Endo instead of Node, and it should be counted a design goal for Endo to accommodate injection of an attenuated FS and a decent DX for granting that capability to the script. For example, there might be some reasonable default filesystem attenuation for any Endo script run in the context of developer tools for a package, or at least a convenient piece of boilerplate we can add to package.json to grant that limited authority.

Copy link
Contributor

Choose a reason for hiding this comment

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

"DX"?

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