Skip to content

Conversation

@SMotaal
Copy link
Contributor

@SMotaal SMotaal commented Aug 28, 2024

This is the third PR to land instead of #37 and after #39 and #40:

  • Adds endoify.ts and endoify.test.ts to packages/extension/src
    • For clarity — sibling files importing ./endoified.js
  • Explicitly imports ./endoify.js in packages/extension/src/*.test.ts
    • For clarity and flexibility — test files need to be explicit
  • Configures vitest to use jsdom with vmThreads for packages/extension
    • For consistency and reduced configuration overhead
  • Adds guards against inlining script[src="endoify.ts"] and script[src="endoify.js"] in packages/extension/src/*.html
    • For efficacy and efficiency — parsing before vs after a failure makes no difference in speed, only in accuracy

@SMotaal SMotaal marked this pull request as ready for review August 28, 2024 18:47
@SMotaal SMotaal requested a review from a team as a code owner August 28, 2024 18:47
@SMotaal SMotaal changed the base branch from main to smotaal/test-endoify-vitest-split-shims August 28, 2024 19:24
@SMotaal SMotaal requested review from FUDCo and grypez August 28, 2024 19:25
SMotaal added a commit that referenced this pull request Aug 28, 2024
…es (#39)

This is the first PR to land instead of #37 before #40 and #41:

- Removes extraneous files from `packages/shims/src`
  - For consistency — we will keep forgetting them otherwise
- Adds `typescript` in `devDependencies`
  - For consistency - needed since #34
@SMotaal SMotaal requested a review from grypez August 31, 2024 19:40
SMotaal and others added 2 commits September 2, 2024 05:15
Co-authored-by: grypez <143971198+grypez@users.noreply.github.com>
Base automatically changed from smotaal/test-endoify-vitest-split-shims to main September 3, 2024 13:55
SMotaal added a commit that referenced this pull request Sep 3, 2024
This is the second PR to land instead of #37 after #39 and before #41:

- Renames `endoify.mjs` to `endoify.js` in `packages/{shims,extension}`
  - For consistency — now all `.mjs` files are renamed to `.js`
- Delegates bundling of `endoify.js` to `bundleSource`
  - For reliability and predictability — avoids making assumptions and resolving paths inside third-party packages
- Optionally subs `ZWJ`-prefixed identifiers introduced by `bundleSource` with conforming `CGJ` alternatives
  - For conformance — makes it possible to [experiment with `rollup`](https://www.smotaal.io/experimental/#/experimental/modules/shim/README.md) until [endojs/endo#2436](endojs/endo#2436) rolls out.
- Explicitly imports `./endoify.js` in `packages/shims/src/*.test.ts`
  - For clarity and flexibility — test files need to be explicit
- Configures `vitest` to use `jsdom` with `vmThreads` for `packages/shims`
  - For consistency and reduced configuration overhead — thanks to @grypez's exploration putting us on this path of least resistance with `vitest`
@SMotaal SMotaal enabled auto-merge (squash) September 3, 2024 14:24
Copy link
Contributor

@grypez grypez left a comment

Choose a reason for hiding this comment

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

Very clean. Approved!

@SMotaal SMotaal merged commit ae96251 into main Sep 3, 2024
@SMotaal SMotaal deleted the smotaal/test-endoify-vitest-split-shims-extension branch September 3, 2024 14:30
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