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

feat(vectorizer): Headless ready and move into worker for demo purposes #6

Open
wants to merge 32 commits into
base: feature/vectorize-plugin-ms
Choose a base branch
from

Conversation

DanielHauschildt
Copy link

Tried the current structure.

I like the general concept, therefore I started evaluating some edge-cases and refactored the code to see fit to this edge cases and discover potential blockers

  1. Uploader function is not accessible from just the engine
  2. Triggering the plugin "actions" commands via setting the Pending state has been removed in favor of "action/commands"
  3. Tried using webworkers to dispatch workload
  4. Refactor everything to engine only as much as possible
  5. Changed the file structure a tiny bit such that files represent the "concern"

Copy link
Contributor

@mirko314 mirko314 left a comment

Choose a reason for hiding this comment

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

Added my 2 cents, but I'm not deep enough into understanding the architecture yet, so can't say much to that.
I would LOVE if we could abstract away most of this plugin code into one function that takes in an image fill source set, does some work with it and returns a new set of image.
That would enable quick iteration for e.g an upscalerJS plugin

external: ['@cesdk/cesdk-js', 'lodash', "node:path", "fs", "url"],
platform: 'browser',
external: ['@cesdk/cesdk-js'],
platform: 'node',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is node correct here? In the end the plugin will be shipped in the browser. Do we need two different configs and build for either nodejs or browser maybe?

Copy link
Author

Choose a reason for hiding this comment

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

I learned from the docs that "nodejs" is not the platform to build for, it has mechanism in place such das externalizing node modules and so forth. The platform itself has not influence on the end target.

Comment on lines +2 to +4
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this comment? It looks wrong inside a json

Suggested change
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

Comment on lines 0 to 10
export const PLUGIN_ID = '@imgly/plugin-vectorizer-web';
export const CANVAS_MENU_COMPONENT_ID = `${PLUGIN_ID}.canvasMenu`;
export const CANVAS_MENU_COMPONENT_BUTTON_ID = `${CANVAS_MENU_COMPONENT_ID}.button`;
export const FEATURE_ID = `${PLUGIN_ID}.feature`;
export const I18N_ID = "plugin.vectorizer.vectorize"
export const I18N_TRANSLATIONS = {
en: { [I18N_ID]: 'Vectorize' },
de: { [I18N_ID]: 'Vektorisieren' }
export const PLUGIN_CANVAS_MENU_COMPONENT_ID = `${PLUGIN_ID}.canvasMenu`;
export const PLUGIN_CANVAS_MENU_COMPONENT_BUTTON_ID = `${PLUGIN_CANVAS_MENU_COMPONENT_ID}.button`;
export const PLUGIN_FEATURE_ID = `${PLUGIN_ID}`;
export const PLUGIN_ACTION_VECTORIZE_LABEL = `plugin.${PLUGIN_ID}.vectorize`
export const PLUGIN_I18N_TRANSLATIONS = {
en: { [PLUGIN_ACTION_VECTORIZE_LABEL]: 'Vectorize' },
de: { [PLUGIN_ACTION_VECTORIZE_LABEL]: 'Vektorisieren' }
}
export const ICON = '@imgly/icons/Vectorize' No newline at end of file
export const PLUGIN_ICON = '@imgly/icons/Vectorize'
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can soon move all this data into something like a plugin manifest json

Copy link
Author

Choose a reason for hiding this comment

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

I think so too

packages/vectorizer/src/worker.ts Outdated Show resolved Hide resolved
Copy link

vercel bot commented Feb 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plugins-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 5:53pm

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.

2 participants