Conversation
There was a problem hiding this comment.
Starting to look good.
This review is not final (still missing package.json and vite config)
General comments :
- Formatting/linting is not passing
- Wondering what would be a better way to contextualize cursor
- I like your usage of the
libfolder. So far we've usedsrc/uifor components, but I wonder if we wouldn't benefit to harmonize every ds package tosrc/libinstead ? Wdyt @jmuzina ?
There was a problem hiding this comment.
I wonder if those should live on the monorepo - if it's the case we could end up with ide specific rules for many editors. Would there be a better way to consume those ?
Maybe have them on a special package cursor-rules ?
There was a problem hiding this comment.
In my opinion these are useful, unfortunately there is no standard LLM rules across IDEs (I hope eventually there will be?)
Maybe have them on a special package cursor-rules ?
The .cursor folder works similarly to rc files where it needs to have this name and be a parent or grandparent of the folder where we want the rules to be used, so it won't be possible to: change the name of the folder, move it to a far place where it wouldn't be a grandparent of the directory svelte.
I think, the place of this folder is good, it avoids having all cursor rules in the root and instead separate rules by context.
We should also consider adding the contribution guideline as a cursor rule as well.
But again, this is specific to cursor and it is a shame that there are no standards..
So happy to add Zed, Copilot or other IDE specific rule if someone need them.
packages/svelte/ds-app-launchpad/src/lib/AwesomeButton/AwesomeButton.svelte
Show resolved
Hide resolved
|
Hi @advl thank you for taking the time to look into this and write these valuable comments. I've applied the requested changes and left comments on some of your comments. |
|
I wonder why the tests are failing on core ? |
@advl I encountered these in #247 and found that there is an oversight in some of the tooltip-related hooks that can cause asynchronous browser API calls to continue running after the test environment has been torn down, and the browser APIs are no longer available. I added some cleanup code for debounce and useDelayedToggle that seems to have fixed the issue for me. What's stranger is that the issue is happening in two separate PRs that have not been merged together, and is not happening on main. My guess is our loose version numbering (using ^ to accept minor and patch updates) has caused some version in the lockfile to be updated and cause our tests to fail in these PRs. If we merge #247 , or at least the fixes introduced by the two commits I linked above, these should stop. In general, though, I think this is an indication we should be pinning dependency versions to specific versions, rather than using the ^ that bun will generate by default. A simpler fix would be to add some manual wait calls / settimeouts to the end of the failing tests to give some time for remaining async calls to resolve before allowing the test to close. |
|
Going to draft a simpler patch fix for the failing CI and send it today, to unblock |
|
|
Svelte libraries have a naming convention which mostly aligns with what we have for React regarding component folder naming and the component filename,.. |
|
@goulinkh could we possibly have |
|
On first install, I ran into an infinitely waiting postinstall step for the new package: Upon running the package's postinstall script This also dramatically increases the time taken for CI for the entire project. See this CI run: I think we should avoid packages having postinstall/prepare scripts that require prompts like this, as it presents the issue of requiring us to document package-specific install instructions at the root level. Some options could be:
|
|
I believe we could speed up the CI by using a cached playwright browser, I found these articles that detail it:
Then, we could remove the postinstall script (as Playwright/chromium should already be installed in CI environment). Then, maybe we can define some root-level dependency installation script, like Update: talked to @advl , we think maybe the playwright integration here should be extracted from the PR and discussed separately, to avoid blocking this PR any longer |
There was a problem hiding this comment.
While this PR is undoubtedly an essential step in diversifying our practice in different frameworks, it does not support as well as it could the ambition of the monorepo to become a codebase for different users and teams. Your code has taken a few liberties from the standards set in other packages - in testing, in the typescript config, in the package.json commands, in the folder structure. These liberties are not bad code - but create a cognitive load and complexity that should be better introduced considering the rest of the monorepo. In other words, it would be more helpful to contribute a monorepo package you rather than a package in the monorepo - this way we would avoid readers/users to wonder why things are done in a certain way in react and differently in svelte. This would significantly support the shared purpose of this codebase.
It is important to align on the idea that this type of novel and category-defining PRs need to take into account that they are contributing to a common, shared practice, rather than a single projects. In that sense, it is essential to see an intentional control of complexity and limited divergences as a main goal more than nice to haves!
Additionally, there's a lot we can learn from this - starting by the need to document better on our side the monorepo architecture and goals, to support better all kinds of contributions, that shouldn't be as hard as the one you are doing atm ;) Thank you again for this !
| sveltekit: { | ||
| storyPatterns: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx|svelte)"], | ||
| additionalAddons: [ | ||
| getAbsolutePath("@storybook/addon-svelte-csf"), |
There was a problem hiding this comment.
What are the added features of this addon in relation with the default storybook story format ?
Could we possibly document the motivation behind this framework specific addon in the README.md of the package ?
| } | ||
|
|
||
| type CreateConfigOptions = { | ||
| const FRAMEWORK_DATA = { |
There was a problem hiding this comment.
I am not fully happy with this object, since the shape of framework specific options is a partial match with the storybook configuration object. It would feel more comfortable to match this more thoroughly with the StorybookConfig type
There was a problem hiding this comment.
This file should likely not be there or not in this format. It is leaking information about the setup of the person that created it.
| "@sveltejs/vite-plugin-svelte": "^5.0.0", | ||
| "@types/node": "^22.10.1", | ||
| "@vitest/browser": "^3.2.1", | ||
| "playwright": "^1.52.0", |
There was a problem hiding this comment.
if playwright is not needed for now, it can safely be removed (we'll add it in the relevant PR later)
| @@ -0,0 +1,12 @@ | |||
| { | |||
| "extends": "./.svelte-kit/tsconfig.json", | |||
There was a problem hiding this comment.
This should extend one of our configs instead.
Is is important that this file is kept as lean as possible, in particular non default options. The options chosen here should be able to be applied to all the packages in the monorepo with a minimal cognitive overhead (why is this option enabled and not this one ?) - or at least the svelte packages only.
| enabled: true, | ||
| provider: 'playwright', | ||
| instances: [{ browser: 'chromium' }] |
There was a problem hiding this comment.
let's disable playwright for now and follow up together on how to enable it for the whole monorepo ;)
| test: { | ||
| name: 'ssr', | ||
| environment: 'node', | ||
| include: ['src/**/*.ssr.{test,spec}.{js,ts}'], | ||
| }, | ||
| }, |
There was a problem hiding this comment.
disable ssr tests for now - we'll implement a holistic approach for both react and svelte in a follow-up
| extends: './vite.config.ts', | ||
| test: { | ||
| name: 'server', | ||
| environment: 'node', | ||
| include: ['src/**/*.{test,spec}.{js,ts}'], | ||
| exclude: [ | ||
| 'src/**/*.svelte.{test,spec}.{js,ts}', | ||
| 'src/**/*.ssr.{test,spec}.{js,ts}' | ||
| ], |
There was a problem hiding this comment.
Same thing here. While these features are a clear plus and worth having - I would like us to be intentional in adopting this approach in testing in all of the monorepo. So let's follow-up with this in a structured way.
|
Closed for the time being. Shall be superseded by a vite+svelte package instead of a sveltekit packages - which diverges too much from the monorepo setup. Referenced in #290 |
Done
Fixes LP-2618
QA
bun installcd packages/svelte/ds-app-launchpadbun storybookAwesomeButtonstories are showing and working like React componentsbun run testTODO
PR readiness check
Feature 🎁,Breaking Change 💣,Bug 🐛,Documentation 📝,Maintenance 🔨.package.json:check,check:fix, andtest.build.