-
-
Notifications
You must be signed in to change notification settings - Fork 103
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: allow version to be a pr-[prnumber]
or commit-[commithash]
#745
Conversation
Co-authored-by: Oscar Dominguez <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
pkg.pr.new
urlref:[pr|hash]
This is cool! I opened a PR on the I agree with @Conduitry that it should be
Similarly I don't think it should be |
I actually already made the change to use |
ref:[pr|hash]
pr-[prnumber]
pr-[prnumber]
pr-[prnumber]
or commit-[commithash]
Ok i've implemented both |
…are already broken and this doesn't fix them. we can deal with that another time if we want to
awesome! |
So...this basically allow us to open the playground with a version which is a
pkg.pr.new
url (generated from our CI on PRs and pushes) and it will use that version of svelte.This is working but i think there's some thing to discuss about the implementation and i wanted some feedback before (p.s. i also paired on it with @oscard0m this evening).
EDIT: i actually went ahead and implemented the solution below...so now to access a specific PR or commit you would do
https://svelte.dev/playground/hello-world?version=ref:13953
...i've also removed all theis_pkg_pr_new
around...we can always revert that commit!currently you should access the playground like thishttps://svelte.dev/playground/hello-world?version=https://pkg.pr.new/svelte@13953
to use that version of svelte... @Conduitry was arguing that maybe we shouldn't require the whole URL so that we can detach ourselves from pkg.pr.new in the future. I think it's a fair point so maybe we can change this.if we stick with the whole url i made the decision to check for the specific pkg.pr.new URL to prevent people from putting urls in query param and make us fetch their url..d.ts
that i manually generated. In theory we could remove the dependency and just copy paste the whole file in the codebase without much hassle.I'm also passing around a lot ofis_pkg_pr_new
variables which i don't particularly like.How i think we can make this better.
we could instead of using the whole url do something likeref:13953
as the version (i'm using ref because technically you could also use a commit hash). This will make sure that if tomorrow we want to leave pkg.pr.new we could find a different way to fetch the code for that pr/commit instead.tar.gz
but if you have suggestions for a more stable package i can swap it out...we can also just copy the code.instead of passing aroundis_pkg_pr_new
everywhere we could infer it either from the version (is we change toref:[number]
we could just check if adhere to this format) or from the url itself (if we stick topkg.pr.new
i can still check that the version is an URL with that origin.Example:
using this link
https://svelte-dev-git-pkg-pr-new-version-svelte.vercel.app/playground/hello-world?version=pr-13953
you can access the test of the pr 13953 (i picked that pr because it's very easy to verify that it's actually using that updated compiler)
WDYT?
Also i tried to stress test the playground a bit and it seems to work fine but i hope i'm not missing anything 😄
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.