Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Provide uncompiled API lib for node usage #59

Open
eljefedelrodeodeljefe opened this issue Oct 26, 2016 · 6 comments
Open

Provide uncompiled API lib for node usage #59

eljefedelrodeodeljefe opened this issue Oct 26, 2016 · 6 comments

Comments

@eljefedelrodeodeljefe
Copy link

eljefedelrodeodeljefe commented Oct 26, 2016

The compiling makes debugging really difficult.

@bcronin
Copy link
Collaborator

bcronin commented Oct 26, 2016

Is the request that the contents of the src/ directly not use ES6 JavaScript? Note that source maps are provided with the Babel compiled code produced in the lib/ directory. Using a package such as source-map-support works to map that code directly to files in src. If the request is for using uncompiled code that's browser-compatible, that'd be a very significant change.

Can you clarify what environment you're using the library in and what specifically is making it really difficult to debug? I'd like to understand better since, as far as I know, Babel-compiled ES6 code seems to be a rather common, conventional way of writing JavaScript these days. I want to make sure I'm not missing the crux of the problem and the request.

@eljefedelrodeodeljefe
Copy link
Author

Well for the browser there is no other way that is right. But the only (don't pin me down on that) feature that node doesn't have and you use are imports. Paying the price of having compiled code for that is a little high, imo. Source maps only work well in a limited fashion for production code and backend workflows. For examples I currently cannot print out Tracer instances or inspect the via repl.

Also I am doubtful that babel transpilation is common on the backend. I would strongly recommend against this and never take such code into production.

The suggestion would rather be to make src work on vanilla node and branch at downstream compile time for the platform: browser get transpiled JS node takes ESnow.

@bcronin
Copy link
Collaborator

bcronin commented Oct 26, 2016

I hear you, esp. with regards to source maps and production code. Thinking aloud, if the library goes this route, we'll need to nail down what version of "vanilla node" should be targeted.

@eljefedelrodeodeljefe
Copy link
Author

Being close to node I would say v4 would be the most maintainable / readable bet, also since it will stay around for a while due to Node LTS cycle. This would basically allow you to run most of the codebase by replace imports / exports with require. 0.12 doesn't support class I believe and for full let / const support you likely need use strict. I think it's safe to say 0.12 os negligible and 0.10 even dangerous to use, since it dropped out of maintenance.

https://twitter.com/seldo/status/781258069678391296

ctevgvfviaadumv

@yurishkuro
Copy link
Member

For the moment we need 0.10 compatibility.

@eljefedelrodeodeljefe
Copy link
Author

That would loose class and Object.assign (there are good useland modules for that). class shouldn't be a problem since you do not inherit. Otherwise inheriting would need util

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants