Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

refactor(loaddictionary): only accept arraybuffer #390

Merged
merged 1 commit into from May 16, 2019

Conversation

kwonoj
Copy link
Owner

@kwonoj kwonoj commented May 16, 2019

BREAKING CHANGE: loadDictionary does not read physical file from path anymore

This PR changes interface to loadDictionary to accept arrayBuffer only. Previously it also accepts physical path to dic / aff and read it, mount into wasm's memory space. For the preparation of electron's new async spellchecker, it is expected to create instance of provider in any context like worker, or renderer, vice versa - and detecting & supporting various env to load dictionary is non trivial job.

Any env should able to create arraybuffer from file contents instead - in main process fs can read file into buffer, and any other renderer process fetch or similar allows to retrieve contents from remote endpoint. Spellchecker provider now expects per-context handling occurs in caller's side.

BREAKING CHANGE: loadDictionary does not read physical file from path
anymore
@codecov
Copy link

codecov bot commented May 16, 2019

Codecov Report

Merging #390 into feat-async will decrease coverage by 0.26%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff               @@
##           feat-async     #390      +/-   ##
==============================================
- Coverage        99.3%   99.03%   -0.27%     
==============================================
  Files               3        3              
  Lines             143      104      -39     
  Branches           25       16       -9     
==============================================
- Hits              142      103      -39     
  Partials            1        1
Impacted Files Coverage Δ
src/spellCheckerProvider.ts 98.94% <100%> (-0.31%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eda21cf...3041e2b. Read the comment docs.

@kwonoj kwonoj merged commit 12bf1ec into feat-async May 16, 2019
@kwonoj kwonoj deleted the feat-async-spellchecker branch May 16, 2019 23:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant