Skip to content

Commit 911b5c1

Browse files
committed
🚀 Dev Updates for Next Release
1 parent 0d2bf37 commit 911b5c1

35 files changed

Lines changed: 179 additions & 97 deletions

.eslintrc.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global module */
12
module.exports = {
23
// Running:
34
// Windows:
@@ -24,7 +25,7 @@ module.exports = {
2425
ignorePatterns: ['**/*.min.js', '**/js/react/es5/*'],
2526
// In general DataFormsJS uses intentation of 4 however it would trigger many
2627
// errors with eslint using default settings because `case` statements are
27-
// currently indented under `switch` and genrally promise `then()` functions
28+
// currently indented under `switch` and generally promise `then()` functions
2829
// are at the same level on most DataFormsJS code.
2930
rules: {
3031
'no-prototype-builtins': 0,
@@ -41,5 +42,18 @@ module.exports = {
4142
sourceType: 'module',
4243
},
4344
},
45+
{
46+
files: ['*.jsx'],
47+
parserOptions: {
48+
ecmaVersion: 11,
49+
sourceType: 'module',
50+
ecmaFeatures: {
51+
jsx: true
52+
}
53+
},
54+
plugins: [
55+
'react'
56+
],
57+
},
4458
]
4559
};

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,16 @@ Overall the core Framework files and API are expected to remain stable however t
8787
// change, however it's mostly just an internal property for unit testing and
8888
// for safety in the event of an unexpected error.
8989

90+
jsxLoader.compiler.addUseStrict = true;
91+
// By default "use strict"; is now added to the top of compiled JS code if
92+
// does not already exist. This can be turned off by setting `addUseStrict = false`.
93+
// This behavior is similar to the latest version of Babel 7.
94+
9095
// Added new code hint that is supported by Babel:
9196
/* @jsxFrag Vue.Fragment */
9297
~~~
98+
* Updated the CDN version of Babel Standalone used for old browsers from `7.10.4` to `7.12.6`
99+
* Added improved error message for compile errors where the number of opening tags did not match the number of closing tags. Previously some of these errors were only caught at runtime and not compile time.
93100
* Enhancements for DataFormsJS Framework files:
94101
* Added `app.updateTemplatesForIE(rootElement)`. IE 11 considers `<template>` elements as valid elements so it applies `querySelector()` and related methods to elements under `<templates>`'s so replace with them `<script type="text/x-template">`. This avoids issues of `<template>` elements that contain embedded content. Previously this was only handled once per page load but now is handled (for IE only) when views are rendered.
95102
* Added features in `js/plugins/dataBind.js` based on the Web Components version.
@@ -127,6 +134,8 @@ Overall the core Framework files and API are expected to remain stable however t
127134
* Updated dependencies used for building the `*.min.js` files
128135
* `@babel/standalone` updated from `7.7.7` to `7.12.6`, used to build es5 version of React Components
129136
* `uglify-js` updated from `3.7.3` to `3.11.6`
137+
* `eslint` updated from `7.3.1` to `7.13.0`
138+
* Updated `.eslintrc.js` for improved syntax validation when using VS Code with `*.jsx` example and test files
130139

131140
### Breaking Changes
132141

docs/to-do-list.txt

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,9 @@ TODO List
4141
https://github.com/dataformsjs/dataformsjs/issues/16
4242
More details will be published in the main JSX Loader doc:
4343
https://github.com/dataformsjs/dataformsjs/blob/master/docs/jsx-loader.md
44-
- Unit test the new options and support for new code hint:
45-
jsxLoader.compiler.pragma = 'Vue.h';
46-
jsxLoader.compiler.pragmaFrag = 'Vue.Fragment';
47-
// @jsxFrag Vue.Fragment
48-
- The code hint might require a newer version of babel for IE so
49-
proper testing is needed for many browsers.
50-
* Unit tests updated - now confirm in more browsers
44+
* Unit tests updated - now confirm in more browsers (UC Browser, Safari)
5145
- Add a markdown import example to:
5246
dataformsjs/examples/vue3-dynamic-jsx.htm
53-
- Update build dependencies to latest versions then make sure all Unit Tests and examples work as expected
5447
- React Components build items to test and decide on
5548
- Replace `import React from"react";` with empty string on [react/es6/*.min.js] files?
5649
- That way the could be used in the browser as <script type="module" src="..."> and use native import as well
@@ -59,7 +52,10 @@ TODO List
5952
<script type="module" src="react/es6/JsonData.min.js">
6053
<script nomodule src="react/es5/JsonData.js">
6154
- Should 'use strict' be included at the top of the files?
55+
- For build try using [terser] instead of [uglify-es]
56+
- See related comments later in this file.
6257
- More testing of examples using different devices and browsers
58+
- Both examples and unit tests
6359
- Prepare all quick ref docs before publishing so changes are quick to publish once npm is updated
6460
- Handle and remove all `NOTE` comments in [polyfill.js] before npm publishing
6561
- Before release update docs and example code that use <url-hash-router> to use <url-router> with the new CDN link
@@ -83,6 +79,7 @@ TODO List
8379
- The live production site currently uses handlebars however it's likely the Web Component version
8480
will be used instead after release.
8581
- All 3 sites should be tested more with a variety of devices and browsers to make sure everything works properly
82+
- After @latest is updated on jsdelivr with 5.0.0 release verify all readme code snippets
8683
- After new release publish here:
8784
https://www.webcomponents.org/publish-collection
8885

@@ -214,6 +211,22 @@ TODO List
214211
<data-select>
215212
<web-select>
216213
<image-select>
214+
- [uglify-es] is used to generate the [*.min.js] files, however a release has
215+
not been published in 3 years and the project is abandoned.
216+
https://www.npmjs.com/package/uglify-es
217+
https://github.com/mishoo/UglifyJS/tree/harmony
218+
- Currently all Web Components go through a lot testing on different devices
219+
so there are no known issues with the generated [*.min.js] files but using
220+
and abandoned minifier is not ideal.
221+
- Should Terser or something else be used? Some related links:
222+
https://blog.logrocket.com/uglify-vs-babel-minify-vs-terser-a-mini-battle-royale/
223+
https://www.npmtrends.com/babel-minify-vs-terser-vs-uglify-js
224+
https://github.com/webpack-contrib/terser-webpack-plugin/issues/15
225+
- Alternatives:
226+
https://terser.org/
227+
https://github.com/terser/terser
228+
https://github.com/babel/minify
229+
- Most likley Terser will be used as it's a fork of [uglify-es] and well maintained
217230
- Add Unit Testing
218231
- Currently only the main Framework and the React [jsxLoader.js] have Unit Testing
219232

@@ -315,6 +328,16 @@ TODO List
315328
http://127.0.0.1:5000/unit-testing-react
316329
http://127.0.0.1:5000/unit-testing-preact
317330
- It's possible that every line it tested but it's not yet known for sure
331+
- Add new [data-type="module"] option from Babel v7.10.0?
332+
<script type="text/babel" data-type="module">
333+
https://babeljs.io/docs/en/babel-standalone
334+
- Other new options exist such as: data-presets="env,stage-3"
335+
- Currently none of the examples need to use modules or different presets
336+
so this can be added in the future if it comes up
337+
- Currently with jsxLoader the presets can be changed from:
338+
jsxLoader.babelOptions.presets = ['es2015', 'react']
339+
- The main reason this would be needed is if JSX code should include
340+
imports directly within the browser - example `import { object } from 'https...'`
318341
- Possible new functions to support JavaScript version by year for new Syntax, example:
319342
jsxLoader.requireES2018 = function() {
320343
this.evalCode = '"use strict"; const { id, ...other } = { id:123, test:456 };';
@@ -502,14 +525,6 @@ TODO List
502525
data.a.push(4)
503526
data2.a.indexOf(4)
504527

505-
*) [Website\public\sitemap.xml]
506-
In the future this file will be generated as more languages are added.
507-
- Rather than including all examples one language for each demo is selected (a mix of Handlebars, Vue, React, Web Components)
508-
and some examples are excluded such as the log demo and entry form demo since they only include random data and no info.
509-
- For each demo the selected version should be also be used for canonical links, example:
510-
<link rel="canonical" href="https://www.dataformsjs.com/examples/places-demo-hbs.htm">
511-
- For new demos that will be excluded from the sitemap they should still have a canonical link added
512-
513528
*) Playground Page
514529
- Optimization - stop/start the timers based on if the tab is active or not?
515530
https://webkit.org/blog/8970/how-web-content-can-affect-power-usage/

examples/countries-no-spa-graphql.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h1>Countries</h1>
3131
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@4.8.0/js/react/es5/DataFormsJS.min.js"></script>
3232

3333
<!-- DataFormsJS JSX Loader -->
34-
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@4.8.0/js/react/jsxLoader.min.js"></script>
34+
<script src="../js/react/jsxLoader.js"></script>
3535
<script>
3636
// Set to `true` to view compiler details
3737
jsxLoader.logCompileTime = false;

examples/countries-no-spa-preact.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1>Countries</h1>
4040
<script src="https://dataformsjs.s3-us-west-1.amazonaws.com/js/pre-release/5.0.0/react/es5/DataFormsJS.min.js"></script>
4141

4242
<!-- DataFormsJS JSX Loader -->
43-
<script src="https://dataformsjs.s3-us-west-1.amazonaws.com/js/pre-release/5.0.0/react/jsxLoader.min.js"></script>
43+
<script src="../js/react/jsxLoader.js"></script>
4444
<script>
4545
// Set to `true` to view compiler details
4646
jsxLoader.logCompileTime = false;

examples/countries-no-spa-react.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h1>Countries</h1>
3535
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@4.8.0/js/react/es5/DataFormsJS.min.js"></script>
3636

3737
<!-- DataFormsJS JSX Loader -->
38-
<script src="https://dataformsjs.s3-us-west-1.amazonaws.com/js/pre-release/5.0.0/react/jsxLoader.min.js"></script>
38+
<script src="../js/react/jsxLoader.js"></script>
3939
<script>
4040
// Set to `true` to view compiler details
4141
jsxLoader.logCompileTime = false;

examples/hacker-news-react.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
DataFormsJS JSX Loader
3737
https://www.dataformsjs.com
3838
-->
39-
<script src="https://dataformsjs.s3-us-west-1.amazonaws.com/js/pre-release/5.0.0/react/jsxLoader.min.js"></script>
39+
<script src="../js/react/jsxLoader.js"></script>
4040
<script>
4141
// Set to `true` to see compiler details
4242
jsxLoader.logCompileTime = true;

examples/hello-world/hyperapp.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ <h1>{{hello_world}}</h1>
4949
</script>
5050

5151
<script src="https://cdn.jsdelivr.net/npm/hyperapp@2.0.4/dist/hyperapp.js"></script>
52-
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@4.8.0/js/react/jsxLoader.min.js"></script>
52+
<script src="/js/react/jsxLoader.js"></script>
5353
</body>
5454
</html>

examples/hello-world/preact.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ <h1>{{hello_world}}</h1>
4848
</script>
4949

5050
<script src="https://unpkg.com/preact@10.5.7/dist/preact.min.js"></script>
51-
<script src="https://dataformsjs.s3-us-west-1.amazonaws.com/js/pre-release/5.0.0/react/jsxLoader.min.js"></script>
51+
<script src="/js/react/jsxLoader.js"></script>
5252
</body>
5353
</html>

examples/hello-world/rax.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ <h1>{{hello_world}}</h1>
4343

4444
<script src="https://unpkg.com/rax@1.1.1/dist/rax.js"></script>
4545
<script src="https://unpkg.com/driver-dom@2.0.6/dist/driver-dom.js"></script>
46-
47-
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@4.8.0/js/react/jsxLoader.min.js"></script>
46+
47+
<script src="../js/react/jsxLoader.js"></script>
4848
<script>
4949
// NOTE - At the time of writing this demo does not work in IE for Rax,
5050
// however similar demos for React and Preact work. If Babel is being used

0 commit comments

Comments
 (0)