-
Notifications
You must be signed in to change notification settings - Fork 949
Es5 target #2472
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
Es5 target #2472
Conversation
cc @vidartf |
Can we just switch the base package and maybe controls and output to es5? I don't think there's any reason to switch the jlab manager to es5. |
(you can switch just those packages to es5 by putting those two lines in their tsconfigs, which would override the base config they are inheriting from) |
The individual tsconfig files don't seem to be actually taken into account. Maybe it has to do with the removal of the |
Seems to work. Pushing soon (when wifi improves on Eurostar). |
what about this (on top of 01c1536 from this PR) diff --git a/packages/base/test/tsconfig.json b/packages/base/test/tsconfig.json
index 5fbcff44..186097c0 100644
--- a/packages/base/test/tsconfig.json
+++ b/packages/base/test/tsconfig.json
@@ -1,9 +1,11 @@
{
"extends": "../../../tsconfigbase",
"compilerOptions": {
- "types": ["mocha"],
+ "lib": ["dom", "es5", "es2015.promise", "es2015.iterable"],
"outDir": "build",
- "rootDir": "src"
+ "rootDir": "src",
+ "target": "es5",
+ "types": ["mocha"]
},
"include": ["src/*"]
}
diff --git a/packages/base/tsconfig.json b/packages/base/tsconfig.json
index a1e4ba13..cf27bd24 100644
--- a/packages/base/tsconfig.json
+++ b/packages/base/tsconfig.json
@@ -1,8 +1,10 @@
{
"extends": "../../tsconfigbase",
"compilerOptions": {
+ "lib": ["dom", "es5", "es2015.promise", "es2015.iterable"],
"outDir": "lib",
- "rootDir": "src"
+ "rootDir": "src",
+ "target": "es5",
},
"include": ["src/*"]
}
diff --git a/packages/controls/test/tsconfig.json b/packages/controls/test/tsconfig.json
index 21efb391..5e891665 100644
--- a/packages/controls/test/tsconfig.json
+++ b/packages/controls/test/tsconfig.json
@@ -1,9 +1,11 @@
{
"extends": "../../../tsconfigbase",
"compilerOptions": {
- "types": ["mocha"],
+ "lib": ["dom", "es5", "es2015.promise", "es2015.iterable"],
"outDir": "build",
- "rootDir": "src"
+ "rootDir": "src",
+ "target": "es5",
+ "types": ["mocha"]
},
"include": ["src/**/*"]
}
diff --git a/packages/controls/tsconfig.json b/packages/controls/tsconfig.json
index b566925b..31060f20 100644
--- a/packages/controls/tsconfig.json
+++ b/packages/controls/tsconfig.json
@@ -1,8 +1,10 @@
{
"extends": "../../tsconfigbase",
"compilerOptions": {
+ "lib": ["dom", "es5", "es2015.promise", "es2015.iterable"],
"outDir": "lib",
"rootDir": "src",
+ "target": "es5",
"types": ["mathjax", "node"]
},
"include": ["src/**/*"],
diff --git a/tsconfigbase.json b/tsconfigbase.json
index 1c79db37..6e815981 100644
--- a/tsconfigbase.json
+++ b/tsconfigbase.json
@@ -5,7 +5,6 @@
"declaration": true,
"esModuleInterop": true,
"incremental": true,
- "lib": ["dom", "es5", "es2015.promise", "es2015.iterable"],
"jsx": "react",
"module": "esnext",
"moduleResolution": "node",
@@ -14,7 +13,7 @@
"noUnusedLocals": true,
"preserveWatchOutput": true,
"resolveJsonModule": true,
- "target": "es5",
+ "target": "es2017",
"types": []
}
} |
Actually, not, it does not seem that we can change the target by overriding the target in individual |
It seems to work for me. Did you completely clean things out and reinstall the npm packages? |
It builds but produces es2017.
Need to check with a complete git clean.
Was trying to avoid it because of the slow wifi on the eurostar.
…On Mon, Jul 1, 2019, 10:36 Jason Grout ***@***.***> wrote:
Actually, not, it does not seem that we can change the target by
overriding the target in individual tsconfig.json. It is not taken into
account at all.
It seems to work for me. Did you completely clean things out and reinstall
the npm packages?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2472?email_source=notifications&email_token=AASJOFWYTN7VHVNFMO3VTCTP5HF2TA5CNFSM4H4P2UJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY5SIMA#issuecomment-507192368>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASJOFXV67NTUF4ROOF32NTP5HF2TANCNFSM4H4P2UJA>
.
|
I'm fine with either the PR as it stands, or (preferable to me) bumping to es2017 for everything except base and controls, as in my patch above. I still think this involves a major version bump in base, but I think most widget libraries would be able to just add the major version as an 'or' in their semver dependencies, i.e., bqplot probably could release a new patch version with:
as its dependency (and perhaps update the controls dev dependency as well?) |
It definitely produces es5 for me. Perhaps just deleting the incremental compilation caches is enough to redo the build? |
Note that you need to |
|
Still no luck. Trying by deleting things manually. |
I'm confused about this. I thought the compile target bump was the only argument for bumping base? |
01c1536
to
95788e3
Compare
I got it to work by actually nuking my conda environment and re-installing everything. 😖 |
Yeah! Test are passing and third-party widgets work. |
The services dependency went from:
to
Since we use and re-export typings from @jupyterlab/services, having a major version bump there means we need a major version bump. Part of the problem is that the Alternatively, we could just declare that the base package is really on honoring semver for third party widgets. |
To sum up a longer discussion on gitter:
|
Personally, my vote would be on doing major release of the Python package, but not try to rush in all other feature-requests / refactoring that is currently waiting for a major release. Rather, those would be punted to version 9. Most users do not actually have semver ranges for their Python dependencies, so a major bump shouldn't have to be a big thing. Only the very nervous puts ranging on python packages, and I think it would be nice of us to give them a fighting chance. |
Link to even longer gitter discussion that I think is more nuanced than the summary above: https://gitter.im/jupyter-widgets/Lobby?at=5d1a11088dff05627ba70136 |
I'm in favor of:
|
I think moving forward we can:
Then base-manager depends on base-widget, and third-party libraries depend on base-widget, and we have two version numbers to communicate to two separate groups of people. And @vidartf points out that we probably want to bump the compilation target to es2017 as well. I think this would be an excellent change for 8.0 (it is a js-only thing, so we could probably do it before 8.0 if we weren't bumping the compilation target) |
We could probably even leave the base-widget package just called base, and separate out the manager. That would make |
That sounds like a good plan. |
I tried setting jupyter-widgets/base to
in my package.json for my Clustergrammer2 widget in an attempt to get my widget to work on JLab 1.0. Now my widget works in the classic notebook on MyBinder and on my local machine on JLab 1.1.4, however it does not work JLab on MyBinder 0.34 (see https://github.com/ismms-himc/clustergrammer2-test/tree/cgm-0.5.5 for MyBinder links). Is this expected behavior? @jasongrout recommended setting the jupyter-widgets/base requirement to either 1.1.10 or 2 (see jupyterlab/jupyterlab#7063 (comment)) prevented my widget from working on JLab 0.34 (MyBinder) or 1.1.4 (local machine). |
First of all, thank you for the fix with the However, I am a little bit confused about the fix. Can you maybe give a little bit more insight why this works? My guess is something along the following lines: The only thing that the custom extension does at runtime is to check if the dependencies according to the package.json are available. And if so, then its fine? Or does it check this at all? And since notebook and lab come with different versions of @jupyter-widgets/base everything works and this explains why either ^1 or ^2 must be available. |
Summary
For custom widget authors:
The end result of this PR is that in order for a custom widget to work in JupyterLab 1.0, it must require
@jupyter-widgets/base
version 2. To work in the classic notebook or JupyterLab 0.35, it should require@jupyter-widgets/base
version 1. We suggest that a custom widget be updated to depend on@jupyter-widgets/base
version^1 || ^2
in order to work in both the classic notebook, JupyterLab 0.35, and JupyterLab 1.0.