Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to babel. #7987

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('kolibri-tools/babel.config');
3 changes: 0 additions & 3 deletions kolibri/core/assets/src/core-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
* Provides the public API for the Kolibri FrontEnd core app.
* @module Facade
*/
// polyfill for older browsers
// TODO: rtibbles whittle down these polyfills to only what is needed for the application
import 'core-js';
import '../styles/main.scss';
import urls from 'kolibri.urls';
import * as theme from 'kolibri-design-system/lib/styles/theme';
Expand Down
15 changes: 0 additions & 15 deletions packages/hashi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,3 @@ Step 1: Install Hashi package deps (run from Kolibri root)
Step 2: Build Kolibri and hashi

`yarn run build`

Running the Code
-----------------

*Running the test HTML5 app in Kolibri*
1. Create a new channel in Studio or edit an existing one
2. Create a test zip file by running `scripts/make_test_zip.py`
3. Upload the `localstorage_test.zip` file and publish
4. Import the published channel into Kolibri
5. Click on the HTML5 app node you created.
It should say `TIMES LOADED: 1`.
6. Click to visit another node, then re-enter the app node.
It should say `TIMES LOADED: 2`.
And `Last visit:` with the previous date and time you looked at it
7. You're done! This confirms that Kolibri is saving localStorage and cookie data!
15 changes: 0 additions & 15 deletions packages/hashi/compat.js

This file was deleted.

18 changes: 5 additions & 13 deletions packages/hashi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,14 @@
"author": "Learning Equality",
"license": "MIT",
"devDependencies": {
"buble": "^0.19.6",
"buble-loader": "^0.5.1",
"eslint-plugin-compat": "^3.0.0",
"express": "^4.16.4",
"http-server": "^0.11.1",
"jest-environment-puppeteer": "^4.1.0",
"jest-puppeteer": "^4.1.0",
"puppeteer": "^1.13.0",
"@babel/cli": "^7.13.14",
"@babel/core": "^7.13.15",
"@babel/preset-env": "^7.13.15",
"babel-loader": "^8.2.2",
"webpack": "4.6.0",
"webpack-cli": "^3.1.2"
},
"dependencies": {
"array-includes": "^3.0.3",
"core-js": "^3.4.8",
"object.assign": "^4.1.0",
"object.entries": "^1.1.0",
"object.values": "^1.1.0"
"core-js": "^3.4.8"
}
}
27 changes: 0 additions & 27 deletions packages/hashi/src/compat.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/hashi/src/iframe.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Hashi from './iframeClient';

require('./compat');

const hashi = new Hashi();
window.hashi = hashi;
console.log('Hashi initialized!'); // eslint-disable-line no-console
6 changes: 1 addition & 5 deletions packages/hashi/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ module.exports = {
rules: [
{
test: /\.js$/,
loader: 'buble-loader',
include: path.join(__dirname, 'src'),
options: {
objectAssign: 'Object.assign',
},
loader: 'babel-loader',
},
],
},
Expand Down
12 changes: 12 additions & 0 deletions packages/kolibri-tools/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
corejs: '3.10',
},
],
],
plugins: ['@babel/plugin-proposal-object-rest-spread'],
};
7 changes: 2 additions & 5 deletions packages/kolibri-tools/lib/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ module.exports = (data, { mode = 'development', hot = false } = {}) => {
},
{
test: /\.js$/,
loader: 'buble-loader',
options: {
objectAssign: 'Object.assign',
},
exclude: /node_modules\/vue/,
loader: 'babel-loader',
exclude: /(node_modules\/vue|dist)/,
},
{
test: /\.css$/,
Expand Down
6 changes: 4 additions & 2 deletions packages/kolibri-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"autoprefixer": "^7.1.4",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"buble": "0.19.8",
"buble-loader": "0.5.1",
"check-node-version": "^3.3.0",
"chokidar": "^2.0.4",
"colors": "^1.1.2",
Expand Down Expand Up @@ -95,6 +93,10 @@
"npm": ">= 3"
},
"devDependencies": {
"@babel/cli": "^7.13.14",
"@babel/core": "^7.13.15",
"@babel/preset-env": "^7.13.15",
"babel-loader": "^8.2.2",
"del": "^6.0.0",
"readline-sync": "^1.4.9"
},
Expand Down
Loading