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

Code: Added new types package for TS #12301

Merged
merged 30 commits into from
Sep 19, 2022
Merged

Code: Added new types package for TS #12301

merged 30 commits into from
Sep 19, 2022

Conversation

barklund
Copy link
Contributor

Context

This adds a new TS type-only package.

Testing Instructions

  • This is a non-user-facing change and requires no QA

Checklist

  • This PR addresses an existing issue and I have linked this PR to it in ZenHub
  • I have tested this code to the best of my abilities
  • I have verified accessibility to the best of my abilities (docs)
  • I have verified i18n and l10n (translation, right-to-left layout) to the best of my abilities
  • This code is covered by automated tests (unit, integration, and/or e2e) to verify it works as intended (docs)
  • I have added documentation where necessary
  • I have added a matching Type: XYZ label to the PR

Fixes #12090

@barklund barklund added Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ Pod: Prometheus labels Sep 13, 2022
@barklund barklund self-assigned this Sep 13, 2022
@swissspidy
Copy link
Collaborator

What‘s the advantage of also moving things like the pattern types to this new package?

@barklund
Copy link
Contributor Author

What‘s the advantage of also moving things like the pattern types to this new package?

Mostly to avoid circular references. The types package should be at the bottom of the dependency tree IMO and thus not depend on anything else, but it needs the patterns for various color properties, so this made sense to me. This can of course be reversed.

@swissspidy
Copy link
Collaborator

I see. There’s definitely a lot to untangle with all the element types and such. Patterns don‘t have any other dependencies, so there should be no circular references in that instance. But let‘s look at it once this progresses further 👍

@barklund barklund marked this pull request as ready for review September 13, 2022 22:18
@googleforcreators-bot
Copy link
Collaborator

googleforcreators-bot commented Sep 13, 2022

Plugin builds for f73c8dc are ready 🛎️!

@github-actions
Copy link
Contributor

github-actions bot commented Sep 13, 2022

Size Change: +23 B (0%)

Total Size: 2.72 MB

Filename Size Change
assets/js/4484.js 0 B -84.7 kB (removed) 🏆
assets/js/1944.js 84.6 kB +84.6 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
assets/css/carousel-view-rtl.css 702 B 0 B
assets/css/carousel-view.css 701 B 0 B
assets/css/web-stories-block-rtl.css 4.52 kB 0 B
assets/css/web-stories-block.css 4.56 kB 0 B
assets/css/web-stories-embed-rtl.css 318 B 0 B
assets/css/web-stories-embed.css 317 B 0 B
assets/css/web-stories-list-styles-rtl.css 2.36 kB 0 B
assets/css/web-stories-list-styles.css 2.39 kB 0 B
assets/css/web-stories-theme-style-twentyeleven-rtl.css 102 B 0 B
assets/css/web-stories-theme-style-twentyeleven.css 102 B 0 B
assets/css/web-stories-theme-style-twentyfifteen-rtl.css 251 B 0 B
assets/css/web-stories-theme-style-twentyfifteen.css 251 B 0 B
assets/css/web-stories-theme-style-twentyfourteen-rtl.css 287 B 0 B
assets/css/web-stories-theme-style-twentyfourteen.css 287 B 0 B
assets/css/web-stories-theme-style-twentyseventeen-rtl.css 288 B 0 B
assets/css/web-stories-theme-style-twentyseventeen.css 288 B 0 B
assets/css/web-stories-theme-style-twentysixteen-rtl.css 224 B 0 B
assets/css/web-stories-theme-style-twentysixteen.css 224 B 0 B
assets/css/web-stories-theme-style-twentyten-rtl.css 143 B 0 B
assets/css/web-stories-theme-style-twentyten.css 143 B 0 B
assets/css/web-stories-theme-style-twentytwelve-rtl.css 256 B 0 B
assets/css/web-stories-theme-style-twentytwelve.css 256 B 0 B
assets/css/web-stories-theme-style-twentytwenty-rtl.css 86 B 0 B
assets/css/web-stories-theme-style-twentytwenty.css 86 B 0 B
assets/css/web-stories-theme-style-twentytwentyone-rtl.css 326 B 0 B
assets/css/web-stories-theme-style-twentytwentyone.css 326 B 0 B
assets/css/web-stories-widget-rtl.css 482 B 0 B
assets/css/web-stories-widget.css 482 B 0 B
assets/css/wp-dashboard-rtl.css 657 B 0 B
assets/css/wp-dashboard.css 659 B 0 B
assets/css/wp-story-editor-rtl.css 737 B 0 B
assets/css/wp-story-editor.css 738 B 0 B
assets/js/1512.js 6.15 kB 0 B
assets/js/1814.js 7.45 kB 0 B
assets/js/2388.js 85.3 kB 0 B
assets/js/4319.js 34.9 kB 0 B
assets/js/4422.js 49.3 kB 0 B
assets/js/5051.js 92.1 kB 0 B
assets/js/6753.js 113 kB 0 B
assets/js/9796.js 3.71 kB 0 B
assets/js/carousel-view.js 3.41 kB 0 B
assets/js/chunk-colorthief.js 2.64 kB 0 B
assets/js/chunk-ffmpeg.js 5.89 kB 0 B
assets/js/chunk-focus-visible.js 1.01 kB 0 B
assets/js/chunk-getStoryMarkup.js 12.4 kB 0 B
assets/js/chunk-html-to-image.js 4.5 kB 0 B
assets/js/chunk-opentype.js 96 B 0 B
assets/js/chunk-react-calendar.js 12.5 kB 0 B
assets/js/chunk-react-color.js 44.3 kB 0 B
assets/js/chunk-web-animations-js.js 14.6 kB 0 B
assets/js/chunk-web-stories-template-0-metaData.js 545 B 0 B
assets/js/chunk-web-stories-template-0.js 11.4 kB 0 B
assets/js/chunk-web-stories-template-1-metaData.js 539 B 0 B
assets/js/chunk-web-stories-template-1.js 9.61 kB 0 B
assets/js/chunk-web-stories-template-10-metaData.js 533 B 0 B
assets/js/chunk-web-stories-template-10.js 7.37 kB 0 B
assets/js/chunk-web-stories-template-11-metaData.js 539 B 0 B
assets/js/chunk-web-stories-template-11.js 9.09 kB 0 B
assets/js/chunk-web-stories-template-12-metaData.js 497 B 0 B
assets/js/chunk-web-stories-template-12.js 9.7 kB 0 B
assets/js/chunk-web-stories-template-13-metaData.js 525 B 0 B
assets/js/chunk-web-stories-template-13.js 7.4 kB 0 B
assets/js/chunk-web-stories-template-14-metaData.js 582 B 0 B
assets/js/chunk-web-stories-template-14.js 7.37 kB 0 B
assets/js/chunk-web-stories-template-15-metaData.js 544 B 0 B
assets/js/chunk-web-stories-template-15.js 9 kB 0 B
assets/js/chunk-web-stories-template-16-metaData.js 588 B 0 B
assets/js/chunk-web-stories-template-16.js 10.9 kB 0 B
assets/js/chunk-web-stories-template-17-metaData.js 539 B 0 B
assets/js/chunk-web-stories-template-17.js 9.2 kB 0 B
assets/js/chunk-web-stories-template-18-metaData.js 585 B 0 B
assets/js/chunk-web-stories-template-18.js 9.91 kB 0 B
assets/js/chunk-web-stories-template-19-metaData.js 501 B 0 B
assets/js/chunk-web-stories-template-19.js 10.8 kB 0 B
assets/js/chunk-web-stories-template-2-metaData.js 586 B 0 B
assets/js/chunk-web-stories-template-2.js 9.3 kB 0 B
assets/js/chunk-web-stories-template-20-metaData.js 548 B 0 B
assets/js/chunk-web-stories-template-20.js 9.01 kB 0 B
assets/js/chunk-web-stories-template-21-metaData.js 535 B 0 B
assets/js/chunk-web-stories-template-21.js 9.85 kB 0 B
assets/js/chunk-web-stories-template-22-metaData.js 525 B 0 B
assets/js/chunk-web-stories-template-22.js 7.83 kB 0 B
assets/js/chunk-web-stories-template-23-metaData.js 605 B 0 B
assets/js/chunk-web-stories-template-23.js 7.48 kB 0 B
assets/js/chunk-web-stories-template-24-metaData.js 516 B 0 B
assets/js/chunk-web-stories-template-24.js 11.7 kB 0 B
assets/js/chunk-web-stories-template-25-metaData.js 544 B 0 B
assets/js/chunk-web-stories-template-25.js 7.06 kB 0 B
assets/js/chunk-web-stories-template-26-metaData.js 601 B 0 B
assets/js/chunk-web-stories-template-26.js 7.27 kB 0 B
assets/js/chunk-web-stories-template-27-metaData.js 542 B 0 B
assets/js/chunk-web-stories-template-27.js 7.82 kB 0 B
assets/js/chunk-web-stories-template-28-metaData.js 532 B 0 B
assets/js/chunk-web-stories-template-28.js 9.07 kB 0 B
assets/js/chunk-web-stories-template-29-metaData.js 562 B 0 B
assets/js/chunk-web-stories-template-29.js 9.25 kB 0 B
assets/js/chunk-web-stories-template-3-metaData.js 539 B 0 B
assets/js/chunk-web-stories-template-3.js 8.42 kB 0 B
assets/js/chunk-web-stories-template-30-metaData.js 576 B 0 B
assets/js/chunk-web-stories-template-30.js 7.89 kB 0 B
assets/js/chunk-web-stories-template-31-metaData.js 502 B 0 B
assets/js/chunk-web-stories-template-31.js 10.3 kB 0 B
assets/js/chunk-web-stories-template-32-metaData.js 552 B 0 B
assets/js/chunk-web-stories-template-32.js 13.3 kB 0 B
assets/js/chunk-web-stories-template-33-metaData.js 492 B 0 B
assets/js/chunk-web-stories-template-33.js 9.07 kB 0 B
assets/js/chunk-web-stories-template-34-metaData.js 571 B 0 B
assets/js/chunk-web-stories-template-34.js 7.58 kB 0 B
assets/js/chunk-web-stories-template-35-metaData.js 566 B 0 B
assets/js/chunk-web-stories-template-35.js 8.91 kB 0 B
assets/js/chunk-web-stories-template-36-metaData.js 577 B 0 B
assets/js/chunk-web-stories-template-36.js 12.7 kB 0 B
assets/js/chunk-web-stories-template-37-metaData.js 528 B 0 B
assets/js/chunk-web-stories-template-37.js 6.71 kB 0 B
assets/js/chunk-web-stories-template-38-metaData.js 572 B 0 B
assets/js/chunk-web-stories-template-38.js 7.94 kB 0 B
assets/js/chunk-web-stories-template-39-metaData.js 589 B 0 B
assets/js/chunk-web-stories-template-39.js 8.08 kB 0 B
assets/js/chunk-web-stories-template-4-metaData.js 564 B 0 B
assets/js/chunk-web-stories-template-4.js 12.7 kB 0 B
assets/js/chunk-web-stories-template-40-metaData.js 557 B 0 B
assets/js/chunk-web-stories-template-40.js 10.2 kB 0 B
assets/js/chunk-web-stories-template-41-metaData.js 572 B 0 B
assets/js/chunk-web-stories-template-41.js 7.75 kB 0 B
assets/js/chunk-web-stories-template-42-metaData.js 521 B 0 B
assets/js/chunk-web-stories-template-42.js 7 kB 0 B
assets/js/chunk-web-stories-template-43-metaData.js 557 B 0 B
assets/js/chunk-web-stories-template-43.js 8.76 kB 0 B
assets/js/chunk-web-stories-template-44-metaData.js 584 B 0 B
assets/js/chunk-web-stories-template-44.js 11.1 kB 0 B
assets/js/chunk-web-stories-template-45-metaData.js 565 B 0 B
assets/js/chunk-web-stories-template-45.js 7.52 kB 0 B
assets/js/chunk-web-stories-template-46-metaData.js 531 B 0 B
assets/js/chunk-web-stories-template-46.js 5.22 kB 0 B
assets/js/chunk-web-stories-template-47-metaData.js 592 B 0 B
assets/js/chunk-web-stories-template-47.js 9.42 kB 0 B
assets/js/chunk-web-stories-template-48-metaData.js 555 B 0 B
assets/js/chunk-web-stories-template-48.js 9.09 kB 0 B
assets/js/chunk-web-stories-template-49-metaData.js 518 B 0 B
assets/js/chunk-web-stories-template-49.js 9.69 kB 0 B
assets/js/chunk-web-stories-template-5-metaData.js 556 B 0 B
assets/js/chunk-web-stories-template-5.js 9.94 kB 0 B
assets/js/chunk-web-stories-template-50-metaData.js 503 B 0 B
assets/js/chunk-web-stories-template-50.js 9.15 kB 0 B
assets/js/chunk-web-stories-template-51-metaData.js 526 B 0 B
assets/js/chunk-web-stories-template-51.js 10.4 kB 0 B
assets/js/chunk-web-stories-template-52-metaData.js 602 B 0 B
assets/js/chunk-web-stories-template-52.js 10.4 kB 0 B
assets/js/chunk-web-stories-template-53-metaData.js 553 B 0 B
assets/js/chunk-web-stories-template-53.js 5.78 kB 0 B
assets/js/chunk-web-stories-template-54-metaData.js 547 B 0 B
assets/js/chunk-web-stories-template-54.js 7.67 kB 0 B
assets/js/chunk-web-stories-template-55-metaData.js 573 B 0 B
assets/js/chunk-web-stories-template-55.js 7.13 kB 0 B
assets/js/chunk-web-stories-template-56-metaData.js 542 B 0 B
assets/js/chunk-web-stories-template-56.js 9.87 kB 0 B
assets/js/chunk-web-stories-template-57-metaData.js 527 B 0 B
assets/js/chunk-web-stories-template-57.js 14.9 kB 0 B
assets/js/chunk-web-stories-template-58-metaData.js 555 B 0 B
assets/js/chunk-web-stories-template-58.js 5.74 kB 0 B
assets/js/chunk-web-stories-template-59-metaData.js 590 B 0 B
assets/js/chunk-web-stories-template-59.js 8.96 kB 0 B
assets/js/chunk-web-stories-template-6-metaData.js 569 B 0 B
assets/js/chunk-web-stories-template-6.js 7.07 kB 0 B
assets/js/chunk-web-stories-template-60-metaData.js 510 B 0 B
assets/js/chunk-web-stories-template-60.js 9.51 kB 0 B
assets/js/chunk-web-stories-template-7-metaData.js 569 B 0 B
assets/js/chunk-web-stories-template-7.js 7.46 kB 0 B
assets/js/chunk-web-stories-template-8-metaData.js 569 B 0 B
assets/js/chunk-web-stories-template-8.js 8.93 kB 0 B
assets/js/chunk-web-stories-template-9-metaData.js 581 B 0 B
assets/js/chunk-web-stories-template-9.js 8.46 kB 0 B
assets/js/chunk-web-stories-templates.js 845 B 0 B
assets/js/chunk-web-stories-textset-0.js 5.06 kB 0 B
assets/js/chunk-web-stories-textset-1.js 6.65 kB 0 B
assets/js/chunk-web-stories-textset-2.js 7.65 kB 0 B
assets/js/chunk-web-stories-textset-3.js 15.1 kB 0 B
assets/js/chunk-web-stories-textset-4.js 4.15 kB 0 B
assets/js/chunk-web-stories-textset-5.js 5.47 kB 0 B
assets/js/chunk-web-stories-textset-6.js 5.28 kB 0 B
assets/js/chunk-web-stories-textset-7.js 10.2 kB 0 B
assets/js/generateBlurhash.worker.worker.js 1.1 kB 0 B
assets/js/imgareaselect.js 3.77 kB 0 B
assets/js/lightbox.js 550 B 0 B
assets/js/tinymce-button.js 2.85 kB 0 B
assets/js/web-stories-activation-notice.js 25.4 kB 0 B
assets/js/web-stories-block.js 18 kB 0 B
assets/js/web-stories-embed.js 20 B 0 B
assets/js/web-stories-widget.js 587 B 0 B
assets/js/wp-dashboard.js 64.1 kB 0 B
assets/js/wp-story-editor.js 1.36 MB +57 B (0%)

compressed-size-action

@barklund barklund changed the title [WIP] Added new types package for TS Code: Added new types package for TS Sep 13, 2022
packages/types/src/element/elementBox.ts Show resolved Hide resolved
packages/types/package.json Outdated Show resolved Hide resolved
packages/types/README.md Show resolved Hide resolved
packages/patterns/src/hasGradient.ts Show resolved Hide resolved
packages/patterns/src/convertToCSS.ts Show resolved Hide resolved
packages/media/src/createResource.ts Outdated Show resolved Hide resolved
@swissspidy
Copy link
Collaborator

I see. There’s definitely a lot to untangle with all the element types and such. Patterns don‘t have any other dependencies, so there should be no circular references in that instance. But let‘s look at it once this progresses further 👍

To iterate on my previous comment, the main things standing out:

  1. Pattern types -> more suitable for patterns package
  2. Specific element types (ProductElement, GifElement, etc.) -> more suitable for element-library
  3. Resource types -> media package

There shouldn't be any circular dependencies that way.

I can see the appeal of a catch-all types package at the bottom of the dependency tree though. So not sure what works best...

locked: boolean;
}

export interface Element extends ElementBox {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it would be good to add a union type of all the elements as well for using in other packages? We're very often using element as a prop without knowing which element type it is exactly. Maybe element could be a union type and baseElement (or sth similar) what it currently is?

Copy link
Contributor Author

@barklund barklund Sep 16, 2022

Choose a reason for hiding this comment

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

I see why you want that, but it's kind of not the right approach here. Rather, if you're looking through the array of elements for say TextElement's, to manipulate all text elements, you would do so with a user-defined type predicate (we could easily create those along with each element type, but they're also trivial to define when needed):

function isTextElement(e: Element): e is TextElement {
  return e.type === 'text';
}
const textElements = page.elements.filter(isTextElement);

The latter variable here now has TextElement[] type. It can also be defined inline:

page.elements.filter((e: Element): e is TextElement => e.type === 'text');

That x is Foo syntax looks weird, but it works, so 🤷.

Copy link
Contributor

@miina miina Sep 16, 2022

Choose a reason for hiding this comment

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

What if it's a function that actually accepts all types, for example:

function getLayerName(element) {
  if (element.layerName) {
    return element.layerName;
  }

  if (element.isBackground) {
    return __('Background', 'web-stories');
  }

  return getDefinitionForType(element.type).getLayerText(element);
}

If we would assign just element: Element, it would complain about isBackground not existing (it exists on shapes and media only but not on Element).

Thoughts?

@barklund
Copy link
Contributor Author

barklund commented Sep 15, 2022

I see. There’s definitely a lot to untangle with all the element types and such. Patterns don‘t have any other dependencies, so there should be no circular references in that instance. But let‘s look at it once this progresses further 👍

To iterate on my previous comment, the main things standing out:

  1. Pattern types -> more suitable for patterns package
  2. Specific element types (ProductElement, GifElement, etc.) -> more suitable for element-library
  3. Resource types -> media package

There shouldn't be any circular dependencies that way.

I can see the appeal of a catch-all types package at the bottom of the dependency tree though. So not sure what works best...

I think it's a lot of work to do "types belong in the relevant package" organisation, but doable if we're diligent.

Some of the utility functions inside the media package need access to element types (e.g. generateVideoStrip(e:MediaElement, ...)), but because the element library package would depend on the media package (the VideoElement needs to reference the VideoResource, etc), the media package cannot depend in reverse. So the media element would have to be defined in the media package.

That means that the abstract catch-all element type would exist in the types package, the abstract media element type would exist in the media package, and the concrete element types (some extending element, others extending media element) would exist in the element library package.

Sure, it would work, but it would also be a bit confusing in my opinion. Another option would be to move the generateVideoStrip function somewhere else, so the media element type can be defined in the element library package. But to where?

I also notice that the element library package depends on a ton of other packages, so none of those can ever depend on any specific element type, which would seem to hamper us a bit. E.g. the animation package, which have methods referring to media elements (e.g. in mediaPositions.js). Similarly inside the rich-text package, where usePastedTextContent needs to know about the text element interface.

I think the problem with this "types belong in their packages" approach is that we often combine both core functionality and broader utility functions inside a package - those broader utility functions often need types from other packages, but that creates a mess in dependencies.

While having all the types in a single package perhaps isn't best-practice, it would make things a lot simpler.

Would it make a difference if we turned these general types in the type package into more generic interfaces, of which actual elements would implement one or more? So we have EditableElement, MediaElement, TrimmableElement, BackgroundableElement, ColorableElement, etc? Then functions through would accept one of those interfaces, and the actual elements could be passed because they implemented said interface?

Such a solution feels more "computer sciencey", but also more complex, as our actual elements are super concrete and such abstractions would be an almost useless exercise except to make the type system consistent.

WDYT?

Ping @miina and @merapi too.

Morten Barklund added 2 commits September 15, 2022 20:45
# Conflicts:
#	packages/patterns/src/generatePatternStyles.ts
@swissspidy
Copy link
Collaborator

Those are good points, thanks for bringing them up.

This shows that we still have a ways to go to improve our dependencies and avoid circular references.

Some of the utility functions inside the media package need access to element types
Another option would be to move the generateVideoStrip function somewhere else, so the media element type can be defined in the element library package. But to where?

The media package should not need access to element types.

generateVideoStrip is only used by the editor in useRailBackground(), so we should just move this to packages/story-editor/src/components/videoTrim/generateVideoStrip.js

Are there others utils in media besides this one that should be moved? Seems like the only one.

I also notice that the element library package depends on a ton of other packages, so none of those can ever depend on any specific element type, which would seem to hamper us a bit. E.g. the animation package.

I think we should just get rid of the animation dependency in element-library. It's only there because of BG_MIN_SCALE and BG_MAX_SCALE. We can either just copy these constants, or pass them from the story-editor package as props to MediaEdit.

E.g. the animation package, which have methods referring to media elements (e.g. in mediaPositions.js).

Since animations the package already implicitly references elements, we could perhaps add an explicit dependency on the elements package instead.

Maybe getMediaBoundOffsets is a better fit to be called via getDefinitionForType() so it's more element type agnostic.

Similarly inside the rich-text package, where usePastedTextContent needs to know about the text element interface.

Another implicit dependency that we should strive to avoid. In fact, it's the only such dependency on the text element type in the rich-text package.

This could be solved by moving the file to story-editor or by passing a different insertElement so it does not have to know about the interface. e.g. in useCanvasCopyPaste we'd do:

const pasteTextContent = usePasteTextContent((content) => {
  insertElement('text', { ...DEFAULT_PRESET, content });
});

I think the problem with this "types belong in their packages" approach is that we often combine both core functionality and broader utility functions inside a package - those broader utility functions often need types from other packages, but that creates a mess in dependencies.

That sounds like a sign to split up packages.

While having all the types in a single package perhaps isn't best-practice, it would make things a lot simpler.

That is definitely true. And I think it would be OK to do that for now, but we should strive to fix the circular dependency issues so that we no longer have to do this.

@miina
Copy link
Contributor

miina commented Sep 16, 2022

When the packages were being created, I remember it was often not clear what belonged to where, adding types seems to be a great opportunity to improve all that as well.

Agreed that it would be ideal to have the types with the correspondent packages, it would widen the scope of this issue quite a lot though.

Sounds like the simplest way would be using the shared types package as Morten currently has in this PR and then creating follow-up issues for moving the types where they belong together with improving the dependencies and the organization of the packages.

@barklund
Copy link
Contributor Author

barklund commented Sep 16, 2022

Alright, let's get this merged to unblock a number of other issues (which would require a ✅ after I've fixed all pending issues), and then I'll create some followups to organize some of the other packages better.

@barklund barklund requested a review from miina September 16, 2022 09:36
@barklund
Copy link
Contributor Author

barklund commented Sep 16, 2022

I feel it makes sense to "postpone" the moving of types to their relevant packages to when we convert the element library package. Yes, there'll be a lot of references to update, but I think it makes sense to do only then.

In the meantime, we could make another ticket to reduce some of the references between packages? Specifically:

  • remove the link from animation package to media (by going through getDefinitionForType instead, which would instead add a link to the elements package)
  • remove the link from media to element (by moving generateVideoStrip to the story-editor package)
  • remove the link from element-library to animation package (by passing the relevant properties in the story editor)
  • remove the link from rich-text package to element library package (by passing a "simpler" callback to usePasteTextContent)

Edit: #12126 has been updated and #12332 has been added.

Copy link
Contributor

@miina miina left a comment

Choose a reason for hiding this comment

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

LGTM as the initial version 🔨

(pending the missing metrics)

@barklund barklund merged commit 5e992a7 into main Sep 19, 2022
@barklund barklund deleted the code/12090-ts-package branch September 19, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript: Create new story package with typings
4 participants