fix: [] adaptive-expression does not work in the browser anymore#574
fix: [] adaptive-expression does not work in the browser anymore#574ceciliaavila wants to merge 5 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughSplit the browser build into clean/run/minify steps; added terser minification and XML parser/xmldom dependencies to adaptive-expressions; changed Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant NPM as npm scripts
participant TSUP as tsup / bundler
participant TERSER as terser
rect rgb(230,245,255)
Dev->>NPM: npm run build:browser
end
NPM->>NPM: build:browser:clean
NPM->>TSUP: build:browser:run (--no-minify)
TSUP->>TSUP: bundle -> produce lib/browser.js
NPM->>TERSER: build:browser:min (terser lib/browser.js --compress)
TERSER->>TERSER: minify & overwrite lib/browser.js
TERSER->>Dev: finished
sequenceDiagram
autonumber
participant TSUP as tsup config
participant ESBUILD as esbuild plugin
rect rgb(255,250,230)
TSUP->>ESBUILD: apply esbuildOptions.alias
note right of ESBUILD `#e8f5e9`: alias: { assert: 'assert' }
ESBUILD->>ESBUILD: apply polyfills
note right of ESBUILD `#fbe9e7`: polyfills.assert = false
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
libraries/adaptive-expressions/package.json(1 hunks)package.json(3 hunks)tsup/browser.config.ts(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: test:consumer
- GitHub Check: lint
- GitHub Check: test:compat
- GitHub Check: test:repoutils
- GitHub Check: tests.yml ubuntu (node 22.x)
- GitHub Check: tests.yml windows (node 22.x)
- GitHub Check: tests.yml windows (node 20.x)
- GitHub Check: tests.yml ubuntu (node 20.x)
- GitHub Check: tests.yml windows (node 18.x)
- GitHub Check: tests.yml ubuntu (node 18.x)
- GitHub Check: test:schemas
- GitHub Check: depcheck
🔇 Additional comments (2)
tsup/browser.config.ts (1)
43-43: Assert module configuration looks correct.The alias mapping at line 43 correctly resolves assert imports to the assert package, and the polyfill configuration at line 56 appropriately disables polyfilling since an explicit alias is provided. This approach is consistent with how other Node modules (crypto, http, https, stream) are handled in the browser build.
Also applies to: 56-56
package.json (1)
96-96: No issues found—version 2.1.0 is current and secure.The latest version of the assert package is 2.1.0, which matches what's specified in package.json. No security vulnerabilities were found for this package. The dependency addition is appropriate and safe.
|
/promoted 4909 |
Fixes # 4907
#minor
Description
This PR fixes the browser build for adaptive-expressions by disabling the tsup minification and using terser as a minifier in a separated build step.
It also adds a replacement for the assert module, required by the ANTLR parser.
Specific Changes
Testing
These images show the thee browser-compiled packages working after the changes.
