Comments (7)
Oh no!
I was also looking at Rollup which seems to be pretty modern and also has an API: https://rollupjs.org/guide/en/#rolluprollup
For example, maybe we could build the bundle by passing separately such entry points:
- src/index.js
- any portal files
- any journey step components
- the config json
We would not generate src/actionPage.js as with webpack, instead we would just tell rollpack which files to add, and each of them would store the component in a global window.proca.components.Register
etc; Then in src/components/Widgets.js we would read the global window.proca.config
and window.proca.components.X
.
Right now it's also dynamic, but uses config to read the steps
variable which is imorted from actionPage.js
Actually I am not sure why we did not consider this - passing the dynamic "imports" via window
and not hacking the builder to generate a "static" imports...
I mean, in each step component we can do:
window.proca.components.Share = Share;
instead of
module.exports = {Share}
Quite similar no? :P
from proca.
When I looked at rollup, I didn't find options to build a module (proca), or to generate a single js file, but admittedly, I didn't look too long.
Some components are sometimes used directly (eg Register) or as a sub component (eg Petition or Email), how would it work?
coming back to the need: having a simple <script src=widget_name async></script> that:
- create a global.proca that contains various functions (go, set...)
- build the widget (equivalent of proca.go() )
build the widget has a bunch of modes:
- put the widget where the <script> is (default)
- put the widget where class="proca-widget" is (if exists)
- if proca-widget contains some content, put it as a left hand column and the widget on the right hand column
- delay the display (eg to deal with re-hydratation)
- wait for proca.go to display (more advanced interface)
we also build the index.html page (can use different template set in the config, eg eci vs "normal") so we have a preview (convenient for demo/debug)
and a nice dev mode that automatically reloads when the code is changed.
if we could skip the webpack monstrosity and achieve all of that, it would be awesome!
from proca.
Some components are sometimes used directly (eg Register) or as a sub component (eg Petition or Email), how would it work?
For sure components are just functions so you could even write <window.proca.components.Register />
as I understand it
from proca.
we also build the index.html page (can use different template set in the config, eg eci vs "normal") so we have a preview (convenient for demo/debug)
Does it have to be built? (how much changes there? ) or could we just reuse one written by hand? (I am asking for case where the builder would just output Js, not JS+ html..)
As for outputs, what else do we need? map file? what else?
from proca.
from proca.
For sure components are just functions so you could even write
<window.proca.components.Register />
as I understand it
almost: react adds a bunch of constraints on the function name (eg if should start with an uppercase), but
const Register = global.proca.component.Register would allow to <Register />.
this being said, we can probably keep both the export and the global.proca.component.xxx
from proca.
After further tests, moved to esbuild, good feature set and magic fast
from proca.
Related Issues (20)
- replaceAll polyfill HOT 1
- Change progress keys based on action type HOT 1
- handle snowflake for twitter
- handle bin/templates to create html for each language of the campaign HOT 1
- add a intro + readmore component HOT 1
- proca-cli action:replay doesn't handle "since"
- Extracting default email strings should be improved HOT 1
- change the format of the birthdate
- No split consent for coordinator
- fetch all campaigns and widgets for an org
- fetch detail by contactRef uuid? HOT 2
- clarify the error message
- share from email
- handle matomo parameters
- Target not shown on Twitter step
- subject and body not filled when client based mtt HOT 1
- allow cross step snackbar
- No confirm action alert HOT 4
- on MTT, prevent submitting when no targets are selected
- on MTT with select by group, allow to only display the selected items
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proca.