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

package.json: Update @patternfly/react-console package dependency #9579

Closed
wants to merge 1 commit into from
Closed

package.json: Update @patternfly/react-console package dependency #9579

wants to merge 1 commit into from

Conversation

cockpituous
Copy link
Contributor

@cockpituous cockpituous commented Jul 4, 2018

Check for any outstanding update of point version of any outstanding NPM package dependency

  • npm-update

@cockpituous cockpituous added the bot label Jul 4, 2018
@cockpituous
Copy link
Contributor Author

npm-update in progress on cockpit-tasks-dflfh.
Log: http://fedorapeople.org/groups/cockpit/logs/npm-update-9579-20180704-134646/

@cockpituous cockpituous changed the title Check for NPM dependency updates WIP: cockpit-tasks-dflfh: Check for NPM dependency updates Jul 4, 2018
@cockpituous cockpituous changed the title WIP: cockpit-tasks-dflfh: Check for NPM dependency updates WIP: cockpit-tasks-4p5bk: Check for NPM dependency updates Jul 4, 2018
@cockpituous
Copy link
Contributor Author

npm-update in progress on cockpit-tasks-4p5bk.
Log: http://fedorapeople.org/groups/cockpit/logs/npm-update-9579-20180704-134747/

@cockpituous
Copy link
Contributor Author

@cockpituous
Copy link
Contributor Author

Please manually check features related to these files:

pkg/machines/components/serialConsole.jsx:import { SerialConsole } from '@patternfly/react-console';
pkg/machines/machines.less:// For patternfly-react and @patternfly/react-console
pkg/machines/machines.less:@import "~@patternfly/react-console/dist/less/console.less";

@cockpituous cockpituous added the bot label Jul 4, 2018
@cockpituous cockpituous changed the title WIP: cockpit-tasks-4p5bk: Check for NPM dependency updates package.json: Update @patternfly/react-console package dependency Jul 4, 2018
@martinpitt
Copy link
Member

I cannot reproduce this on my Fedora 28 system, but I get it in a cockpit/tests container.

@martinpitt martinpitt self-assigned this Jul 8, 2018
@martinpitt
Copy link
Member

I keep getting this in the container:

$ NODE_ENV=production SRCDIR=/build/cockpit BUILDDIR=. ./tools/webpack-make -d dist/machines/Makefile.deps ./webpack.config.js
Hash: 22b018da1d711d0f280a
Time: 27259ms
chunk    {0} machines/machines.min.js, machines/machines.css, machines/machines.min.js.map, machines/machines.css.map (machines/machines) 3.28 MB [rendered]
chunk    {1} machines/test-machines.min.js, machines/test-machines.css, machines/test-machines.min.js.map, machines/test-machines.css.map (machines/test-machines) 150 kB [rendered]
chunk    {2} machines/vnc.min.js, machines/vnc.min.js.map (machines/vnc) 344 kB [rendered]

ERROR in machines/machines.min.js from UglifyJs
SyntaxError: Unexpected token: keyword (function) [./~/@novnc/novnc/core/util/logging.js:20,0]

A quick google search sems to indicate that this might be related to wrong Babel settings - but why does that work on Fedora 28 (my host) and not Fedora 27 (the container).. Both have the same npm (5.6.0) and node (8.11.3) version, and pretty much all the rest (in particular, Uglify.js, babel, and webpack) are used from npm.

@martinpitt
Copy link
Member

martinpitt commented Jul 8, 2018

I can reproduce this locally (no container) on Fedora 28 as well. It happens when I directly run bots/image-prepare in a clean tree (which will build locally first through make-source).

This works:

./autogen.sh --enable-debug && make -j4

This doesn't:

./autogen.sh && make -j4

I tried to fix the broken build with

NODE_ENV=development SRCDIR=`pwd` BUILDDIR=. ./tools/webpack-make -d dist/machines/Makefile.deps ./webpack.config.js && touch dist/machines/stamp

i. e. switching from production to development for that one webpack, same for ovirt; but continuing the build with make just rebuilds these webpacks again (and failing again).

This is because our webpack.config.js only calls webpack.optimize.UglifyJsPlugin in production mode, not in debug.

@martinpitt
Copy link
Member

I tried building cockpit with a newer uglify, which works well by itself. But together with the react-console bump, it fails again, but now the error looks different:

chunk    {0} machines/machines.min.js, machines/machines.css, machines/machines.min.js.map, machines/machines.css.map (machines/machines) 3.28 MB [rendered]
chunk    {1} machines/test-machines.min.js, machines/test-machines.css, machines/test-machines.css.map (machines/test-machines) 150 kB [rendered]
chunk    {2} machines/vnc.min.js (machines/vnc) 344 kB [rendered]

ERROR in machines/machines.min.js from UglifyJs
Export statement may only appear at top level [machines/machines.min.js:87082,1]

Indeed in machines.min.js the export function init_logging (level) is not at the top level, due to the webpack nesting. But it is at the top-level in the original node_modules/@novnc/novnc/core/util/logging.js.

I noticed that this function is also being called from react-console:

node_modules/@patternfly/react-console/dist/esm/VncConsole/VncConsole.js:      NovncLog.init_logging(vncLogging);
node_modules/@patternfly/react-console/dist/js/VncConsole/VncConsole.js:      NovncLog.init_logging(vncLogging);

This is new in 1.4.0, and most certainly is the relevant change here. Before that, the function was only being called from within noVNC.

@martinpitt martinpitt removed their assignment Jul 8, 2018
@mareklibra
Copy link
Contributor

The change is actually needed by #8894, which includes upgrade of patternfly/react-console to 1.4.1 (recently) as well. The #8894 builds well (locally).

I think this PR can be closed.

@martinpitt
Copy link
Member

@mareklibra : OK, good to know. Then I figure we don't need to bother with tracking this down further. But it seems to me that moving to react still needs quite some work? A lot of PRs went in already, but I've lost track.

@martinpitt martinpitt closed this Jul 12, 2018
@mareklibra
Copy link
Contributor

@martinpitt , right, still something to do. I'll rebase the "top-level" react patch so it will be more clear what remains.
Unfortunately, I was busy with other projects last weeks so was not able to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants