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

Added support for name-collision resolution #270

Merged
merged 1 commit into from
Nov 26, 2023
Merged

Added support for name-collision resolution #270

merged 1 commit into from
Nov 26, 2023

Conversation

timocov
Copy link
Owner

@timocov timocov commented Nov 19, 2023

Expected changes in the codegen

As an expected change of this PR to the codegen is that now instead of

export default function name(): void;

you will get something like:

declare function name(): void;
export { name as default };

which structurally is the same, but you might notice such changes.

Related issues

Fixes #116
Fixes #130
Fixes #184

Packages to validate

Next steps

Additional information

grapesjs API diff

So it looks like previously the API wasn't correct as some classes extended wrong classes at the declaration level.

$ git diff
diff --git a/dist/index.d.ts b/dist/index.d.ts
index 55c04bab..bd54137b 100644
--- a/dist/index.d.ts
+++ b/dist/index.d.ts
@@ -4374,7 +4374,7 @@ declare class ComponentMapView extends ComponentImageView {
        getIframe(): HTMLIFrameElement;
        render(): this;
 }
-declare class ComponentScriptView extends ComponentView {
+declare class ComponentScriptView extends ComponentImageView {
        tagName(): string;
        events(): {};
        render(): this;
@@ -10012,7 +10012,7 @@ export interface LayerData {
 declare class LayerManager extends Module<LayerManagerConfig> {
        model: ModuleModel;
        __ctn?: HTMLElement;
-       view?: View;
+       view?: ItemView;
        events: {
                all: string;
                root: string;
@@ -10111,7 +10111,7 @@ declare class LayerManager extends Module<LayerManagerConfig> {
         * @private
         */
        componentChanged(sel?: Component, opts?: {}): void;
-       getAll(): View | undefined;
+       getAll(): ItemView | undefined;
        render(): HTMLElement;
        destroy(): void;
        __onRootChange(): void;
@@ -11678,7 +11678,7 @@ declare class CommandsModule extends Module<CommandsConfig & {
        /**
         * @private
         */
-       constructor(em: Editor);
+       constructor(em: EditorModel);
        /**
         * Add new command to the collection
         * @param       {string} id Command's ID

@timocov timocov marked this pull request as ready for review November 26, 2023 18:11
@timocov
Copy link
Owner Author

timocov commented Nov 26, 2023

Lint failure is fine, it was failing before as well.

@timocov timocov merged commit e5abeb0 into master Nov 26, 2023
3 of 4 checks passed
@timocov timocov deleted the renamings branch November 26, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant