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

feature/encore-webpack #5461

Closed

Conversation

silasjoisten
Copy link
Contributor

@silasjoisten silasjoisten commented Feb 3, 2019

Subject

Closes #5454

Review

  • You can ignore the src/Resources/public/dist
  • You need to add the following in your sonata_admin.yaml or webpack_encore.yaml
webpack_encore:
    builds:
        sonata_admin: '%kernel.project_dir%/public/bundles/sonataadmin/dist'
        app: '%kernel.project_dir%/public/build' # Handling multiple entry points.

There is a compiler pass which is reading the webpack_encore.builds config and adding them to twig globals. In template there will automtically added.

Reference

Related PR

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/DependencyInjection/SonataAdminExtension.php Outdated Show resolved Hide resolved
@silasjoisten
Copy link
Contributor Author

silasjoisten commented Feb 5, 2019

@OskarStark it never worked with jQuery 3 see https://github.com/sonata-project/SonataAdminBundle/blob/3.x/src/Resources/public/vendor/jquery/dist/jquery.js

The DateTimePicker lib just works with jQuery 2

]
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add new line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is generated

Copy link
Member

Choose a reason for hiding this comment

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

Argh this should not happen, do you know where we need to head to provide a PR?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

friendly ping @weaverryan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@OskarStark i figured out:

manifest.json is generated: https://github.com/symfony/webpack-encore/blob/master/lib/plugins/entry-files-manifest.js#L80

But for entrypoints.json i didn't find the place where that happens

.gitignore Outdated Show resolved Hide resolved
@OskarStark
Copy link
Member

Maybe we should add an option where he dont need to override the template.

Yes we should do this IMO

@SonataCI
Copy link
Collaborator

SonataCI commented Mar 9, 2019

Could you please rebase your PR and fix merge conflicts?

package.json Show resolved Hide resolved
@silasjoisten
Copy link
Contributor Author

silasjoisten commented Mar 11, 2019

Maybe we should add an option where he dont need to override the template.

Yes we should do this IMO

@OskarStark i think a configuration option is not good for this, because this config is related to WebpackEncore. Maybe i update the FlexRecipe of SonataAdminBundle? What would you say?

@core23
Copy link
Member

core23 commented Mar 12, 2019

Should we include the dist folder (https://github.com/silasjoisten/SonataAdminBundle/tree/feature/encore-webpack/src/Resources/public/dist)? This disallows using the latest (secure) version of a frontend library.

@SonataCI
Copy link
Collaborator

Could you please rebase your PR and fix merge conflicts?

@silasjoisten
Copy link
Contributor Author

silasjoisten commented Mar 19, 2019

Should we include the dist folder (https://github.com/silasjoisten/SonataAdminBundle/tree/feature/encore-webpack/src/Resources/public/dist)? This disallows using the latest (secure) version of a frontend library.

The other opportunity would be pushing to npm.js but this is not that as good because this "lib" wont work without the php stuff. I think its good to commit the dist folder and update manually from time to time. Other thing is that many frontend libs does not do sematic versioning so can be problematic to update them.

@SonataCI
Copy link
Collaborator

SonataCI commented Apr 2, 2019

Could you please rebase your PR and fix merge conflicts?

webpack.config.js Outdated Show resolved Hide resolved
@core23
Copy link
Member

core23 commented Feb 17, 2020

Can you give a short status report @silasjoisten ? Is this stable enough, so we can review and merge this?

@OskarStark
Copy link
Member

Can you fix CS please?

yarn.lock Show resolved Hide resolved
@SonataCI
Copy link
Collaborator

SonataCI commented Mar 1, 2020

Could you please rebase your PR and fix merge conflicts?

@core23
Copy link
Member

core23 commented Mar 1, 2020

The Checklist is completed? Is this RTM @silasjoisten ?

@SonataCI
Copy link
Collaborator

SonataCI commented Mar 2, 2020

Could you please rebase your PR and fix merge conflicts?

@psyray
Copy link
Contributor

psyray commented Mar 19, 2020

@silasjoisten Thanks for your work 👍
Really looking forward to using webpack with Sonata :)

@wbloszyk
Copy link
Member

@silasjoisten I'm working on your webpack. I will fix commits structure. . Dont use merge (branch) to update data. It blocks previus commits and make history ugly.

Also use git rebase to update data(move your branch to head other branch). Then you can add so many commits as you want (e.g. for testing). Before merge your PR to production you can merge commits to keep clear history. (e.g. documentation in this PR can be merge to one commit).

@VincentLanglet
Copy link
Member

Hi @silasjoisten ! Is something missing in this PR or is it RTM ?
If something is missing, can we help you ? This PR would be great for the next major :)

@silasjoisten I'm working on your webpack.

Do you know what is missing to finish this PR @wbloszyk ?

@wbloszyk
Copy link
Member

There is still some work to be done.

I also work with assets while sonata-project/dev-kit#697. After drop core i can finish this PR. Also will be nice to have upgraded sandbox to add encore to all sonata bundles (I have done AdminLTE and Bootstrap 4 branch).

Can you check:
sonata-project/sandbox#623

@nieuwenhuisen
Copy link
Contributor

Can we help with anything to move this PR forward?

@wbloszyk
Copy link
Member

wbloszyk commented Aug 4, 2020

@nieuwenhuisen This PR is not contributing for some time. I worked on it too. It is now move to sandbox (webpack branch). Here is issue for it:
sonata-project/dev-kit#779

BTW
You can help with extract javascript to webpack assets. If you intrested I will try to finish and merge sonata-project/sandbox#630 today. After that you will get tools to do it. This should help: https://github.com/sonata-project/sandbox/pull/630/files#diff-7fd7d5a1264ad8b6ca4aa13fd1341af2

@wbloszyk
Copy link
Member

This PR should be done in https://github.com/sonata-project/sandbox/tree/webpack as proof of concept. Then we can easy move it to this repository.

Thank you for you current work @silasjoisten. It is awesone example.

If you want help and work on it feel free to reopen this PR.

@wbloszyk wbloszyk closed this Oct 21, 2020
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.