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

bundle-source strips comments from type.js files? #1816

Open
dckc opened this issue Oct 7, 2023 · 1 comment
Open

bundle-source strips comments from type.js files? #1816

dckc opened this issue Oct 7, 2023 · 1 comment
Assignees
Labels
bug Something isn't working kriskowal-review-2024-01 Issues that kriskowal wants to bring to the attention of the team for review as of January, 2024

Comments

@dckc
Copy link
Contributor

dckc commented Oct 7, 2023

Describe the bug

bundle-source reduces several types.js files to more or less an empty module.

@endo/marshal-v0.8.5/src/types.js
@endo/pass-style-v0.1.3/src/types.js
@endo/patterns-v0.2.2/src/types.js
@endo/promise-kit-v0.2.56/src/types.js
@endo/zip-v0.2.31/src/types.js

Steps to reproduce

  1. bundle a file such as marshal/src/types.js using yarn bundle-source --cache-json /tmp/bx src/types.js x
  2. Note that it has non-trivial type declarations in it: grep EncodingUnion src/types.js
  3. Note that the bundled version does not:
    1. jq -r .endoZipBase64 /tmp/bx/bundle-x.json| base64 -d >,x.zip
    2. unzip ,x.zip
    3. grep EncodingUnion @endo/marshal-v0.8.8/src/types.js

Expected behavior

Contents of source files should be substantially preserved, including comments.

Platform environment

ubuntu linux 22.04.3 LTS
node v18.17.1
endo version 1e2be8eaa @endo/base64@0.2.34-129-g1e2be8eaa
which is the same as c2b3905 except for some unrelated files

also tested on master 877be98

Additional context

contents of the file as well as length (308 bytes) and sha512:

$ cat @endo/marshal-v0.8.8/src/types.js 
{"imports":[],"exports":[],"reexports":[],"__syncModuleProgram__":"(({   imports: $h‍_imports,   liveVar: $h‍_live,   onceVar: $h‍_once,   importMeta: $h‍____meta,  }) => {   $h‍_imports([]);   \n})\n","__liveExportMap__":{},"__reexportMap__":{},"__fixedExportMap__":{},"__needsImportMeta__":false}

$ wc -c @endo/marshal-v0.8.8/src/types.js 
308 @endo/marshal-v0.8.8/src/types.js

$ sha512sum @endo/marshal-v0.8.8/src/types.js 
98a851bdbf2f4dd09a13b521130e299f9d1955ae19291627cd28df4fb5d4878ecdf7ce2b22a5670b4397bf490b80d8982481db5ceb224b10afdefe5c44506265  @endo/marshal-v0.8.8/src/types.js
@dckc dckc added the bug Something isn't working label Oct 7, 2023
@dckc
Copy link
Contributor Author

dckc commented Oct 7, 2023

a bit more context: I'm prototyping bundleParts.js, a tool to exclude already-loaded parts of a bundle, as an exploration into...

See also:

@kriskowal kriskowal self-assigned this Jan 6, 2024
@kriskowal kriskowal added the kriskowal-review-2024-01 Issues that kriskowal wants to bring to the attention of the team for review as of January, 2024 label Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kriskowal-review-2024-01 Issues that kriskowal wants to bring to the attention of the team for review as of January, 2024
Projects
None yet
Development

No branches or pull requests

2 participants