Comments (5)
I did this by viewing all files as external modules. I'm not so sure if this is a good choice since I'm having difficulty compiling everything to a single js file. It doesn't seem possible with the tsc.
from ts-python-interpreter.
For running in Node: There's no reason to bundle 'em.
For the browser: Generate AMD modules, and use the RequireJS optimizer. That's what Doppio does.
http://requirejs.org/docs/optimization.html#basics
Here's Doppio's RequireJS config, for reference:
https://github.com/plasma-umass/doppio/blob/master/Grunttasks.ts#L311
The wrapping stuff is to wrap the entire concatenated source code into a function closure to avoid polluting the global scope, and to export the desired public library interface.
(Isn't web development grand? 😭 )
from ts-python-interpreter.
(The global_defs
bit is pretty cool. We define the constant RELEASE
only in a release build; Uglify will replace that variable with a constant, and if it sees if (!RELEASE)
, it will remove that code from the build because it's always false in a release build.)
from ts-python-interpreter.
It's almost more fun than a kick in the mouth. I'll digest all of that and let you know if (when) I have more problems. Thanks!
from ts-python-interpreter.
All set.
from ts-python-interpreter.
Related Issues (20)
- Compiling throws error on "
- Compiling throws error on require for node HOT 1
- which objects are in the tuples? HOT 1
- Implement parsing HOT 1
- Use BrowserFS to get a web page running HOT 15
- Represent 64 bit integers HOT 2
- Unit test parser
- Represent complex numbers HOT 3
- Check for bad marshal data when parsing
- do unit tests need to be specified to qunit as async b/c of callback?
- Create classes for all parsed types?
- typeLong in MarshalParser.ts may not be working
- How is __name__ loaded into the locals/globals/builtins
- CALL_FUNCTION with parameters
- Interpret pyc with conditionals and loops
- interpret pyc with arithmetic
- interpret pyc that uses imports
- interpret pyc that has classes
- Implement opcodes related to implemented types we've covered
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 ts-python-interpreter.