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

convert everything to ESM #355

Merged
merged 10 commits into from
Feb 10, 2021
Merged

convert everything to ESM #355

merged 10 commits into from
Feb 10, 2021

Conversation

Rich-Harris
Copy link
Member

#349.

Most stuff doesn't work yet. The app-utils tests are passing, but the kit unit tests won't at least until the new version of Meriyah is released.

The integration tests in test don't work, because I haven't been able to get uvu to work with tests that are loaded asynchronously (cc @lukeed). The simplest way to see this is to cd test/apps/amp (after updating dependencies) and pnpm test:

(node:24774) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'push' of undefined

@Rich-Harris Rich-Harris mentioned this pull request Feb 1, 2021
lukeed and others added 2 commits February 1, 2021 18:38
* fix(test): manually control `UVU_QUEUE` positions;

Have to replicate the `uvu` internals since all internal loader/iterator logic is bypassed.

* fix: force `UVU_QUEUE` values

* chore: add `context.reset` method;

- chasing unterminated process

* fix(kit): return `snowpack.shutdown` promise

- so that `dev.close` is await'able

* fix(runner): manually exit process;

- also part of what uvu cli does; derp

* chore: convert "test/apps/basics" fixture

* chore: convert "test/apps/options" fixture
@benmccann
Copy link
Member

benmccann commented Feb 8, 2021

the kit unit tests won't at least until the new version of Meriyah is released

meriyah 4.1.1 is out now (though I'm having some trouble using it. I haven't tried it with this PR though)

@benmccann
Copy link
Member

I found another issue related to this. In the hn.svelte.dev example, after running svelte-kit build && svelte-kit adapt, there's a file functions/render/app.cjs and functions/render/index.js. The latter tries to do const app = require('./app.js'); which doesn't work now that the extension is .cjs. Should we switch the hn.svelte.dev example to be "type": "module" and convert app.cjs to app.js?

@Rich-Harris
Copy link
Member Author

yeah, i followed #356 up with #362 — will need the same thing here

@Rich-Harris
Copy link
Member Author

the import/no-unresolved lint failure is weird

@Rich-Harris Rich-Harris merged commit a00f0ee into master Feb 10, 2021
@Rich-Harris Rich-Harris deleted the gh-349 branch February 10, 2021 01:16
@benmccann benmccann mentioned this pull request Feb 10, 2021
benmccann pushed a commit that referenced this pull request Feb 10, 2021
* start converting everything to ESM

* more stuff

* chore: finish ESM conversion (#360)

* fix(test): manually control `UVU_QUEUE` positions;

Have to replicate the `uvu` internals since all internal loader/iterator logic is bypassed.

* fix: force `UVU_QUEUE` values

* chore: add `context.reset` method;

- chasing unterminated process

* fix(kit): return `snowpack.shutdown` promise

- so that `dev.close` is await'able

* fix(runner): manually exit process;

- also part of what uvu cli does; derp

* chore: convert "test/apps/basics" fixture

* chore: convert "test/apps/options" fixture

* bump meriyah

* all tests passing, i think?

* simplify

* get CLI working

* brute force

Co-authored-by: Luke Edwards <luke.edwards05@gmail.com>
@tanhauhau tanhauhau mentioned this pull request Feb 22, 2021
3 tasks
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