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

[DO NOT MERGE] Optimize Webpack Performance and bundle size #7772

Closed
wants to merge 14 commits into from
Closed

[DO NOT MERGE] Optimize Webpack Performance and bundle size #7772

wants to merge 14 commits into from

Conversation

MTRNord
Copy link
Contributor

@MTRNord MTRNord commented Dec 4, 2018

This commit does what I explained in #7391

It needs this PR too: matrix-org/matrix-react-sdk#2323

Signed-off-by: Marcel Radzio <mtrnord1 [at] gmail.com>

THIS PR MIGHT BREAK OTHER PRS! It is needed that imports of react-sdk reference src instead of lib

@MTRNord
Copy link
Contributor Author

MTRNord commented Dec 4, 2018

The build is expected to fail because it did not find the react-sdk PR because this PR was opened first.

A restart should fix the build failure if the fetch script is smart enough

@MTRNord
Copy link
Contributor Author

MTRNord commented Dec 4, 2018

A small change on react-sdk side is needed before this can get merged

@MTRNord
Copy link
Contributor Author

MTRNord commented Dec 4, 2018

I do think both tests fail because they dont find each other counter branch :( fatal: Remote branch webpack4-optimizations not found in upstream origin

@MTRNord MTRNord changed the title [WIP] Optmize Webpack Performance and bundle size Optmize Webpack Performance and bundle size Dec 27, 2018
@MTRNord
Copy link
Contributor Author

MTRNord commented Dec 27, 2018

Tests are failing because it fails to resolve the correct compainion branch. Please test it locally first before merging.

@jryans
Copy link
Collaborator

jryans commented Feb 27, 2019

@MTRNord Now that we're past 1.0, I'd like to nudge this forward, but it will need some rebasing. Are you interested in updating it, or shall I take a look?

@MTRNord
Copy link
Contributor Author

MTRNord commented Feb 27, 2019

@jyrans I can try to fix the merge issues. But I expect the CI to still fail because it doesn't find its companion branch on the sdk. You should test it locally before merging!

@jryans
Copy link
Collaborator

jryans commented Feb 27, 2019

You should test it locally before merging!

I may also re-push it as a branch on the matrix and vector repos once the rebase is ready to hopefully see the green checks there at least. CI can figure out the matching branches, but currently it doesn't work for forked repos like this yet... 😭

@MTRNord
Copy link
Contributor Author

MTRNord commented Feb 27, 2019

@jryans I just made a rebase on the new develop branch on riot-web (Thats why it says force pushed). A rebase for the sdk is on its way

@jryans jryans changed the title Optmize Webpack Performance and bundle size Optimize Webpack Performance and bundle size Mar 7, 2019
@jryans
Copy link
Collaborator

jryans commented Mar 20, 2019

@MTRNord We just added support for testing matching branches from forks, so your branches here should hopefully be testable now! 😄 If you merge in matrix-org/matrix-react-sdk#2807 and #9212, we should get some proper CI results here.

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

@jryans will do when near my PC :)

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

@jryans made a rebase to curent develop. Lets see if this still works like on my local PC

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

Seems like it still doesnt build on CI I will investigate

@jryans
Copy link
Collaborator

jryans commented Mar 20, 2019

It did find your matching branches though, so that's great to see! Hopefully the errors that remain are actual problems that can be fixed.

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

It did find your matching branches though, so that's great to see! Hopefully the errors that remain are actual problems that can be fixed.

It seems like they are :) Working on a fix. Seems like it tries to load still from the lib folder on the react sdk somewhere. TBH the error message is not that helpful ^^

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

@jryans for some reason it seems to not find the src folder in the react sdk at all. Is it maybe a bug on the resolving itself?

@jryans
Copy link
Collaborator

jryans commented Mar 20, 2019

@jryans for some reason it seems to not find the src folder in the react sdk at all. Is it maybe a bug on the resolving itself?

Some errors are still lib paths to update it looks like:

ERROR in ./src/components/views/auth/VectorCustomServerDialog.js
Module not found: Error: Can't resolve 'matrix-react-sdk/lib/languageHandler' in '/workdir/src/components/views/auth'

However there are also src paths like:

ERROR in ./src/vector/platform/VectorBasePlatform.js
Module not found: Error: Can't resolve 'matrix-react-sdk/src/BasePlatform' in '/workdir/src/vector/platform'

which is I guess why you're asking? It's possible this is related to how CI currently checks out the other repos, which is different than what we do on local dev machines: CI checks out the SDKs inside the riot-web directory, which means that are at a different nesting level than a local environment would use. Perhaps you can try simulating this setup locally to see if the errors happen because of it?

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

@jryans I can do normal build local but not test. So I guess thats a karma issue as well. I am still debugging why it happens. The paths look for node_modules/matrix-react-sdk and as they are on CI linked that path should be fine.

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

@jryans found the error. I have an alias to make the index.js overwritten. But that one also causes to let imports fail :/

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

Seems like there is a babel-loader issue too. Will spin up a linux to check in there. It has a different error on my dev PC so it is super hard to debug

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

Found the error: The import resolving on linux is different on linux than on my windows PC. And the module instead of main usage in package.json causes module.export = {} to not be accepted when importing. I will search for another way

@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

Seems like I essentialy made this a monorepo and babel hates me for doing that. The only way I see is to upgrade babel and babel-loader in riot-web and replace .babelrc with babel.config.js and fix imports in react-sdk to allow importing files that use module.exports :( This might make this PR horrible. Means I will do that, commit it and make a new PR from scratch to clean it up.

(This would by the way fix #7731 as a side effect)

@MTRNord MTRNord closed this Mar 20, 2019
@MTRNord
Copy link
Contributor Author

MTRNord commented Mar 20, 2019

This PR is closed. I will reopen until I get this to build again. I guess I will make the babel upgrade a seperate PR too

@MTRNord MTRNord reopened this Mar 21, 2019
@MTRNord MTRNord changed the title Optimize Webpack Performance and bundle size [DO NOT MERGE] Optimize Webpack Performance and bundle size Mar 21, 2019
@MTRNord MTRNord closed this Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants