Closed CYBAI closed 4 years ago
I'm wondering maybe #29 already fixed the tree shaking part and the only thing needs to be done for this issue is to build the targets directly instead of being under lib
or es6
👀? (IIUC, we will still keep the lib
and es6
target for compatibility like fp-ts I guess?)
Hey @CYBAI, sorry for not getting back to you sooner on this.
The issues surrounding tree-shakability were handled with #29 when pipeable
was removed from the library and the "mega" type class instances were split into their respective individual type class instances.
The issue you are raising I think has more to do with the import ergonomics of the library. I would be happy to work on implementation of direct imports for parser-ts
, but I think (similar to our discussion in #31) the issue will come up as to how this should be handled across the ecosystem.
import-path-rewrite
) that can be used selectively by packages that wish to implement this feature?@gcanti - sorry to ping you once again, but would you mind weighing in on the above? If a utility library is desired, I am happy to work on implementation. Otherwise, I will just port over the scripts from fp-ts
to allow for direct imports of the parser-ts
modules.
Or can we create a utility library (similar to import-path-rewrite) that can be used selectively by packages that wish to implement this feature?
Yeah, that's something I would like to work on as soon as I find some time. In the meanwhile we could do what @osdiab did here
@gcanti thank you so much!!!!!!!!!!!!!!
🚀 Feature request
Current Behavior
As a
parser-ts
user, I will need to import modules likeparser-ts/lib/Parser
orparser-ts/es6/Parser
.Desired Behavior
Ideally, it would be great to just import the module directly without prefix like
parser-ts/Parser
thatfp-ts
already shipped in 2.8.0.Suggested Solution
Maybe we can follow what
fp-ts
has done in https://github.com/gcanti/fp-ts/pull/1241 to fix this.Who does this impact? Who is this for?
parser-ts
usersDescribe alternatives you've considered
Additional context
Your environment
(I also filed another similar issue for
fp-ts-contrib
at https://github.com/gcanti/fp-ts-contrib/issues/67)