-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat(harper.js): export both binary and inlinedBinary for different runtimes #607
base: master
Are you sure you want to change the base?
Conversation
Hey @Asuka109, just a heads up. If you want the |
@elijah-potter Got it. I missed your comment last week. I tried it just now, but it seems it won't resolve the ESLint issues. Also, I noticed that VSCode cannot resolve the .eslintrc file and isn't linting the problems. I can improve that in the next PR. |
@elijah-potter It seems like there is something wrong with the cases running in Firefox. I will handle it later. There are quite a lot of changes to the API. Could you please take a look at the changes and let me know if anything needs to be changed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've made a lot of changes here. Some of the reasoning needs a bit more explanation.
This reverts commit 6e9fdc1.
@elijah-potter I think everything is ready now. |
@elijah-potter I found that initializing |
This pull request includes several changes to improve the Harper.js project, focusing on updating dependencies, modifying test configurations, and refactoring the code to use the new
harper-wasm
package. The most important changes include updating thepackage.json
dependencies, modifying the test scripts, and refactoring theLinter
andLocalLinter
classes to use the newbinary
module.Dependency and configuration updates:
packages/harper.js/package.json
: Updated dependencies to useharper-wasm
instead ofwasm
, added new test scripts, and updated the versions of several development dependencies. AddedsideEffects
field so that all the exports can be removed by bundler treeshaking.Refactoring and code improvements:
packages/harper.js/src/binary.ts
: Migrated fromsrc/WorkerLinter/communication.ts
andsrc/loadWasm.ts
, it providesBinaryModule
as a wrapper for the raw WebAssembly module, bringing more readable method names and additional features. It also exportsbinary
andbinaryInlined
to load the WebAssembly file in different ways.packages/harper.js/src/Linter.ts
: Updated imports to useharper-wasm
and added a newLinterInit
interface that includes thebinary
module. [1] [2]packages/harper.js/src/LocalLinter.ts
: Refactored theLocalLinter
class to use the newbinary
module for WebAssembly operations, removing the oldloadWasm
method. Now it should be initialized with passing aBinaryModule
.packages/harper.js/src/WorkerLinter/index.ts
: Updated theWorkerLinter
class to use the newbinary
module and refactored the worker communication setup.Testing improvements:
packages/harper.js/src/Linter.test.ts
: Modified tests to use the newbinary
module when initializingLinter
instances. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]