Conversation
We now build
index.js
dev.js
cjs/index.js
cjs/dev.js
This is needed so that Next.js can skip using ES modules which it does
not fully support (no support for import.meta.url). In Next.js you need
to do:
```js
require('replicache/cjs')
```
Sorry @aboodman, I could not make Next.js work with a bare module
specifier :'(
|
This pull request is being automatically deployed with Vercel (learn more). replicache-sdk-js – ./🔍 Inspect: https://vercel.com/rocicorp/replicache-sdk-js/EFHkWW5fsrfaFBoP6qDTCZtu8ajm lithtml-todo-sample-ui – ./sample/lit-todo🔍 Inspect: https://vercel.com/rocicorp/lithtml-todo-sample-ui/5mrEVBiDhNJCSFqeuK75pHyovpcg replicache-sdk-js-perf – ./dev/bench🔍 Inspect: https://vercel.com/rocicorp/replicache-sdk-js-perf/EQfH1BCspM5gxrJ3cHaEoR8PcdDS |
.github/workflows/node.js.yml
Outdated
| node-version: 14.x | ||
| - uses: microsoft/playwright-github-action@v1 | ||
| - run: npm ci | ||
| - run: npm run get-repc |
There was a problem hiding this comment.
I removed the get-repc from npm install flow since we already include the wasm files in the npm package.
There was a problem hiding this comment.
github action runs from the git checkout. Not by installing the npm package
There was a problem hiding this comment.
I should use npm prepare. That gets called when doing npm install (but not when doing npm install foo) as well as when doing npm publish and npm pack
|
ah, ok!
…On Tue, Mar 23, 2021 at 1:21 PM Erik Arvidsson ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In .github/workflows/node.js.yml
<#327 (comment)>
:
> @@ -17,6 +17,7 @@ jobs:
node-version: 14.x
- uses: ***@***.***
- run: npm ci
+ - run: npm run get-repc
github action runs from the git checkout. Not by installing the npm package
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAATUBHTQ3YUO6GQIDK6ZLDTFEOVJANCNFSM4ZV2AO7Q>
.
|
package.json
Outdated
| "doc": "typedoc src/mod.ts", | ||
| "build": "rollup --config rollup.config.js", | ||
| "build-dev": "DEV=1 rollup --config rollup.config.js", | ||
| "build-all": "rollup --config rollup.config.js && DEV=1 rollup --config rollup.config.js && CJS=1 rollup --config rollup.config.js && CJS=1 DEV=1 rollup --config rollup.config.js", |
There was a problem hiding this comment.
out of curiosity, why do we use rollup instead of letting tsc generate one module type or another?
There was a problem hiding this comment.
tsc does not create a single file. It does not copy over the wasm/{debug,release}/replicache_client.js file
We still include the ESM file in the npm package but we do not tell npm about it. You can use it bey importing "replicache/out/replicache.mjs" for now.
We now build
index.js
dev.js
cjs/index.js
cjs/dev.js
This is needed so that Next.js can skip using ES modules which it does
not fully support (no support for import.meta.url). In Next.js you need
to do:
Sorry @aboodman, I could not make Next.js work with a bare module
specifier :'(