Extend documentation for bundle files

Open
#761 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript, python, rollup
Domain
documentation

Research direction

Edit integration_javascript.rst in the "Mixed Examples" section. Review the supplied Rollup command-line and Makefile examples, add them with valid reStructuredText formatting, and check that the documentation clearly shows both post-processing approaches.

Written by the indexing model from the issue text.

Description

SUB: documentation

Hello Jacques,

please add this small example of using another JS bundler as a additional post-processing step to the "Mixed Examples" section inintegration_javascript.rst.

Example: Using a Javascript bundler in post-processing

Besides the complete integration of a JS bundler into the development chain, it can be easier for small projects to
use an external bundler in a post-processing step.

Example: Call from commandline

# rollup --format=umd --name MyProject --file=MyProject.js -- __target__/MyProject.js

__target__/MyProject.js → MyProject.js...
(!) Circular dependency
__target__/re.js -> __target__/re.translate.js -> __target__/re.js
created MyProject.js in 612ms

Example: Integration in a Makefile

Example Makefile rule:

# tail Makefile
# Compile Python to JavaScript
build:
	transcrypt --build --map --nomin -e 6 MyProject.py
	rollup --format=umd --name MyProject --file=MyProject.js -- __target__/MyProject.js

Calling the Makefile rule:

# make build
transcrypt --build --map --nomin -e 6 MyProject.py

Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.7.16
Copyright (C) Geatec Engineering. License: Apache 2.0


Saving target code in: /home/user/MyProject/__target__/org.transcrypt.__runtime__.js
Saving target code in: /home/user/MyProject/__target__/re.translate.js
Saving target code in: /home/user/MyProject/__target__/re.js
Saving target code in: /home/user/MyProject/__target__/MyProject.js

Ready

rollup --format=umd --name MyProject --file=MyProject.js -- __target__/MyProject.js

__target__/MyProject.js → MyProject.js...
(!) Circular dependency
__target__/re.js -> __target__/re.translate.js -> __target__/re.js
created MyProject.js in 509ms

Kind regards,
Carsten

Dominant language
Python
Stars
2.9k
Forks
218
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TranscryptOrg/Transcrypt

All issues in TranscryptOrg/Transcrypt

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.