-
Notifications
You must be signed in to change notification settings - Fork 353
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
Make js-interpreter ready for node and NPM #267
Comments
I can't speak for Niel, who has ultimate discretion over this repo, but he has been known to listen to my advice from time to time. Here is what I would advise:
Then rebuilding and publishing would consist of I'd be happy to assist with reviewing any of this if @NeilFraser would like. |
Jesus... you guys are not going to believe this. Specificaly:
Precisely what I was going to write. Most people today will install the NPM module
Ah, THAT'S how he feels about it :-D
I am for simple solutions. I don't think we need to go as far as using the Closure Compiler, frankly. What we need is so simple... really. If you look at the repo (which is a TOTALLY UNTESTED sketch, I put it together last night before going to sleep), you will see that all we really need is two lines of code to sandwitch the module with. I also wrote "please let's drop AMD support,
Ah that was another point I was going to make. Fantastic.
It will need to. My sketched
Yep.
Precisely.
Let me check whether my sketch works. I mainly pushed it as is just to show how aligned our ideas are. The main difference is in the way we compile to ESM -- I think it's very trivial to do so without a complex, full-on building stage. But, I need to check that too. Once what I did works, I will send a PR over if that's OK. Thank you! |
#268 does this. Maye this issue should be closed? |
I am currently maintaining https://github.com/mobily-enterprises/js-interpreter. It's available on npm as
js-interpreter-npm
. All it does, it repackage acorn.js andjs-interpreter.js
, but adding this at the BEGINNING ofjs-interpreter.js
:This essentially makes sure that the module works 100% both when loaded in the browser, and when it's "required" by node.
Please note that I had to add those primitive data types to the "global scope" for node.
It is a bit of a hack, but it works. Please note that I carefully avoided complex "building" steps with webpack, etc.
I would love some input on this. Really, I just have a question:
are you guys willing to include some changes so that js-interpreter is ready for node, rather than people using my silly wrapper that becomes outdated as you go further with development?
are you guys willing and happy to publish to NPM, if you do go with (1)?
The text was updated successfully, but these errors were encountered: