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(editor): add simple preview without frontend #4174

Merged
merged 11 commits into from
Nov 4, 2024

Conversation

elbotho
Copy link
Member

@elbotho elbotho commented Oct 9, 2024

work on the editor offline and without next running

run yarn dev in the editor and you can test both the web component and react (package) implementations as http://localhost:5173/

image

@CodingDive how problematic is removing this line? With this set the dev server does not work somehow 🤷

Copy link

vercel bot commented Oct 9, 2024

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

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview Oct 28, 2024 10:10am

Copy link
Contributor

github-actions bot commented Oct 9, 2024

📦 Next.js Bundle Analysis for @serlo/frontend

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@CodingDive
Copy link
Contributor

CodingDive commented Oct 11, 2024

@CodingDive how problematic is removing this line? With this set the dev server does not work somehow 🤷

Believe it or not, this will break the build, or rather cause an error in the integrations that I haven't found a way to supress 😅

Maybe we can use two files
vite.config.lib.js - Configuration for building the packages
vite.config.dev.js - Config for running dev server

vite build --config vite.config.lib.js
vite --config vite.config.dev.js

Or modes / commands

export default defineConfig(({ command, mode }) => {
  if (command === 'build' && mode === 'lib') {
    return {
      ....
    }
  } else {
    return ... 
  }
})

Then pass the args in our package.json run scripts like this

vite build --mode lib

@elbotho
Copy link
Member Author

elbotho commented Oct 11, 2024

@CodingDive would that work? 9ef60b4
Or even better: Can you tell me how I can check myself?

@CodingDive
Copy link
Contributor

@CodingDive would that work? 9ef60b4

Works right now 🙌

Thank you!

Copy link
Contributor

@hejtful hejtful left a comment

Choose a reason for hiding this comment

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

This is so nice 😍 Thank you, it will be very helpful in the long run

packages/editor/demo/lit/index.js Outdated Show resolved Hide resolved
Co-authored-by: Vitomir Budimir <budimirvitomir@gmail.com>
@hejtful
Copy link
Contributor

hejtful commented Nov 4, 2024

@elbotho It would be great to have a preview for the editor rendered within an iframe as well, as that's how it's rendered for some LTI integrations. Would you prefer if we add it to this PR, or open a follow-up PR once this is merged?

@elbotho
Copy link
Member Author

elbotho commented Nov 4, 2024

@elbotho It would be great to have a preview for the editor rendered within an iframe as well, as that's how it's rendered for some LTI integrations. Would you prefer if we add it to this PR, or open a follow-up PR once this is merged?

Good idea, no preference :)

I'm just waiting for a 👍 from @LarsTheGlidingSquirrel here before merging this to see if it works for him.

Copy link
Member

@LarsTheGlidingSquirrel LarsTheGlidingSquirrel left a comment

Choose a reason for hiding this comment

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

Seems to work great! I think it will be really valuable for us to have during development. Thank you so much! <3

@elbotho elbotho merged commit 2ad15df into staging Nov 4, 2024
9 checks passed
@elbotho elbotho deleted the feat/simple-editor-dev branch November 4, 2024 12:59
@github-actions github-actions bot mentioned this pull request Nov 4, 2024
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