Skip to content

Repair build process#653

Open
shirte wants to merge 18 commits into
rdkit:masterfrom
shirte:repair-build-process
Open

Repair build process#653
shirte wants to merge 18 commits into
rdkit:masterfrom
shirte:repair-build-process

Conversation

@shirte

@shirte shirte commented Jun 12, 2026

Copy link
Copy Markdown

This pull request enables compiling recent versions of rdkit to wasm. The following changes were applied:

  • fetch code from rdkit tag instead of branch
  • -sUSE_ZLIB in CXX flags

Note: this pull request depends on #652, i.e. it contains all commits of it.

shirte added 18 commits June 12, 2026 13:43
To avoid interfering with unit tests in the Dockerfile, the ES version
is generated alongside the original CommonJS version.
Provide entrypoints for CommonJS (suitable for old code) and ES (modern
javascript). 

Use top-level await in the ES version to enable the user to import the
RDKit object using `import {RDKit } from "@rdkit/rdkit"`. Since CommonJS
doesn't allow top-level await, the corresponding entrypoint skips this.

Use typescript files (ts) to combine .js & .d.ts files and therefore
simplify the wrapper code.
Move type declarations into this folder. Use a placeholder file for
RDKit_minimal_esm.js to avoid errors in the code editor. When the
webassembly wrapper is generated, it will overwrite the placeholder
file.

Add a gitignore file that avoids tracking generated files.
Move tsconfig.json to root directory.

Create multiple tsconfig files for the CommonJS and ES entrypoints.

Upgrade typescript to version 5 to support `import type * from ...`.
Use "file:../.." for the @rdkit/rdkit dependency to make sure that the 
local version will be used. This simplifies development and testing.
Avoid copying files from the rdkit-js dist directory (and let the 
bundler do that).

Import initRDKitModule instead of using window.initRDKitModule.

Simplify statements importing types from "@rdkit/rdkit".
Disable telemetry in nextjs example. This also avoids the error message
"npm error This command does not support workspaces." when running "npm
run dev".

Avoid copying wasm files in nextjs configuration.
Add dependency @rdkit/rdkit (pointing to local version).
Demonstrate the new `import { RDKit } from "@rdkit/rdkit/es"` mechanism 
and simplify the RDKit loading procedure.

Remove unused dependency bulma-collapsible.

Add missing webpack dev dependency.

Add .gitignore file.
Rename example "vue" to "vue-example" to avoid conflicts when running 
`npm install` (since "vue" is also the name of the UI library).*

Add missing dependency hex-rgb.

Import initRDKitModule instead of using window.initRDKitModule.

Simplify type import statements.
Setting rdkitLoaded to true and calling draw() afterwards lead to a race
condition, because setState already rerenders the UI. Removing the
draw() call simplifies the code and avoids the warning in the console.
@shirte shirte requested a review from MichelML as a code owner June 12, 2026 04:12
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

@shirte is attempting to deploy a commit to the Valence Labs Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant