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

Convert to using Webpack for JavaScript and CSS #104

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

gauthierm
Copy link
Member

@gauthierm gauthierm commented Dec 31, 2017

Experiment to replace SwatHtmlHeadEntry with webpack.

This moves the dependency graph from PHP to JS and means we don't need two dependency graphs (one in PHP and one in YAML).

Proof of concept runs the Swat demo using ES6 modularized Swat widgets.

More work required to:

  • modularize YUI 2 and import the parts we need
  • incorporate tinymce somehow
  • see about bundle splitting, right now everything is one bundle
  • expose some more poorly written functions to global NS
  • delete IE 6 and 7 hacks

Testing

Swat demo can be used to test:

  1. check out this PR
  2. cd demo/
  3. composer install
  4. yarn install
  5. yarn build
  6. cd www/
  7. php -S localhost:8000

@gauthierm
Copy link
Member Author

Issues with YUI 2 with webpack:

  • YUI code is written expecting globals. Can resolve this with custom exports/provides webpack config
  • Dom has circular reference to Element. Fixed by making a custom loader that patches file on build.
  • Element.addListener method uses IE hacks that crash modern browsers. Need to monkey-patch Element some-how. Done again with custom loader.

@gauthierm
Copy link
Member Author

@gauthierm gauthierm marked this pull request as draft September 29, 2020 14:00
@gauthierm gauthierm changed the title Webpack Convert to using Webpack for JavaScript and CSS Feb 20, 2022
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.

1 participant