Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: babel/babel-standalone
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: release-6.24.1
Choose a base ref
...
head repository: babel/babel-standalone
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 10 commits
  • 5 files changed
  • 4 contributors

Commits on May 14, 2017

  1. Copy the full SHA
    7408d19 View commit details

Commits on May 16, 2017

  1. Fix transformation of <script> tags. Closes #84

    The problem was that the transformScriptTags attached to DOMContentLoaded took one argument (the event), which it was treating as a list of script tags to transform. This is obviously wrong. DOM-specific stuff like this needs more unit testing in babel-standalone.
    
    Tested scriptTag-src.html and scriptTag-custom.html examples, both work as expected
    Daniel15 committed May 16, 2017
    Copy the full SHA
    225703f View commit details

Commits on Jun 6, 2017

  1. export buildExternalHelpers

    jetiny committed Jun 6, 2017
    Copy the full SHA
    3305e09 View commit details
  2. Merge pull request #88 from aflover/master

    export buildExternalHelpers
    Daniel15 authored Jun 6, 2017
    Copy the full SHA
    7099404 View commit details

Commits on Jun 8, 2017

  1. Upgrade to Babel 6.25.0

    DanBuild committed Jun 8, 2017
    Copy the full SHA
    8681ac2 View commit details

Commits on Jul 22, 2017

  1. Add build steps to readme

    Daniel15 authored Jul 22, 2017
    Copy the full SHA
    6fe1aa7 View commit details
  2. Update README.md

    Daniel15 authored Jul 22, 2017
    Copy the full SHA
    13ccce2 View commit details

Commits on Aug 16, 2017

  1. Upgrade to Babel 6.26.0

    DanBuild committed Aug 16, 2017
    Copy the full SHA
    ac0eeee View commit details

Commits on Sep 10, 2017

  1. Point repo to babel

    Looks like all of the good stuff is over in the babel repo now :D
    jeffrafter authored Sep 10, 2017
    Copy the full SHA
    62e7b7c View commit details
  2. Merge pull request #93 from jeffrafter/add-deprecation-warning

    Point repo to babel
    Daniel15 authored Sep 10, 2017
    Copy the full SHA
    2de2811 View commit details
Showing with 47 additions and 36 deletions.
  1. +13 −0 README.md
  2. +3 −1 jenkins_jobs.groovy
  3. +27 −27 package.json
  4. +2 −3 src/index.js
  5. +2 −5 src/transformScriptTags.js
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `babel-standalone` is now part of `babel`! Go [check it out](https://github.com/babel/babel/tree/master/packages/babel-standalone) :warning::warning::warning::warning:

babel-standalone
================

@@ -91,3 +93,14 @@ Custom plugins also work for inline `<script>`s:
```html
<script type="text/babel" data-plugins="lolizer">
```
Manually Building
=================
If you want to manually upgrade the Babel version used by babel-standalone (or build your own release), follow these steps:
1. Upgrade the Babel versions in `package.json`. This can be done with `npm-check-upgrades` (eg. `npm-check-updates -u -a --packageFile ./package.json /^babel\-/`)
2. Delete `node_modules`, as npm often produces inefficient directory layouts if you upgrade in-place
3. Run `npm install && npm run build`
4. Run `npm run test` to ensure it works
5. Open `examples/example.htm` and ensure it works
4 changes: 3 additions & 1 deletion jenkins_jobs.groovy
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ job('babel-standalone-update') {
}
triggers {
urlTrigger {
cron 'H/15 * * * *'
cron 'H/30 * * * *'
url('https://babel-standalone.dan.cx/latest-babel-version') {
inspection 'change'
}
@@ -42,5 +42,7 @@ job('babel-standalone-update') {
branch 'origin', 'master'
pushOnlyIfSuccess
}
gitHubIssueNotifier {
}
}
}
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-standalone",
"version": "6.24.1",
"version": "6.26.0",
"description": "Standalone build of Babel for use in non-Node.js environments. Similar to the (now deprecated) babel-browser",
"main": "babel.js",
"scripts": {
@@ -17,22 +17,22 @@
"url": "git+https://github.com/Daniel15/babel-standalone.git"
},
"devDependencies": {
"babel-core": "6.24.1",
"babel-core": "6.26.0",
"babel-helper-builder-react-jsx": "6.23.0",
"babel-loader": "6.4.1",
"babel-plugin-check-es2015-constants": "6.22.0",
"babel-plugin-external-helpers": "6.22.0",
"babel-plugin-inline-replace-variables": "1.2.2",
"babel-plugin-minify-constant-folding": "0.0.4",
"babel-plugin-minify-dead-code-elimination": "0.1.4",
"babel-plugin-inline-replace-variables": "1.3.1",
"babel-plugin-minify-constant-folding": "0.2.0",
"babel-plugin-minify-dead-code-elimination": "0.2.0",
"babel-plugin-minify-empty-function": "0.0.1",
"babel-plugin-minify-flip-comparisons": "0.0.2",
"babel-plugin-minify-guarded-expressions": "0.0.4",
"babel-plugin-minify-infinity": "0.0.1",
"babel-plugin-minify-mangle-names": "0.0.8",
"babel-plugin-minify-replace": "0.0.4",
"babel-plugin-minify-simplify": "0.0.8",
"babel-plugin-minify-type-constructors": "0.0.4",
"babel-plugin-minify-flip-comparisons": "0.2.0",
"babel-plugin-minify-guarded-expressions": "0.2.0",
"babel-plugin-minify-infinity": "0.2.0",
"babel-plugin-minify-mangle-names": "0.2.0",
"babel-plugin-minify-replace": "0.2.0",
"babel-plugin-minify-simplify": "0.2.0",
"babel-plugin-minify-type-constructors": "0.2.0",
"babel-plugin-syntax-async-functions": "6.13.0",
"babel-plugin-syntax-async-generators": "6.13.0",
"babel-plugin-syntax-class-constructor-call": "6.18.0",
@@ -57,7 +57,7 @@
"babel-plugin-transform-do-expressions": "6.22.0",
"babel-plugin-transform-es2015-arrow-functions": "6.22.0",
"babel-plugin-transform-es2015-block-scoped-functions": "6.22.0",
"babel-plugin-transform-es2015-block-scoping": "6.24.1",
"babel-plugin-transform-es2015-block-scoping": "6.26.0",
"babel-plugin-transform-es2015-classes": "6.24.1",
"babel-plugin-transform-es2015-computed-properties": "6.24.1",
"babel-plugin-transform-es2015-destructuring": "6.23.0",
@@ -67,7 +67,7 @@
"babel-plugin-transform-es2015-instanceof": "6.22.0",
"babel-plugin-transform-es2015-literals": "6.22.0",
"babel-plugin-transform-es2015-modules-amd": "6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
"babel-plugin-transform-es2015-modules-systemjs": "6.24.1",
"babel-plugin-transform-es2015-modules-umd": "6.24.1",
"babel-plugin-transform-es2015-object-super": "6.24.1",
@@ -89,31 +89,31 @@
"babel-plugin-transform-function-bind": "6.22.0",
"babel-plugin-transform-inline-environment-variables": "6.8.0",
"babel-plugin-transform-jscript": "6.22.0",
"babel-plugin-transform-member-expression-literals": "6.8.1",
"babel-plugin-transform-merge-sibling-variables": "6.8.2",
"babel-plugin-transform-minify-booleans": "6.8.0",
"babel-plugin-transform-member-expression-literals": "6.8.5",
"babel-plugin-transform-merge-sibling-variables": "6.8.6",
"babel-plugin-transform-minify-booleans": "6.8.3",
"babel-plugin-transform-node-env-inline": "6.8.0",
"babel-plugin-transform-object-assign": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.23.0",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"babel-plugin-transform-object-set-prototype-of-to-assign": "6.22.0",
"babel-plugin-transform-property-literals": "6.8.1",
"babel-plugin-transform-proto-to-assign": "6.23.0",
"babel-plugin-transform-property-literals": "6.8.5",
"babel-plugin-transform-proto-to-assign": "6.26.0",
"babel-plugin-transform-react-constant-elements": "6.23.0",
"babel-plugin-transform-react-display-name": "6.23.0",
"babel-plugin-transform-react-display-name": "6.25.0",
"babel-plugin-transform-react-inline-elements": "6.22.0",
"babel-plugin-transform-react-jsx": "6.24.1",
"babel-plugin-transform-react-jsx-compat": "6.24.1",
"babel-plugin-transform-react-jsx-self": "6.22.0",
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-plugin-transform-regenerator": "6.24.1",
"babel-plugin-transform-remove-console": "6.8.1",
"babel-plugin-transform-remove-debugger": "6.8.1",
"babel-plugin-transform-regenerator": "6.26.0",
"babel-plugin-transform-remove-console": "6.8.5",
"babel-plugin-transform-remove-debugger": "6.8.5",
"babel-plugin-transform-runtime": "6.23.0",
"babel-plugin-transform-simplify-comparison-operators": "6.8.1",
"babel-plugin-transform-simplify-comparison-operators": "6.8.5",
"babel-plugin-transform-strict-mode": "6.24.1",
"babel-plugin-transform-undefined-to-void": "6.8.0",
"babel-plugin-transform-undefined-to-void": "6.8.3",
"babel-plugin-undeclared-variables-check": "6.22.0",
"babel-preset-babili": "0.0.12",
"babel-preset-babili": "0.1.4",
"babel-preset-es2015": "6.24.1",
"babel-preset-es2016": "6.24.1",
"babel-preset-es2017": "6.24.1",
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ export function transformFromAst(ast, code, options) {
}
export const availablePlugins = {};
export const availablePresets = {};

export const buildExternalHelpers = Babel.buildExternalHelpers;
/**
* Registers a named plugin for use with Babel.
*/
@@ -257,7 +257,7 @@ export const version = VERSION;
// Listen for load event if we're in a browser and then kick off finding and
// running of scripts with "text/babel" type.
if (typeof window !== 'undefined' && window && window.addEventListener) {
window.addEventListener('DOMContentLoaded', transformScriptTags, false);
window.addEventListener('DOMContentLoaded', () => transformScriptTags(), false);
}

/**
@@ -274,4 +274,3 @@ export function transformScriptTags(scriptTags) {
export function disableScriptTags() {
window.removeEventListener('DOMContentLoaded', transformScriptTags);
}

7 changes: 2 additions & 5 deletions src/transformScriptTags.js
Original file line number Diff line number Diff line change
@@ -184,12 +184,9 @@ function loadScripts(transformFn, scripts) {
* Run script tags with type="text/jsx".
* @param {Array} scriptTags specify script tags to run, run all in the <head> if not given
*/
export function runScripts(transformFn, scriptTags) {
let scripts
export function runScripts(transformFn, scripts) {
headEl = document.getElementsByTagName('head')[0];
if(scriptTags) {
scripts = scriptTags
} else {
if (!scripts) {
scripts = document.getElementsByTagName('script');
}