Comments (9)
This does need to be updated to TS and more modern build / release type processes - just needs time for someone to go through and do the required work (without making code changes as the previous PR) - if you wanted to update to using Vite rather than TSDX (which is effectively abandoned sadly) then I will try to take some time to review
Also - maybe for future - but
default
exports are bad! :-P
Thanks for the link, very interesting read. Personally I find defaults annoying and often inconsistent, but I have also generally found them to be the expected baseline.
I actually wanted to port this in vite, but TSDX was explicitly called out in the discussion about moving to typescript so I gave it a shot. I think moving it over now that it is in typescript would be trivial, so I can work on that in my spare time.
I am curious about your thoughts on the minor changes I did (such as moving to Map()) and if that would be considered an unacceptable change vs a port? I did not benchmark for speed just results/compatibility with string generated by the source project as my needs are not bottlenecks by the compression speed.
from lz-string.
Draft PR available here: #174
from lz-string.
@karnthis How does one use your port in a modern Vue app? I'm sure it's user error on my part but neither of these imports work for me...
import { Plzsu } from '@karnthis/plzsu'
import { compress, decompress } from '@karnthis/plzsu'
See also: https://github.com/amoutonbrady/lz-string
EDIT: I think I figured it out by looking at the test in your repo. I need to import like this...
import Plzsu from '@karnthis/plzsu'
...then create an instance...
const P = new Plzsu();
I was expecting it to behave like the other port that I linked above.
from lz-string.
This does need to be updated to TS and more modern build / release type processes - just needs time for someone to go through and do the required work (without making code changes as the previous PR) - if you wanted to update to using Vite rather than TSDX (which is effectively abandoned sadly) then I will try to take some time to review
Also - maybe for future - but default
exports are bad! :-P
from lz-string.
@karnthis How does one use your port in a modern Vue app? I'm sure it's user error on my part but neither of these imports work for me...
import { Plzsu } from '@karnthis/plzsu'
import { compress, decompress } from '@karnthis/plzsu'
See also: https://github.com/amoutonbrady/lz-string
EDIT: I think I figured it out by looking at the test in your repo. I need to import like this...
import Plzsu from '@karnthis/plzsu'
...then create an instance...
const P = new Plzsu();
I was expecting it to behave like the other port that I linked above.
Correct! You import and create an instance. I noticed several chunks of repetitive code and chances for future optimization, and felt a persistent object instance would be ideal.
from lz-string.
I am curious about your thoughts on the minor changes I did (such as moving to Map()) and if that would be considered an unacceptable change vs a port? I did not benchmark for speed just results/compatibility with string generated by the source project as my needs are not bottlenecks by the compression speed.
For a conversion to TS it needs to be a straight A->B conversion, with no code changes - for the simple reason that any code changes would need to be PR'd and decided on separately - changing to Map
is an actual functionality change, so can't be guaranteed to be compatible output - while bugfixing something that was only noticed due to TS would be acceptable - hopefully that makes sense!
(Nothing wrong with a second PR that points straight at the first for things like Map, but check out the rather long thread here for some really nice performance updates - #98 - converting to TS would almost definitely increase the confidence in them!)
from lz-string.
I can work up something I think. How important is legacy support? At this point I think some support needs to be dropped or the library will be held back. What is the best means of discussing decisions? The PRs I see even with recent-ish comments are years old and much has changed in that time.
from lz-string.
I can work up something I think. How important is legacy support? At this point I think some support needs to be dropped or the library will be held back. What is the best means of discussing decisions? The PRs I see even with recent-ish comments are years old and much has changed in that time.
I feel that the simple conversion is a good start, will be a major release due to Vite building it now, and that supports all the browsers that are relevant (anyone using an older browser can stick to the current 1.5.0 release even though it should be identical as it's data manipulation only) - can safely ignore the old PR as your's hits exactly what is needed for the initial update :-D
from lz-string.
Conversion merged, let new PR ideas commence!
from lz-string.
Related Issues (20)
- Newbie question: How would I go about downloading / uploading a file? HOT 2
- Does `compressToUint8Array()` output smaller than `compress()` ? HOT 1
- Quotes in the compressed string HOT 3
- Implement IRI Encoding HOT 1
- Bug: can not decompress for some compressed string HOT 4
- Crash with large strings when running on Hermes (React Native)
- Is there a way to allow custom dictionaries? HOT 9
- How to realize that only specified characters are allowed to appear in the compression result? HOT 1
- Tag for v1.5.0 HOT 2
- Version 2 TODO list HOT 15
- Feature request: compress to source-compatible character set HOT 1
- New port for a linux executable HOT 1
- Can utf-8 codes be avoided in the output? HOT 10
- `decompressFromBase64` can return `null` HOT 7
- Docs: JSPerf.com links are no longer valid
- Docs: A Complete Demo for various compression/decompression HOT 3
- Docs: TSDoc HOT 3
- License Inconsistencies HOT 5
- Community Question: Breaking Changes and Version 2! HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lz-string.