Skip to content

Feat/upstream changes#14

Merged
willymwai merged 374 commits intomasterfrom
feat/upstream-changes
May 19, 2025
Merged

Feat/upstream changes#14
willymwai merged 374 commits intomasterfrom
feat/upstream-changes

Conversation

@willymwai
Copy link
Member

@willymwai willymwai commented May 19, 2025

PR Type

Enhancement, Tests, Bug fix


Description

  • Major enhancements to CMS, comments, reactions, and notification logic, including improved notification grouping, reaction handling, and CMS row management.

  • Added and refactored utilities and logic for processing and sending comment notifications, with improved grouping by user/project/thread and support for reactions and thread histories.

  • Introduced a new HTML parser utility for the web importer, supporting style extraction, specificity, and CSS edge cases.

  • Improved code component prop registration with enhanced type checking, validation, and support for new prop types.

  • Added support for TanStack Router and server query features in React code generation and loader bundling.

  • Removed deprecated Rollup bundling logic, enforcing esbuild for loader, and added "tanstack" platform support.

  • Extended Cypress support utilities and added comprehensive E2E test suites for features such as Auto Open, Plexus component installation, and project panel manipulation.

  • Refactored and expanded tests for comment notification emails and notification logic, improving coverage and reliability.

  • Added Playwright tests for react-aria code components in Next.js loader projects, covering accessibility and variant support.

  • Refactored literal expression helpers for improved type safety and clarity.

  • Fixed import path for Analytics types in AmplitudeAnalytics.

  • Various code cleanups, import updates, and removal of unused/deprecated files and logic.


Changes walkthrough 📝

Relevant files
Tests
8 files
send-comments-notifications.spec.ts
Major refactor and expansion of comment notification tests with new
helpers and scenarios

platform/wab/src/wab/server/scripts/send-comments-notifications.spec.ts

  • Refactored test utility functions: replaced postComment with
    addComment, added updatedThreadStatus, reactOnComment, and
    removeReactionOnComment.
  • Updated test cases to use new helper functions and improved
    notification structure assertions.
  • Replaced manual notification structure expectations with dynamic
    createNotification calls and Maps.
  • Added comprehensive new test cases for notifications, including thread
    resolution, reactions, mentions, and notification preferences.
  • Improved test coverage for edge cases and notification logic.
  • +1842/-393
    nextjs-plasmic-react-aria.spec.ts
    Add Playwright tests for react-aria code components in Next.js loader

    platform/loader-tests/src/playwright-tests/nextjs/nextjs-plasmic-react-aria.spec.ts

  • Added a comprehensive Playwright test suite for
    @plasmicpkgs/react-aria code components in Next.js loader projects.
  • Implemented tests for various components (Button, Checkbox, Radio,
    Switch, Text Field, Select, Combobox, Dialogs, Tooltip, Slider, Range
    Slider) across multiple Next.js and loader versions.
  • Introduced utility classes (StateChecker, LeafElementStateChecker) for
    asserting UI state and style.
  • Included detailed state and interaction checks for accessibility and
    variant support.
  • [link]   
    auto-open.spec.ts
    Add comprehensive Cypress tests for Auto Open feature       

    platform/wab/cypress/e2e/auto-open.spec.ts

  • Added a comprehensive new Cypress test suite for the "Auto Open"
    feature.
  • Tests cover code components, Plasmic components, nested auto-open
    scenarios, and various visibility states.
  • Includes utility functions for asserting auto-open behavior and
    handling edge cases.
  • Covers undo functionality, multi-selection (skipped), and live mode
    checks.
  • +799/-0 
    tutorial.spec.ts
    Refactor and improve reliability of tutorial Cypress test

    platform/wab/cypress/e2e/tutorial.spec.ts

  • Refactored tutorial test to use beforeEach/afterEach for
    setup/teardown and dev flag management.
  • Improved test reliability by ensuring dev flags and projects are reset
    after each test.
  • Streamlined the test flow for completing the tutorial, reducing
    nesting and improving readability.
  • Minor import and structure improvements.
  • +338/-348
    host-app.spec.ts
    Use configureProjectAppHost in host-app Cypress tests       

    platform/wab/cypress/e2e/host-app.spec.ts

  • Replaced calls to configureProject with configureProjectAppHost for
    clarity and consistency.
  • Updated all relevant test cases to use the new utility function.
  • +7/-30   
    plexus-installation.spec.ts
    Add Cypress E2E tests for Plexus component installation and behaviors

    platform/wab/cypress/e2e/plexus-installation.spec.ts

  • Added a comprehensive Cypress E2E test suite for Plexus component
    installation.
  • Tests standalone and installable Plexus components, including
    drag-and-drop, copy, undo, and dependency checks.
  • Covers installation dialogs, default components, project dependency
    assertions, and undo/redo flows.
  • Includes utility functions and assertions for project panel state and
    component verification.
  • +609/-0 
    comment-notification-email.spec.ts
    Rewrite and expand tests for comment notification email grouping logic

    platform/wab/src/wab/server/emails/comment-notification-email.spec.ts

  • Rewrote and expanded tests for sendUserNotificationEmail to cover new
    notification grouping logic.
  • Added tests for notifications across projects, branches, and multiple
    notification types (comments, reactions, thread histories).
  • Utilized new test utilities and improved assertions for email content
    and recipients.
  • Removed old test logic and replaced with more comprehensive,
    scenario-based tests.
  • +568/-105
    prefill-cloudfront.spec.ts
    Update test for prefill cloudfront to match new function signature

    platform/wab/src/wab/server/workers/prefill-cloudfront.spec.ts

  • Updated test expectation for getRecentLoaderPublishmentsMock to remove
    the minLoaderVersion argument.
  • Ensured test reflects updated function signature.
  • +1/-6     
    Enhancement
    8 files
    exprs.ts
    Refactor and enhance literal extraction and code helpers for
    expressions

    platform/wab/src/wab/shared/core/exprs.ts

  • Refactored literal expression helpers: simplified codeLit and removed
    unused variants.
  • Improved type safety and clarity for literal extraction helpers
    (tryExtractJson, tryExtractString, tryExtractBoolean).
  • Updated tryExtractJson to use a safer JSON parser and return correct
    types.
  • Added tryExtractBoolean for extracting boolean literals from
    expressions.
  • Removed unused or redundant code and improved documentation.
  • +24/-29 
    DbMgr.ts
    Major enhancements to CMS, comments, reactions, and notification logic

    platform/wab/src/wab/server/db/DbMgr.ts

  • Refactored and enhanced comment, thread, and reaction handling,
    including notification and update logic.
  • Improved unique field checking and error handling for CMS rows,
    including new utility methods and error throws.
  • Updated permissions checks for various project and workspace actions
    (e.g., using "commenter" instead of "viewer").
  • Added support for passing custom IDs to entity creation methods and
    improved stamping logic.
  • Added new methods for retrieving published CMS rows and handling large
    result sets with Sentry logging.
  • Enhanced merge commit logic to accept descriptions and tags.
  • Updated project creation and update logic, removing unused fields and
    improving workspace/team lookup.
  • Improved handling of deleted comments and threads, including updating
    thread deletion when all comments are deleted.
  • Refined notification and reaction update logic to ensure accurate
    lastEmailedAt tracking.
  • Improved code formatting, removed unused code, and updated imports.
  • +355/-110
    html-parser.ts
    Add HTML parser utility for web importer with style extraction

    platform/wab/src/wab/client/web-importer/html-parser.ts

  • Added a new HTML parser utility for the web importer, converting
    HTML/CSS into a structured tree.
  • Handles style extraction, specificity, variable resolution, and
    sanitization.
  • Supports media queries, font-face rules, and various CSS edge cases.
  • Provides utilities for traversing nodes, extracting styles, and
    building a WIElement tree.
  • +852/-0 
    module-bundler.ts
    Remove Rollup, enforce esbuild for loader, add tanstack support

    platform/wab/src/wab/server/loader/module-bundler.ts

  • Removed deprecated Rollup bundling logic; now only supports esbuild
    for loaderVersion >= 7.
  • Added support for "tanstack" platform in BundleOpts.
  • Ensured serverQueriesExecFuncFileName is included in component meta
    and output.
  • Improved error handling and logging for esbuild bundling failures.
  • Cleaned up imports and removed unused dependencies.
  • +52/-282
    util.ts
    Extend Cypress support utilities for project, prop, and variant
    testing

    platform/wab/cypress/support/util.ts

  • Added numerous new utility functions for Cypress E2E tests, including
    project panel, component prop, frame, and variant helpers.
  • Enhanced existing utilities for better frame selection, undo/redo,
    visibility toggling, and project configuration.
  • Improved selectors and added documentation for new helpers.
  • Refactored and expanded support for project panel and component
    manipulation.
  • +322/-40
    send-comments-notifications.ts
    Refactor comment notification processing and grouping logic for emails

    platform/wab/src/wab/server/scripts/send-comments-notifications.ts

  • Refactored and expanded the logic for processing and sending comment
    notifications.
  • Introduced new types and context class to manage notification grouping
    and user/project/thread mapping.
  • Improved notification grouping by user, project, and thread, and added
    support for reactions and thread histories.
  • Enhanced notification settings handling and made notification
    processing more modular and robust.
  • +431/-199
    code-components.ts
    Improve code component prop registration type checking and handling

    platform/wab/src/wab/shared/code-components/code-components.ts

  • Enhanced type checking and validation for code component prop
    registrations.
  • Added new type helpers and improved error messages for prop
    registration errors.
  • Improved handling of prop types, options, and custom function
    registration.
  • Added support for new prop types and improved comparison logic for
    component props.
  • Refactored and expanded logic for updating component props and
    handling className prop changes.
  • +231/-111
    index.ts
    Add TanStack Router and server query support to React codegen

    platform/wab/src/wab/shared/codegen/react-p/index.ts

  • Added support for TanStack Router platform in code generation.
  • Enhanced server query and RSC (React Server Components) support in
    generated code.
  • Improved imports, prop typing, and head/meta serialization for new
    platforms.
  • Refactored skeleton wrapper and page-aware wrapper generation for new
    routing and server query paradigms.
  • +141/-47
    Bug fix
    1 files
    AmplitudeAnalytics.ts
    Fix import path for Analytics types in AmplitudeAnalytics

    platform/wab/src/wab/shared/observability/AmplitudeAnalytics.ts

  • Fixed import path for Analytics and Properties types to use the
    correct observability directory.
  • +4/-4     
    Formatting
    1 files
    SlotUtils.ts
    Update imports for slot and Tpl utilities in SlotUtils     

    platform/wab/src/wab/shared/SlotUtils.ts

  • Added and reordered imports to include new utilities and types for
    slot and Tpl processing.
  • No functional changes, only import adjustments.
  • +29/-26 
    Additional files
    101 files
    01-config-tooling.md +0/-16   
    README +0/-5     
    .browserslistrc +0/-16   
    .editorconfig +0/-16   
    README.md +0/-27   
    angular.json +0/-94   
    3rdpartylicenses.txt +0/-256 
    index.html +0/-12   
    main.ef91450b26733d80.js +0/-7360
    polyfills.5cf9041adbc6958d.js +0/-2045
    runtime.6263bc5acf5b193e.js +0/-64   
    styles.ef46db3751d8e999.css [link]   
    karma.conf.js +0/-41   
    package.json +0/-39   
    app.component.css [link]   
    app.component.html +0/-831 
    app.component.spec.ts +0/-31   
    app.component.ts +0/-11   
    app.module.ts +0/-22   
    .gitkeep [link]   
    environment.prod.ts +0/-3     
    environment.ts +0/-16   
    index.html +0/-13   
    main.ts +0/-13   
    polyfills.ts +0/-52   
    styles.css +0/-1     
    test.ts +0/-30   
    tsconfig.app.json +0/-10   
    tsconfig.json +0/-29   
    tsconfig.spec.json +0/-10   
    .eslintrc.json +0/-3     
    AngularTest.tsx +0/-33   
    next.config.js +0/-9     
    ng +0/-1     
    package.json +0/-25   
    plasmic-host.tsx +0/-6     
    test-ng.tsx +0/-5     
    Home.module.css +0/-129 
    globals.css +0/-26   
    tsconfig.json +0/-20   
    .eslintrc.json +3/-0     
    README.md +1/-1     
    next.config.mjs +19/-0   
    package.json +26/-0   
    [[...catchall]].tsx +22/-12 
    hello.ts +1/-1     
    plasmic-host.tsx +7/-0     
    plasmic-init.ts +8/-9     
    Home.module.css +165/-0 
    globals.css +42/-0   
    tsconfig.json +34/-0   
    README.md +0/-46   
    env.d.ts +0/-1     
    package.json +0/-32   
    App.vue +0/-25   
    base.css +0/-75   
    main.css +0/-35   
    HelloWorld.vue +0/-40   
    TheWelcome.vue +0/-86   
    WelcomeItem.vue +0/-86   
    HelloWorld.spec.ts +0/-11   
    IconCommunity.vue +0/-7     
    IconDocumentation.vue +0/-7     
    IconEcosystem.vue +0/-7     
    IconSupport.vue +0/-7     
    IconTooling.vue +0/-19   
    main.ts +0/-14   
    plasmic-init.ts +0/-15   
    index.jsx +0/-47   
    counter.ts +0/-12   
    AboutView.vue +0/-15   
    HomeView.vue +0/-9     
    tsconfig.app.json +0/-12   
    tsconfig.config.json +0/-8     
    tsconfig.json +0/-14   
    tsconfig.vitest.json +0/-9     
    vite.config.ts +0/-15   
    knip.ts +58/-0   
    package.json +9/-3     
    package.json +1/-1     
    file-utils.spec.ts +47/-0   
    export.ts +1/-1     
    init.ts +51/-4   
    sync-components.ts +26/-1   
    sync.ts +3/-3     
    api.ts +15/-2   
    code-utils.ts +103/-2 
    config-utils.ts +22/-2   
    envdetect.ts +9/-0     
    file-utils.ts +29/-3   
    rsc-config.ts +56/-0   
    gatsby-browser.jsx +2/-1     
    gatsby-ssr.jsx +2/-1     
    package.json +4/-4     
    plasmic.json +14/-8   
    Button.jsx +1/-3     
    PlasmicButton.jsx +53/-100
    PlasmicDynamicPage.jsx +36/-30 
    PlasmicGlobalVariant__Screen.jsx +3/-15   
    PlasmicHomepage.jsx +25/-25 
    Additional files not shown

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • IcaroG and others added 30 commits March 13, 2025 17:26
    GitOrigin-RevId: 83931c73334f5e43763ebe692a98a7dc8884341e
    GitOrigin-RevId: a788bb98d25e31eaca6950368f2378e803cf66a0
    GitOrigin-RevId: 207bfb8359003ea8757e5a9b45c29555656939e5
     - @plasmicapp/data-sources@0.1.175
     - @plasmicapp/react-web@0.2.376
     - @plasmicapp/react-web-runtime@0.0.96
     - @plasmicpkgs/antd5@0.0.277
     - @plasmicpkgs/fetch@0.0.3
     - @plasmicpkgs/plasmic-rich-components@1.0.207
    
    GitOrigin-RevId: 9ac8f559e516bf86e67de2b73d8c51ae1d66a9b6
    * fix: remove some unwanted imports from client/ in shared/
    
    * refactor: move isPositionManagedFrame to studioCtx
    
    GitOrigin-RevId: 42c5a6225988e12a21a91d3f5700e3a97d10e47c
    GitOrigin-RevId: 98619a2e83195662b9edd9010e169efebe7cbc12
    * fix: Swallow s3 error in dev mode
    
    * fix: Only ignore error in development
    
    GitOrigin-RevId: d94e49f84ecebd52c51dbe630f2dd89b23aca77e
    * feat(comments-filter): add user mentions filter in the Comments Tab
    
    * feat(comments-filter): add user participation logic in the mentions and replies filter
    
    * feat(comments-filter): add comments resolved filter
    
    * chore: plasmic.json and plasmic.lock changes
    
    * chore: reverted an unncessary change
    
    * feat(comments-filter): removed setter and getter for comments filter observable
    
    * feat(comments-filter): fix imports for shared code
    
    GitOrigin-RevId: 7a1524fcc6cb8751a0f348e0bb0e4c158ce885f8
    GitOrigin-RevId: b5fc0391536afd33a5a1130040d13abccad0d2eb
    * [DEVOP-130] Created pipeline to push services to GAR
    
    * Chore(build-and-push-services): Changed trigger condition to test
    
    * Chore(build-and-push-services): Added matrix for services and contexts
    
    * Chore(build-and-push-services): Remove matrix for context and added conditional step for it
    
    * Chore(build-and-push-services): Changed context for wab
    
    * Chore(build-and-push-services): Added Dockerfile path input to env and to docker-buildx action
    
    * Chore(build-and-push-services): Added steps to build plasmic-deployed.json and change Dockerfile
    
    * Chore(build-and-push-services): Added steps to build plasmic-deployed.json and change Dockerfile
    
    * Chore(build-and-push-services): Remove .tmp from copy instructions
    
    * Chore(build-and-push-services): Added working-directory
    
    * Chore(build-and-push-services): Changed path for node command
    
    * Chore(build-and-push-services): Fixed path for Dockerfile commands
    
    * Fix(build-and-push-services): added wab prefix to fix path
    
    * Chore(build-and-push-services): Remove make command
    
    * Chore(build-and-push-services): Fixed Dockerfile
    
    * Chore(build-and-push-services): Changed runs-on
    
    * Chore(build-and-push-services): Changed runs-on
    
    * Chore(build-and-push-services): Changed runs-on
    
    * Test(build-and-push-services): Commented make command
    
    * Test(build-and-push-services): Commented make command
    
    * Chore(build-and-push-services): Remove -f function
    
    * Chore(build-and-push-services): Started tagging from 1
    
    * Chore(build-and-push-services): Remove plasmic-deployed.json file
    
    * Chore(build-and-push-services): Added condition to build plasmic-deployed, changed tagging system and remove debug step
    
    * Chore(build-and-push-services): Remove paths-ignore and added exclude condition in changes job
    
    * Chore(platform): Added new Dockerfile for services
    
    * Chore(Dockerfile): Renamed new dockerfile
    
    * Chore(build-and-push-services): Added new filters
    
    * Feat(build-and-push-services): Added caching capability to workflow
    
    * Chore(build-and-push-services): Added again branch trigger
    
    * Chore(build-and-push-services): Added comments to explain critical steps behavior
    
    * Chore(build-and-push-services): Using base Dockerfile to build image
    
    * Chore(build-and-push-services): Added again branch trigger
    
    * Chore(build-and-push-services): Added pre-build steps to not change Dockerfile
    
    * Chore(build-and-push-services): Simplify pre-build step
    
    * Chore(build-and-push-services): Added working-directory to pre-build
    
    * Chore(build-and-push-services): Changed context
    
    * Chore(build-and-push-services): Removed condition
    
    * Chore(build-and-push-services): Check if plasmic-deployed.json exists in the given path
    
    * Chore(build-and-push-services): Remove debug step
    
    * Chore(build-and-push-services): Remove duplicated ignore condition
    
    * Fix(build-and-push-services): Fixed typos and spaces
    
    * Chore(build-and-push-services): Added condition for matrix to run only outputted jobs
    
    * Chore(build-and-push-services): Remove condition for matrix
    
    * Chore(platform): Remove Dockerfile.v2 since it's not needed
    
    * Chore(platform): Test matrix
    
    * Chore(platform): Fixed output from changes job
    
    * Chore(platform): Test both services
    
    * Chore(build-and-push-services): Remove branch trigger
    
    * Chore(build-and-push-services): Remove exceptions from wab-ci
    
    ---------
    
    Co-authored-by: Andrés Dominguez <schub_andres@plasmic.app>
    GitOrigin-RevId: 0b982f5ed817b0feed9d4ea11cbc7d89c45e0025
    GitOrigin-RevId: c6975b0c14a43997ca5cc5db74504ad3b579ce50
    * refactor: override comment dialog max-height to align top and bottom margins
    
    * refactor: chnaged max-height to percentage for CommentDialog.section
    
    * refactor: class changed from CommentDialog to CommentDialogContainer
    
    GitOrigin-RevId: 305c854d4e3be62007a8b95a9878786481c59362
    * feat: comment thread status indicator added to ThreadCommentsDialog and RootComment
    
    * feat: tooltip component added, tooltip added to ThreadHistoryStatus
    
    * Fix: Prevent dialog from opening when clicking on icon by stopping event propagation
    
    * chore: comments project plasmic sync after rebase
    
    * refactor: element selection refactored in CommentsTab
    
    * sync: comments project synced
    
    * refactor: used SWR mutation in ThreadHistoryStatus
    
    GitOrigin-RevId: 6f4d9119e6ab0ff590ad204b6622b0560644f981
    …ant (#640)
    
    * fix(comments-navigation): comments on variant to focus on correct variant artboard
    
    * fix(comments-navigation): improved logic to set studio focus on tpl for correct frame
    
    * chore(variant-comments): remove unused utility function
    
    * chore(variant-comments): fix typo in assert message
    
    * [PLA-11871]: Comment stats for focused mode (#641)
    
    * fix(comments): added variant specific stats for comments in focus mode
    
    * chore(variant-comments): added requested changes to structure code better
    
    * fix(comments-marker): fixed offset for add comments marker on the canvas
    
    * fix(variant-comments): fixed iid access on undefined address for newly added registered variant in focus mode
    
    * feat(variant-comments): refactor to avoid client specific imports in shared code
    
    * feat(variant-comments): added requested changes to remove fallback logic for comment stats
    
    * feat(variant-comments): find arena frame using frame variants instead of viewCtx
    
    * feat(variant-comments): remove async from getArenaFrameForSetOfVariants function
    
    * feat(variant-comments): remove invalid import after merge conflict resolution
    
    * feat(variant-comments): fix otherVariantsCount prop type on CommentIndicator
    
    * feat(variant-comments): fix get arena frame for set of variants to get correct pinned global variants
    
    * feat(variant-comments): fixed comments utils test cases
    
    * chore(comments-tests): used unique uuid for threads
    
    * feat(comment-stats): better code organization for tpl tree icon comment indicator stats
    
    GitOrigin-RevId: 8ac00fdcf5fd0e6a973c32bf635d9367b24f77ab
    Change-Id: I2162e4c63663806dfd29cb36a82d5ae4caedbdf8
    GitOrigin-RevId: 29ce2c70d47267b372cc105ca39dbd297b408cd9
     - @plasmicapp/loader-gatsby@1.0.380
     - @plasmicapp/loader-nextjs@1.0.416
     - @plasmicapp/loader-react@1.0.377
     - @plasmicapp/loader-svelte@0.0.357
     - @plasmicapp/loader-vue@0.1.371
    
    GitOrigin-RevId: 09fd9d6edc90496b0151eac0611d8105670cc202
    GitOrigin-RevId: b6d7a53ab7ae55b71d8438755bce01c98f64752b
    GitOrigin-RevId: 81fa66f16885736173eac6bd1fc552ae30928bb3
    GitOrigin-RevId: 472c0f3db78ddbdd70dc4f9c769fc53a1efd92d3
    GitOrigin-RevId: 5f767e987faaa415da095de0e34a3834086ed0ca
    GitOrigin-RevId: f30b983089ea2e1816137d94628022840b33da33
    * feat(rsc): Generate rsc modules
    
    Issue: https://linear.app/plasmic/issue/PLA-11492
    
    * chore: Improve comments and typings of codegen
    
    * fix: Remove invalid comma
    
    * feat: Include useDollarServerQueries in live preview
    
    * feat: Add minimal setup for server queries in canvas-rendering
    
    * fix: Support arguments in server queries codegen
    
    * chore: add tests for codegen server queries and params
    
    * feat: add support for server queries in loader
    
    * fix(codegen): custom function import should not repeat itself
    
    * feat(codegen): move  to  in the client component
    
    * feat(canvas): make server queries observable in the canvas
    
    * feat(server-queries): usePlasmicServerQuery in canvas rendering
    
    * [PLA-11801] Make studio cache for server queries (#625)
    
    * feat(server-queries): add studio cache for server queries
    
    * feat(server-queries): use the function registration as id for better caching
    
    * refactor(server-queries): add type for plasmic window internals
    
    * feat(rsc): Allow hostless functions to be used in loader rsc (#437)
    
    * feat(rsc): Allow hostless functions to be used in loader rsc
    
    * fix: Remove logs and add funcId
    
    * fix: Add missing isQuery in func expr registration
    
    * test(codegen): regenerate test snapshots
    
    * Multiple fixes (#666)
    
    * fix: Use canvasCtx to get function for execute
    
    * fix: Handle upgrade of custom functions
    
    * chore: Mark getServerQueriesData as unstable
    
    * fix: use usePlasmicServerQuery for useDollarServerQueries
    
    * fix: Handle args in project upgrade
    
    * fix: handle @plasmicapp/host/registerFunction in loader
    
    * fix: Minor fixes for dependency functions to execute
    
    * chore: add NODE_ENV in pm2
    
    * fix: Properly clone server queries
    
    * fix: Use valid js names for server queries code
    
    * refactor: Reuse loader snippet in rsc codegen
    
    * fix: Use proper signature and components
    
    * fix: Use hostless registry instead of canvasCtx
    
    * fix(codegen): minor fixes for RSC codegen
    
    ---------
    
    Co-authored-by: Felipe Mota <fmota@plasmic.app>
    GitOrigin-RevId: 4cde69b14eb820a80827a1f336396ae73ed05ee9
     - @plasmicapp/cli@0.1.336
     - @plasmicapp/loader-core@1.0.137
     - @plasmicapp/loader-edge@1.0.68
     - @plasmicapp/loader-fetcher@1.0.55
     - @plasmicapp/loader-gatsby@1.0.381
     - @plasmicapp/loader-nextjs@1.0.417
     - @plasmicapp/loader-react@1.0.378
     - @plasmicapp/loader-splits@1.0.63
     - @plasmicapp/loader-svelte@0.0.358
     - @plasmicapp/loader-vue@0.1.372
     - @plasmicapp/react-web@0.2.377
     - @plasmicapp/react-web-runtime@0.0.97
     - @plasmicapp/watcher@1.0.84
     - @plasmicpkgs/antd5@0.0.278
    
    GitOrigin-RevId: e390ac2d296d887f8ed34f29fd85f21a315c35da
    GitOrigin-RevId: c903cb478bcb127b4cd64763b5ec54e902b95ba0
    GitOrigin-RevId: 72663d6530d8de3b1244f4430749e4a3ee751a10
    GitOrigin-RevId: 533c76a1c6d415e79948db808bbf029860ae8df7
    …#681)
    
    * fix(splits): Stop writing cookies client side in loader
    
    * chore: Remove deprecated mark
    
    * fix(splits): Only access known values for experiment splits
    
    GitOrigin-RevId: c987197705d3fb715fd825a5fba5ff6fc41d6dfd
     - @plasmicapp/loader-edge@1.0.69
     - @plasmicapp/loader-gatsby@1.0.382
     - @plasmicapp/loader-nextjs@1.0.418
     - @plasmicapp/loader-react@1.0.379
     - @plasmicapp/loader-splits@1.0.64
     - @plasmicapp/loader-svelte@0.0.359
     - @plasmicapp/loader-vue@0.1.373
     - @plasmicapp/react-web@0.2.378
     - @plasmicapp/react-web-runtime@0.0.98
     - @plasmicpkgs/antd5@0.0.279
    
    GitOrigin-RevId: e98a63a4ed9c25c0de979d20194d889432f8b449
    GitOrigin-RevId: cf5eba5b6ee2aeb1e388310f41db9c332ec8e03e
    …iable to avoid bad reference
    
    Example: two functions with the same first argument test. When changing the interaction action from the first function to the second, we would keep the reference to the old argument
    GitOrigin-RevId: e3cbca6748f89c64ed706194e1956103f9d24da3
    sarahsga and others added 22 commits May 14, 2025 09:41
    …(#1012)
    
    * feat(emails): Add react-email code components + email testing script
    
    Change-Id: Ic4904c686c71a4ad4d693bb71574b2be6b158657
    
    * jason updates
    
    Change-Id: Icd6cdba1b5467f930801a47a81388e424db06746
    
    * refactor to server and rename things
    
    Change-Id: Ied747ec3fa1c11d286d870d2ca412adc46201afc
    
    * Add utilities for removing classes and basic email HTML verification
    
    Change-Id: I8ddb20153ff83a90a4b0cf80e9f9a07c96164d0c
    
    * fix: Remove obsolete email code
    
    Change-Id: I3285a8a831e02113af772b593a4c3a0106f66c5f
    
    * remove existing generated html in out/
    
    Change-Id: I5bdba38705a3a597203450d91aa4f02afd239a4c
    
    * fix(cc): improvements to react-email code components
    
    Change-Id: I9c56ed9a977267a003485a436849e247e2cb5253
    
    * fix CI
    
    Change-Id: I99aebf9e24fcacde8430772f901bb5398e0bf11a
    
    ---------
    
    Co-authored-by: Jason Long <j@jaslong.com>
    GitOrigin-RevId: 5033183886c216f75428b4436bc9ec7aac2a3d0d
    * Revert "fix(plasmic-basic-components): remove unused imports"
    
    This reverts commit f042be4dc808a087f45eaa068654f78f501d3f10.
    
    * Revert "fix(LoadingBoundary): don't render nothing on SSR"
    
    This reverts commit 7e9c3da319426f43996c5ea1970a9253127ccb73.
    
    * fix(loading-boundary): return fallback
    
    Change-Id: Ie3514d011b04276832087bac39d2b66794c8620b
    GitOrigin-RevId: 19333cfb5b37c46c13e4ad81b2652bfe47a9da80
     - @plasmicpkgs/plasmic-basic-components@0.0.243
    
    GitOrigin-RevId: 99abccd134bc5a53da9571390a72874b18aaa94c
    GitOrigin-RevId: a73aa8983ff5d5428bd821735430afb3f385180b
    GitOrigin-RevId: 2f1c68b9dd987f8569d83f24f212238d8686f7df
    Change-Id: I07bc2a4e8d24b9b08e08bb01565b7267fe79b869
    GitOrigin-RevId: 23e8533a0b542d75f669111a9df4dbdba15a4fbc
    Change-Id: Ie7530dcd792c9da986a5419438d781d8603f515e
    GitOrigin-RevId: 82c8b8f3d1cc13bf485897284488248c11771e2a
    GitOrigin-RevId: 91bc116f3d79798c2735c40828ba1bcdca990521
    Change-Id: I874fbdcd49cb341994161cf8ff429bfcd905371f
    GitOrigin-RevId: 759afca50b8808b0d1a2c899d6e0551a395646c3
    GitOrigin-RevId: cfa9b7c4a7a1deca4e83bb83ad10b19b5137bbce
    * refactor: custom relativeTime added to moment js for studio
    
    * chore: added tests for moment config
    
    * refactor: condensed moment-config tests
    
    GitOrigin-RevId: 6e3c39667d0d40e7ee1af94fdb0bbba8844704d1
    …tudio
    
    GitOrigin-RevId: eb3e70cb9dff135ddbe00bf7a76bf33469facb3b
    * feat(copilot): upgrade openai package version to latest
    
    * feat(copilot): add images support in ui copilot backend
    
    * chore(copilot): use OpenAI exported type for CreateChatCompletionRequest Options
    
    * chore(copilot): use OpenAI types for image content part
    
    * chore(copilot): minor code and type improvements
    
    * chore(copilot): remove unused type properties
    
    * chore(copilot): use data-urls utility functions
    
    * feat(copilot): use openai type for WholeChatCompletionResponse and update data references
    
    * feat(copilot): ensure copilot response data format as per client code
    
    * chore(copilot): simplify CopilotResponseData type
    
    * fix(copilot): openai sdk validation error in case of undefined api key
    
    * chore(copilot): fix type error in corpus-eval
    
    * fix(copilot): init OpenAI sdk inside function to avoid unncessary validation errors
    
    GitOrigin-RevId: 9d1e56b7e276afa269433ffb076b724f493fe471
    …ior (#994)
    
    * refactor: hide canvas marker like rest of the markers on canvas when zooming, moving, etc
    
    * refactor: added shouldHideUIOverlay in studioCtx and removed redundant checks
    
    * refactor: added param to include isResizeDragging in shouldHideUIOverlay
    
    GitOrigin-RevId: 73b2c10e955f59a858a83646162e4441343cf63b
    …expected. (#1046)
    
    * fix(user-mentions): add selection with insert text to mimic setRangeText
    
    * chore(user-mentions): remove unused argument onValueChange
    
    * chore(user-mentions): improve arg definition for insertText function
    
    GitOrigin-RevId: c44990315e39c4b71e17c2f45f8d45d269f86e47
    * feat(copilot): plasmic file changes for CopilotPromptImage component
    
    * feat(copilot): add image attachment backend integration in CopilotPromptDialog
    
    * chore(copilot): nitpick improve type definition using Pick utility
    
    * chore(copilot): sync list of copilot image types
    
    GitOrigin-RevId: 90d23022f099be56d3ac5c521b539e5790ed5142
    …nt of allowed type (#1055)
    
    Change-Id: I0baed30291041c523616a29a7686b705fe8fc0fc
    GitOrigin-RevId: 24774c6c8b530074ee67e3e0c50933e160bbada6
    GitOrigin-RevId: f8db6b80af422800e614807ce15c25431a0e164c
    * wip right click on erena switcher brings up context menu
    * fixed z index issue
    * removed the rename option from the areaSwitcher context menu
    * updated context menu to use the useContextMenu hook
    
    Change-Id: I924b59a5edde5fabfbb836cefe6816fa6d9a9d53
    GitOrigin-RevId: f874821dc593b54fe68f5f838c0ccb8de4c63641
    Often times, it's useful to perform multiple operations
    on the navigation dropdown. Previously, the dropdown closed
    for most context menu actions. Now, it only closes when using
    the find all references action.
    
    Refactored context menu to AreanContextMenu since it's now used
    in both NavigationRows and ArenaSwitcher.
    
    Change-Id: I532fce7389d655c5c47bf51af8d35763834d353f
    GitOrigin-RevId: 652c072f59a43ed92f47b580048a41e996785fe5
    # Conflicts:
    #	platform/canvas-packages/yarn.lock
    #	platform/loader-tests/src/test-utils.ts
    #	platform/wab/Dockerfile
    #	platform/wab/package.json
    #	platform/wab/src/wab/client/analytics/index.ts
    #	platform/wab/src/wab/server/bundle-migrations/22-add-aspect-ratio.ts
    #	platform/wab/src/wab/server/cdn/images.ts
    #	platform/wab/src/wab/server/routes/loader.ts
    #	platform/wab/src/wab/server/routes/misc.ts
    #	platform/wab/src/wab/server/secrets.ts
    #	platform/wab/src/wab/server/util/s3-util.ts
    #	platform/wab/src/wab/server/workers/codegen.ts
    #	platform/wab/src/wab/shared/devflags.ts
    #	platform/wab/yarn.lock
    @qodo-code-review
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Error Handling

    The HTML parser has several places where errors are silently caught or ignored. For example, in the getStyleSheet function (lines 38-53), there's a try/catch block that silently ignores errors when accessing cssRules. This could lead to unexpected behavior if stylesheets fail to load properly.

    try {
      content = [...ss.cssRules]
        .map((cssRule) => {
          return cssRule.cssText;
        })
        .join("\n");
    } catch (e) {}
    Performance Concern

    The HTML parser performs multiple DOM queries and style computations which could be expensive for large documents. The storeRuleRelationToNodes function (lines 762-781) queries the document for each CSS selector, which might cause performance issues with complex stylesheets.

    function storeRuleRelationToNodes(
      context: string,
      selector: string,
      rule: CssRuleAST
    ) {
      const nodes = document.querySelectorAll(selector);
    
      if (nodes.length === 0) {
        return;
      }
    
      for (const node of nodes) {
        const wiID = getInternalId(node);
        if (!wiID) {
          continue;
        }
    
        addNodeWIRule(context, selector, rule, node);
      }
    }

    @qodo-code-review
    Copy link

    qodo-code-review bot commented May 19, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Missing relation in query

    The query is missing the leftJoinAndSelect for comments, which are needed for
    notification processing. Without this, the returned threads won't have their
    comments loaded, causing potential issues when generating notifications.

    platform/wab/src/wab/server/db/DbMgr.ts [9734-9746]

     async getUnnotifiedCommentThreads(before: Date): Promise<CommentThread[]> {
       this.checkSuperUser();
       return await this.commentThreads()
         .createQueryBuilder("thread")
         .where("thread.deletedAt IS NULL")
         .leftJoinAndSelect("thread.branch", "branch")
    +    .leftJoinAndSelect("thread.comments", "comment")
         .andWhere(
           "(thread.lastEmailedAt is NULL OR (thread.updatedAt > thread.lastEmailedAt AND thread.updatedAt <= :before))",
           { before }
         )
         .orderBy("thread.updatedAt", "ASC")
         .getMany();
     }

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly points out that the query should include a leftJoinAndSelect for comments to ensure that comments are loaded with each thread, which is important for notification processing. This improves the correctness and reliability of the notification logic, but is not a critical bug fix, so a score of 7 is appropriate.

    Medium
    General
    Add timeout to assertions

    The assertHidden function has a potential race condition. When checking for
    hidden content, it's better to use Cypress's built-in timeout mechanism with
    explicit assertions rather than assuming the element is immediately not present.

    platform/wab/cypress/e2e/auto-open.spec.ts [380-389]

     function assertHidden(
       frame: Framed,
       hiddenContent: string,
       visibleContent?: string
     ) {
       if (visibleContent) {
         frame.base().contains(visibleContent).should("exist");
       }
    -  frame.base().contains(hiddenContent).should("not.exist");
    +  frame.base().contains(hiddenContent).should("not.exist", { timeout: 2000 });
    +  cy.autoOpenBanner().should("not.exist");
     }

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 6

    __

    Why: Adding a timeout to the assertion for hidden content in assertHidden improves test reliability by accounting for asynchronous UI updates, but the change is minor and not critical for correctness.

    Low
    Add error logging

    The function silently ignores any errors when accessing cssRules without logging
    them. This could hide CORS-related issues or other stylesheet access problems.
    Consider adding error logging to help with debugging.

    platform/wab/src/wab/client/web-importer/html-parser.ts [37-54]

     function getStyleSheet(document: Document) {
       const styleSheetsContent = [...document.styleSheets].map((ss) => {
         let content = "";
         try {
           content = [...ss.cssRules]
             .map((cssRule) => {
               return cssRule.cssText;
             })
             .join("\n");
    -    } catch (e) {}
    +    } catch (e) {
    +      console.warn(`Could not access cssRules for stylesheet ${ss.href}:`, e);
    +    }
         return {
           href: ss.href,
           content,
         };
       });
     
       return styleSheetsContent.map((s) => s.content).join("\n");
     }

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 5

    __

    Why: Logging errors when accessing cssRules can aid debugging, especially for CORS issues, but it does not affect functionality or correctness; it's a moderate improvement for maintainability.

    Low
    • Update

    @willymwai willymwai merged commit 41a7189 into master May 19, 2025
    @willymwai willymwai deleted the feat/upstream-changes branch May 19, 2025 13:20
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.