205 Commits

Author SHA1 Message Date
Rostislav Wolny
ae33ab8d82 Fix loading opt-in block metadata
Build version of plugin doesn't contain assets/js folder.
We need to copy block.json file with the metadata to assets/dist directory and load it from there.
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Rostislav Wolny
47423f2e22 Rename frontend.tsx file to frontend.ts
The file doesn't use any jsx syntax.
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Nadir Seghir
25c96f8080 one line of eslint-disable
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Nadir Seghir
4b20130d68 return void from requestToHandle to let native handling in package run
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Nadir Seghir
bdb2434ed9 return void from requestToHandle to let native handling in package run
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Mike Jolley
0b09dd3f50 Update webpack config so it's easier to diff
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Mike Jolley
d32ed232d1 Revert webpack config changes
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Mike Jolley
72d4db26e3 Checkbox implementation and refactor naming structure
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Mike Jolley
0f5b7d0ac7 Checkbox implementation
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Mike Jolley
53d3fb9c1e Basic block structure and checkbox import
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Mike Jolley
78e0ac4d4a Initial build config and init from php side
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Rostislav Wolny
32f577920a Add webpack.config.js to eslint check and fix issues
[MAILPOET-3752]
2021-10-18 11:09:09 +02:00
Rostislav Wolny
dac4fb5dd0 Replace clean-webpack-plugin with initial cleanup in Robofile
We need to share the same output path (assets/build/js) in more configs
in order to generate a common manifest.json file.
The cleanup plugin and also build-in output.clean setting do the cleanup on emit
and that causes that they delete files we want to keep.
Using different output paths solves the problem with cleanup but it causes that we generate a bunch of manifest.json files
instead of one.
As simplest workaround I chose cleaning the output directory before we trigger the Webpack build in the Robofile.
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
ae19e3f771 Cleanup expose loader configuration
We used to need to expose much more libraries for the premium plugin.
Some time ago we moved a lot of premium functionality to the free plugin
and we don't need to expose those modules any more.
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
0f899c3186 Add comment for admin_vendor entry and remove unnecessaty packages
@emotion/react @emotion/style don't have to be added here since they are not shared.
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
e1c84f8d6d Use commons chunk for JS code shared between entry points
This is a replacement for previous admin_vendor_chunk
see 422245e3e6/webpack.config.js (L235-L251)
The automatic splitting based on minChunks seems to give better results.
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
c6f9e240d8 Reintroduce clean webpack plugin
We used custom script because we were stuck with the old version the cleanup plugin and it had some issues.
Now with webpack5 we can use the plugin again.
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
9bb9e424f4 Fix module resolving for chai
Eslint was not able to load chai with webpack import loader due error:
Package path . is not exported from package /node_modules/chai (see exports field in chai/package.json)
Pointing directly to node_modules/chai/index.js bypasses checking exports property in package.json
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
9d0ee166fc Fix cleaning up js dist folder before build
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
e7480abd0e Fix deprecation warning about hashes in JS production build
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
cc796c24ba Allow overriding global Backbone
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
5788e0fbe2 Fix file naming in manifest.json
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
83ed5d9364 Add process polyfill for browsers
This was previously added by webpack4. It is needed in the form editor.
Solves error Uncaught ReferenceError: process is not defined
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
952e18c25b Use default cache groups chunks
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
84ee3f9b0f Fix handlebars warning in newsletter test build
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
715f32f5f2 Update configuration for expose, import and export loaders
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
8cdebc39d0 Remove unnecessary jsonpFunction from webpack config
This is done automatically on v5
See https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-unique-naming
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
bb0fd44d95 Add fallback dummy nodejs path module
The path is required in css module which we use for parsing
custom css string in the form editor.
We don't use functionality which is dependent on nodejs path module
so we can use "dummy" module. Alternatively we could install a polyfill for brower
for the path module but it would increase a package size with functions we don't use.
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
010bc3b8d8 Replace node polyfills configuration with dummy fallback
They removed default polyfills but some dependecies require those
so this replaces those modules.
See https://webpack.js.org/migrate/5/#clean-up-configuration

[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
48f4c6ab64 Fix import of WebpackManifestPlugin
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
422245e3e6 Merge settings and form_editor webpack configs into admin config
Form editor and settings used to have a separate configs because we
they use lodash and it conflicted with underscore in newsletter edtior.
We had recently fixed that conflict and now we can add them to admin.
This also resolves an issue with multiple loading of @emotion/react
[MAILPOET-3654]
2021-08-30 12:10:55 +02:00
Rostislav Wolny
2b3594ca5a Use webpack bail option only for production build
This was causing js watch to exit on errors
[MAILPOET-3654]
2021-08-30 12:10:55 +02:00
Rostislav Wolny
ea695ad5d1 Update webpack cli
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Rostislav Wolny
ea5bc1ab2c Replace webpack cleanup plugin with simple deletion
The cleanup plugin was not working properly as it is not designed for multi config environments.
It deleted tests assets after they were built.
[MAILPOET-3673]
2021-07-02 07:28:41 +02:00
Pavel Dohnal
65255ae867 Fix lodash/underscore overriding in the newsletter editor
[MAILPOET-3201]
2020-11-17 14:16:14 +01:00
Ján Mikláš
436268a481 Fix missing resolve extensions for tests webpack
[MAILPOET-3257]
2020-11-11 14:58:41 +01:00
Pavel Dohnal
3128b24070 Remove old files
[MAILPOET-2791]
2020-10-22 10:00:23 +02:00
Rostislav Wolny
cbc4820c6a Expose Tag,Button common components for premium
[PREMIUM-145]
2020-09-03 15:04:11 +02:00
Pavel Dohnal
0724cfca0f Update webpack packages
[MAILPOET-2953]
2020-06-08 13:27:10 +02:00
Rostislav Wolny
a7cea43aac Refactor form preview specific FE functionality to extra module
[MAILPOET-2811]
2020-05-27 11:23:02 +02:00
Pavel Dohnal
e5639d1adb Remove SPF notice
[MAILPOET-2867]
2020-04-27 14:25:58 +02:00
Amine Ben hammou
33ccb84744 Create a separate bundle for settings
[MAILPOET-2676]
2020-03-16 08:03:26 +01:00
Amine Ben hammou
33948892fa Add possibility to omit extensions
[MAILPOET-2658]
2020-03-02 20:55:24 +00:00
Amine Ben hammou
cbe2fc64bb Install and configure Typescript
[MAILPOET-2658]
2020-03-02 20:55:24 +00:00
Pavel Dohnal
261624c2bb Create basic block
[MAILPOET-1798]
2020-02-17 19:20:36 +00:00
Rostislav Wolny
353a16fcb5 Remove unnecessary expose of html2canvas
[MAILPOET-2683]
2020-02-05 18:33:42 +00:00
Pavel Dohnal
fe84b9f9fb Remove the old form editor
[MAILPOET-2625]
2020-01-30 18:29:02 +00:00
Rostislav Wolny
6015a1370d Refactor simple JS to be main JS tests
[MAILPOET-2455]
2019-11-28 15:39:50 +00:00
Rostislav Wolny
857d0c79ab Rename index.jsx files to match naming pattern
[MAILPOET-2450]
2019-11-06 16:54:40 +00:00
Rostislav Wolny
ac0fd14c7c Add new form editor hello world
[SHOP-2450]
2019-11-06 16:54:40 +00:00