Skip to content

Use npm for js depdencies, bundle with webpack - #13156

Merged
rullzer merged 14 commits into
masterfrom
enhancement/npmize
Jan 9, 2019
Merged

Use npm for js depdencies, bundle with webpack#13156
rullzer merged 14 commits into
masterfrom
enhancement/npmize

Conversation

@ChristophWurst

@ChristophWurstChristophWurst commented Dec 19, 2018

Copy link
Copy Markdown
Member

Fixes#13071

Checklist:

  • "autosize": "4.0.2",
  • "backbone": "1.2.3",
  • "base64": "0.3.0",
  • "blueimp-md5": "2.7.0",
  • "bootstrap": "3.3.7",
  • "clipboard": "1.7.1",
  • "davclient.js": "https://github.com/evert/davclient.js.git#0.1.2", -> not available on npm installed via github
  • "handlebars": "4.0.5",
  • "jcrop": "0.9.12", -> no compatible version on npm, newer one does not work
  • "jquery": "2.1.4",
  • "jquery-migrate": "1.4.0", -> breaks somehow doesn't anymore
  • "jquery-ui": "1.12.1",
  • "jsTimezoneDetect": "1.0.6",
  • "marked": "0.3.6",
  • "moment": "2.18.1",
  • "select2": "3.4.8", -> only newer, not working versions on npm found one
  • "snapjs": "2.0.0-rc1",
  • "strengthify": "0.5.5", -> no npm package NPM package? strengthify#17 made it one Make this a npm package strengthify#25
  • "underscore": "1.8.3",
  • "zxcvbn": "4.4.2",
  • "es6-shim": "^0.35.4"

(Based on https://github.com/nextcloud/server/blob/ad9ece4e4839297e50d34bb50481a78407f6b835/bower.json)

Comment threadpackage.json
@rullzer

Copy link
Copy Markdown
Member

zxcvbn

I guess we'd want to leave that one separate. As it is huge.

@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

I guess we'd want to leave that one separate. As it is huge.

Hugely unmaintained? https://github.com/dropbox/zxcvbn/commits/master

@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

Found https://www.npmjs.com/package/asdfgh. That might be a nice replacement one day.

@rullzer

Copy link
Copy Markdown
Member

👍 would probably make most sense if strengthify uses that directly in a package etc.

@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

Impressive!

$ du core/vendor/core.js 988 core/vendor/core.js
$ du core/js/dist/main.js
972 core/js/dist/main.js

… and that even includes more scripts and styles 🚀

@ChristophWurst

Copy link
Copy Markdown
MemberAuthor
* zxcvbn

This one lib needs special treatment. It's not used directly but loaded dynamically (as @rullzer commted above due to its size). Hence I would propose to leave it vendored, open an enhancement ticket and fix this later on. This PR is already huge and I don't want to start touching any scripts.

@ChristophWurstChristophWurst added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Dec 20, 2018
@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

cc @nextcloud/javascript for review/testing :)

Comment threadpackage.json
Comment threadcore/src/globals.js
@rullzer

Copy link
Copy Markdown
Member

🚀!

So I guess at certain places we can remove additional scripts loaded etc.
But we can followup on that.

So far I did not notice anything doing 💥 yet!

@ChristophWurst

This comment has been minimized.

@ChristophWurst

This comment has been minimized.

@ChristophWurst

This comment has been minimized.

@juliusknorr

This comment has been minimized.

Comment thread.babelrc
@@ -0,0 +1,16 @@
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(unrelevant) I think there is something called babel global config, could be nice using it ?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haven't heard of it but sounds nice ;)

ChristophWurstand others added 8 commits January 9, 2019 15:02
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
…effects
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr

Copy link
Copy Markdown
Member

Rebased and pushed a fix for the select2 result list. Really nice @ChristophWurst 👍

@ChristophWurst

This comment has been minimized.

Comment thread.babelrc
"modules": false,
"targets": {
"browsers": [
"last 2 versions",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah … we can improve that later 😉

@MorrisJobkeMorrisJobke added this to the Nextcloud 16 milestone Jan 9, 2019
@ChristophWurst

This comment has been minimized.

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍 Tested and works 👍

@MorrisJobkeMorrisJobke added 2. developing Work in progress and removed 4. to release Ready to be released and/or waiting for tests to finish labels Jan 9, 2019
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

So https://drone.nextcloud.com/nextcloud/server/14388/248 still fails with

Fixed. This was apparently an issue with 3.4.5 (the latest 3.4 version from npm). Updating to 3.4.8 (the version installed via bower) via git fixed the issue 🚀

@MorrisJobke

Copy link
Copy Markdown
Member

Fixed. This was apparently an issue with 3.4.5 (the latest 3.4 version from npm). Updating to 3.4.8 (the version installed via bower) via git fixed the issue 🚀

Let's see if https://drone.nextcloud.com/nextcloud/server/14389/248 is working.

@MorrisJobke

Copy link
Copy Markdown
Member

Let's see if https://drone.nextcloud.com/nextcloud/server/14389/248 is working.

Yes it does \o/

@MorrisJobkeMorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Jan 9, 2019
@rullzer
rullzer merged commit 011aab5 into masterJan 9, 2019
@rullzer
rullzer deleted the enhancement/npmize branch January 9, 2019 19:16
@MorrisJobkeMorrisJobke mentioned this pull request Mar 5, 2019
@coliff

Copy link
Copy Markdown
Contributor

Hi @ChristophWurst - I saw above you included "bootstrap": "3.3.7", - this version has a couple of XSS vulnerabilities and is not recommended to use. Can you please update that to v3.4.1?
REF:
https://blog.getbootstrap.com/2019/02/13/bootstrap-4-3-1-and-3-4-1/
https://snyk.io/vuln/npm:bootstrap

@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

Yep, we are aware of it and working on integrating the new version: #14352

We are on 3.4.1 meanwhile:

"bootstrap": "^3.4.1",

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancementtechnical debt🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@ChristophWurst@rullzer@juliusknorr@skjnldsv@MorrisJobke@coliff@tcitworld