Skip to content

Migrate hello-world-astro-devlink to DevLink v2 export#1

Merged
paulvmoreau-webflow merged 12 commits into
v1from
devlink-v2-update
May 19, 2026
Merged

Migrate hello-world-astro-devlink to DevLink v2 export#1
paulvmoreau-webflow merged 12 commits into
v1from
devlink-v2-update

Conversation

@paulvmoreau-webflow
Copy link
Copy Markdown
Collaborator

Changes

webflow.json

  • Replace devlink with devlink-export
  • Point exports to ./src/webflow (was ./devlink)
  • Export all components and component groups (components / componentGroups: .*)
  • Disable TypeScript output (ts: false)
  • Enable scoped CSS (cssScopes: true) instead of CSS modules
  • Set relativeHrefRoot to /

src/layouts/Layout.astro

  • Update DevLinkProvider import to ../../webflow/DevLinkProvider
  • Load global styles from ../../webflow/css/global.css
  • Add DevLinkFontTags from ../../webflow/webflow_modules/DevLinkFontTags

src/pages/index.astro

  • Replace legacy devlink/_Builtin/Basic imports with per-component imports from webflow_modules (Block, Container, Link, Section)

Removed

  • Legacy devlink config: cssModules, fileExtensions.js: "jsx"
  • References to ./devlink and devlink/_Builtin import paths

Test plan

  • Run npm install and confirm the project builds
  • Run npm run dev and verify the app serves at http://localhost:4321
  • Run a DevLink export and confirm output under src/webflow
  • Confirm layout fonts and global styles load correctly
  • Run npm run build and npm run preview to validate production output

Comment thread webflow.json Outdated
"js": "jsx"
}
"devlink-export": {
"rootDir": "./src/webflow",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think the paths in Layout.astro are pointed to ./webflow, not ./src/webflow, so this might need to change if the CLI follows this setting when exporting.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CLI default looks to be ./webflow

…nk features

- Updated webflow.json to adjust root directory and add telemetry settings.
- Refactored index.astro to replace webflow component imports with standard HTML elements.
- Introduced new DevLinkProvider and IX3Provider components for improved interactions.
- Added utility functions and styles for better component integration.
- Created new CSS files for global styles, variables, and normalization.
- Removed options object from the anchor tag in index.astro for cleaner code.
- Directly set the href attribute for improved readability.
- Deleted telemetry section from webflow.json for a cleaner configuration.
- Ensured the file maintains proper structure and formatting.
… setting

- Removed the treeShake setting from webflow.json for a more streamlined configuration.
- Maintained the overall structure and formatting of the file.
- Added detailed steps for installing and configuring the Webflow CLI.
- Included commands for logging in, installing dependencies, and syncing Webflow components.
- Provided a link to the DevLink documentation for further reference.
- Deleted unused CSS files related to the previous DevLink configuration.
- Updated the DEVLINK_SCOPE_CLASS in devlinkScope.js to use a placeholder for site ID.
- Cleaned up global CSS imports to reflect the removal of obsolete styles.
Comment thread src/layouts/Layout.astro
fbaralle added a commit that referenced this pull request May 19, 2026
Astro hydrates the React DevLinkProvider client-side (client:load), so
its useInjectFonts hook only runs after first paint. For Google fonts
referenced by exported DevLink components to be available on the
initial server-rendered HTML, the layout needs to emit DevLinkFontTags
statically in <head>.

Mirrors the approach Paul Moreau is taking in
#1.
@agustinchiarotto
Copy link
Copy Markdown
Collaborator

@paulvmoreau-webflow can you point this PR to v1

@paulvmoreau-webflow paulvmoreau-webflow changed the base branch from main to v1 May 19, 2026 16:45
- Eliminated the DEVLINK_SCOPE_CLASS import and its application to the <html> tag.
- This change simplifies the layout structure while maintaining the necessary Webflow styles through global CSS.
Comment thread src/layouts/Layout.astro
---

<!doctype html>
<html lang="en" class={DEVLINK_SCOPE_CLASS}>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You don't need to set this scope class directly. Imported components will be wrapped in the scope class automatically.

If we put the scope class at the top level DOM then we run the risk of Webflow CSS style blocks bleeding over into the end user's app.

Comment thread webflow/css/global.css Outdated
@@ -0,0 +1 @@

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For now, this will sit empty. It exists so that the layout imports work out of the box.

When an end user runs webflow devlink export will populate this file and others as needed.

- Deleted multiple unused files including DevLinkProvider, IX3Provider, and associated utility modules.
- Cleaned up global CSS and font management components to streamline the project structure.
- This removal enhances maintainability by eliminating legacy code and unused dependencies.
Copy link
Copy Markdown
Collaborator

@agustinchiarotto agustinchiarotto left a comment

Choose a reason for hiding this comment

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

lgtm

@paulvmoreau-webflow paulvmoreau-webflow merged commit b79ca64 into v1 May 19, 2026
3 checks passed
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.

4 participants