-
Notifications
You must be signed in to change notification settings - Fork 136
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
Object plugin #144
Object plugin #144
Conversation
…to source) - Tests now restore original operation after running to avoid polluting other tests (since they modify static values versus instance values) - filterProps test util now handles bool and null properly
@LeaVerou - I spent awhile playing with the rollup config, given that this is the first plugin. I could use your thoughts on how plugins should be bundled... if the plugin is added by the end-user with a simple {
name: 'ignore-import',
resolveId: source => source.includes(name) ? null : false,
}, If each plugin is a function that takes jsep as an argument, then it would not have any imports and could be bundled as separate file easily. Using a plugin would then be like:
I looked at our discussion in #123 ... but thought you might have some further thoughts on how to proceed? |
…ependency injection - Added plugin registration to JSEP. Plugins have a `name` and an `init` function that is called on registration with JSEP. - Updated Object + Ternary plugins. Ternary plugin is registered by default - Updated rollup to build each plugin as a separate output (all formats). Also delete dist folder before building. - don't pollute the JSEP namespace from plugins. Use local constants instead.
Co-authored-by: Lea Verou <lea@verou.me>
(single object arg, single array of objects arg, multiple objects arg)
…to readme - gobbleExpression and gobbleToken need to stop running hooks once a node is found, similar to how jsep checks when calling each successive gobble method now. This saves each hook from having to check for `env.node` (and potentially leading to future errors with 2 hooks parsing 2 sequential expressions as just the last node). Added unit tests.
…between plugins and tests
Update plugin system to use registration
Adds Object Expression support as a plugin, from issue #39
(builds on #143)
NOTE: doesn't build into the dist folder yet...