- remove macropy
- fix evaluation from commandline
- deprecate Python 3.5 and 3.6
- tested on Python 3.10
- update test infrastructure to work with latest
pytest
; - add support for Python 3.7 and 3.8 (thanks to Richard Höchenberger).
- do not crash when translating source with assignment typehints ( with the help of Sirenfal)
- use Macropy3 version 1.1.0b2 to avoid issues with Django
- add a
--source-name
options to be used together with--inline-map
when using-s
; - move main repository to gitlab.com/metapensiero;
- add support for default export and import;
- add documentation for the
JS()
marker function; - refactor of the JS AST nodes;
- fix path splitting and joining on Windows (thanks to Roman Yakubuk);
- add support for
except
sections with more than one exception type and arbitrary exception variable name. Thanks to @devanlai; - dict keys conversion fixes;
- enable
--inline-map
when translating a string with-s
;
- translate dicts unambiguously, using "computed member name form" for keys that aren't strings;
- use
macropy
package to deal with some of the translation details; - translate
int()
andfloat()
; - fix a bug that prevented BabelJS translation when keyword arguments; are present;
- allow to define template literals and tagged templates;
- define package scopes in imports prepending names with
__
; - translate
issubclass()
; - translate lambdas as arrow functions;
- translate Python 3.6+ f-strings to ES6 template literals;
- Add translation for
__instancecheck__
to[Symbol.hasInstance]
; - Sort imports alphabetically;
- translate
tmpl("A string with js ${interpolation}")
to ES6 template literals; - preliminary support to translate names like
d_foo
anddd_bar
to$foo
and$$bar
; - addded translation of the
assert
statement; - fixed a bug in
try...except...finally
statement when there's noexcept
section; - added translation for
foo is not bar
that seems to have dedicated ast node; - if the function is defined in a method but starts with
fn_
do not convert it to an arrow function. Useful to not maintainthis
; - added translation for
callable
andhasattr/getattr/setattr
; - updated for loops to support more than one target, so now its possible to
write loops like
for k, v in iterable(a_map):
; - updated documentation;
- added a new cli option
-s
to translate source from the command line or the standard input; - fixed a pair of bugs on sourcemaps;
- added a new cli option
--eval
to also evaluate the produced JavaScript using the embedded interpreter; - added a new cli option
--dump-ast
to print out the ast tree of the passed in string; - added sorting to the rendered snippets/decorators/assignments so that their order does not change at every ricompilation;
- do not re-declare variables declare in outer scopes;
- updated BabelJS to version 6.18.1;
- allow to import modules with dashes inside by using dunder-inside-words
notation (
foo__bar
becomesfoo-bar
); - reuse JavaScript interpreter context to speedup translation;
- update
in
operator to support ES6 collections; - added support for method and class decorators;
- added support for class properties and descriptors;
- add
for
loop over JS iterables; - allow to loop over inherited properties;
- fix a bug on
type()
translation; - support for
range()
steps; - add support for generator functions and
yield
andyield from
expressions; - optionally load babel-polyfill before evaluating code;
- fix a bug on sourcemaps having wrong references when there are documentation elements;
- translate
__get__()
and__set__()
to to JS equivalents; - implement
dict(foo).update(bar)
anddict(foo).copy
; - documentation improvements;
- updates to the documentation ( with some fixes made by Hugo Herter, Daniel Kopitchinski and ironmaniiith)
- Translate
str(x)
intox.toString()
- Add support for properties and classmethods
- Translate
__len__
and__str__
methods toget length()
andtoString()
- Add support for slices syntax to
.slice()
- Fixed two bugs in sourcemaps generation
- Fixed a bug in the
inport ... from
translation - Correctly include BabelJS minimized code
- Fix transpiling of stage3 features
- use arrow functions to retain
this
were possible - translate
async/await
- refactoring of the
for
loops - add ability to subtranslate pieces of Python code or objects. Used
to template the creation of
Exception
sublasses - add support for param defaults and keyword arguments
- updated documentation
- First cut of the features