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

Working to finish - feature/encore-webpack #6177

Closed

Conversation

wbloszyk
Copy link
Member

@wbloszyk wbloszyk commented Jun 30, 2020

Subject

This PR rebase and prepare to merge work done in #5461 by @silasjoisten

I am targeting this branch, because {reason}.

Closes #5454, #5461.

Changelog

### Added
- Added some `Class::newMethod()` to do great stuff.

### Changed

### Deprecated

### Removed

### Fixed

### Security

@wbloszyk
Copy link
Member Author

wbloszyk commented Jul 1, 2020

This PR is not RTM but I want present some informations about it.

  • 476 files will be remove from vendors
  • yarn.lock with 7000+ lines will be added
  • some files will be move or generated by webpack
  • current AdminBundle assets system will be replace by encore-webpack

TODO:

  • improve documentation
  • check builds registred to twig global sonata_admin_webpack_entries
  • remove TODOs

IMHO encore-webpack should be add to 3.x branch with some change:

  • new config option sonata_admin.options.assets_system should be added [deprecated_assets or encore-webpack]
  • vendors files should not be remove in 3.x
  • symfony/encore-webpack should be suggested

This will also allow add Bootstrap 4 templates to Sonata 3.

WDYT? @greg0ire, @core23, @phansys, @jordisala1991, @VincentLanglet

@jordisala1991
Copy link
Member

What about having 2 options: If I want to compile myself the assets using this way I can add them to my webpack encore configuration. But what about if I only want to have the assets compiled directly? Should we add here the minified one?

@VincentLanglet
Copy link
Member

What about having 2 options: If I want to compile myself the assets using this way I can add them to my webpack encore configuration. But what about if I only want to have the assets compiled directly? Should we add here the minified one?

I would prefer having the AdminBundle without the assets and create another repository with the minified assets.
This will avoid webpack users to download the minified assets for nothing. WDYT @jordisala1991 ?

@wbloszyk
Copy link
Member Author

wbloszyk commented Jul 1, 2020

What about having 2 options: If I want to compile myself the assets using this way I can add them to my webpack encore configuration. But what about if I only want to have the assets compiled directly? Should we add here the minified one?

Good idea. We should add webpack to sonata/sandbox, not only AdminBundle. (Probably only AdminBundle and PageBundle)

Step 1:
Add encore-webpack as optional for people who know what to do with it

Step 2:
Add Boostrap 4 and AdminLTE 3 templates

Step 3:
Prepare compiled assets and add it as another option

Step 4:
Remove deprecated_assets in master. People will be force to use webpack, anyway they got compiled assets, so knowlage about webpack will not be reqiure.

@jordisala1991 This will be OK?

@wbloszyk
Copy link
Member Author

wbloszyk commented Jul 1, 2020

What about having 2 options: If I want to compile myself the assets using this way I can add them to my webpack encore configuration. But what about if I only want to have the assets compiled directly? Should we add here the minified one?

I would prefer having the AdminBundle without the assets and create another repository with the minified assets.
This will avoid webpack users to download the minified assets for nothing. WDYT @jordisala1991 ?

Something like symfony/recipies for assets?

@wbloszyk
Copy link
Member Author

wbloszyk commented Jul 1, 2020

I start working on Step 1. Other things can be add later.

@jordisala1991
Copy link
Member

This PR is more like: https://github.com/Sylius/Sylius (You have to build your own assets on the project using Sylius to have admin styles)
Static assets: https://github.com/EasyCorp/EasyAdminBundle (You have the webpack config there, but you have the compiled files generated on each release)

Maybe we can have the good things of both worlds.. that's what I was suggesting

@core23 core23 mentioned this pull request Jul 2, 2020
@wbloszyk
Copy link
Member Author

wbloszyk commented Jul 2, 2020

@jordisala1991 I check you proposition.

Sylius/Sylius is more like sandbox, where prople have shop and admin config.
EasyAdminBundle is more like SonataAdminBundle and it is only part of project.

I almost done alfa version for 3.x branch. I don't wanna release it becouse:

IMHO, better way will be add webpack to sandbox and then split them to sepete config/build. This way will be easier to get @jordisala1991 idea form #6177 (comment)

@SonataCI
Copy link
Collaborator

SonataCI commented Jul 8, 2020

Could you please rebase your PR and fix merge conflicts?

@wbloszyk
Copy link
Member Author

Close in favor of sonata-project/dev-kit#779

@wbloszyk wbloszyk closed this Jul 10, 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.

5 participants