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

WRN-18582: Migrate to webpack5 #90

Merged
merged 8 commits into from
Mar 23, 2022
Merged

Conversation

MikyungKim
Copy link
Contributor

@MikyungKim MikyungKim commented Mar 21, 2022

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

Migrated to webpack5

Resolution

Updated APIs of plugins
Added #66
Added ILIB_ADDITIONAL_RESOURCES_PATH as defined constants to resolve process is undefined

Additional Considerations

Verbose plugin needs to be fixed in WRN-19252
Warning related to Compliation.assets needs to be fixed in WRN-19249

Links

WRN-18582

Comments

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
const templates = require('./templates');
const vdomServer = require('./vdom-server-render');

const preRenderPluginHooksMap = new WeakMap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this name be preRender...? or can be changed to prerender...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🆗

@@ -523,6 +539,80 @@ function parsePrerender(html) {
return {head, prerender};
}

// Injects assets into html
Copy link
Contributor

Choose a reason for hiding this comment

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

Those 3 functions(injectAssetsIntoHtml, minifyHtml, postProcessHtml) are copies of html-webpack-plugin`s.
Is it impossible that use htmlPluginData.plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are now moved to private functions. I can't reach the postProcessHtml function so I had to move these to here.

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
@hong6316
Copy link
Contributor

hong6316 commented Mar 22, 2022

to @MikyungKim ,
could you answer the below questions?

  • commands/pack.js
    new option --ilib-additional-path added, is it for wp5?

  • config/webpack.config.js
    new ILibPlugin parameter ilibAdditionalResourcesPath added, is it for wp5?

  • while enact pack,
    .ttf files in dist/node_modules/@ enact are double-coloned(ex: Sandstone_Icons..ttf)
    I think we need to check this

  • enact serve not work

  • enact pack --verbose not work(verbose log not printed)

@MikyungKim
Copy link
Contributor Author

MikyungKim commented Mar 22, 2022

to @MikyungKim , could you answer the below questions?

  • commands/pack.js
    new option --ilib-additional-path added, is it for wp5?
  • config/webpack.config.js
    new ILibPlugin parameter ilibAdditionalResourcesPath added, is it for wp5?

Yes. It's related to the process is undefined issue. enact i18n had process.env access from Loader and glue, so we need to embed the environment variable into the plugin. The enact fix is enactjs/enact#3034.

  • while enact pack,
    .ttf files in dist/node_modules/@ enact are double-coloned(ex: Sandstone_Icons..ttf)
    I think we need to check this

🤔 I'm not sure. let's check.

  • enact serve not work

I tested and it's working. Let me check with you.

  • enact pack --verbose not work(verbose log not printed)

It'll be handled in the other ticket as I mentioned in the ticket.

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)
Copy link
Contributor

@hong6316 hong6316 left a comment

Choose a reason for hiding this comment

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

LGTM

@hong6316 hong6316 merged commit 9a5cd1e into feature/webpack5 Mar 23, 2022
@hong6316 hong6316 deleted the feature/WRN-18582 branch March 23, 2022 00:21
hong6316 added a commit that referenced this pull request Apr 11, 2022
* WRN-18582: Migrate to webpack5 (#90)

* WRN-18582: webpack5 initial commit

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* WRN-18582: Migrated isomorphic and snapshot plugin

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* update verbose plugin

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix travis errors

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* update dependencies

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix based on review

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* update shrinkwrap

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* WRN-12124: Remove deprecated babel-eslint module (#87)

* use @babel/eslint-parser

* remove babel-preset-react-app

* remove @babel/eslint-parser

* Revert "remove @babel/eslint-parser"

This reverts commit 98ec872.

* Revert "remove babel-preset-react-app"

This reverts commit 70a93e2.

* Revert "use @babel/eslint-parser"

This reverts commit 5c15b55.

* babel-eslint -> @babel/eslint-parser

* add CHANGELOG.md

* Update package.json

Co-authored-by: Mikyung Kim <mikyung27.kim@lge.com>

* update npm-shrinkwrap.json

* removed unused dependency

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* update eslint-config-prettier

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

Co-authored-by: Mikyung Kim <mikyung27.kim@lge.com>

* WRN-19252: Fix VerboseLogPlugin is not working (#91)

* WRN-19252: Use ProgressPlugin from originated place

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* pinned webpack version

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* WRN-12748: Update eslint 8 related modules (#88)

* update eslint 8

* Update package.json

* Update package.json

Co-authored-by: Mikyung Kim <mikyung27.kim@lge.com>

Co-authored-by: Mikyung Kim <mikyung27.kim@lge.com>

* WRN-19694: Support for React18 (#92)

* update react version

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* update dependencies

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* WRN-19694: Add react18 support

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* WRN-20218: Fix eanct pack --framework and --externals options (#93)

* WRN-20218: Fix enact pack --framework

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix context

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix lint

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix local node_modules files and files ends with .js module id

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* fix

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* WRN-20481: Fixed miss made module id and miss referenced library (#94)

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* Fix prerendering regex

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

* update dependencies

Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com)

Co-authored-by: taeyoung.hong <35059065+hong6316@users.noreply.github.com>
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.

None yet

2 participants