What is the best approach to creating a vector rectangle that could have a gradient fill and a solid border of, say, 3 pixels and this shape could be animated (seperately for W and H) while no anti-aliasing or warping of the border would occur?
Is it best to start with a AI shape or a native AE shape?
I have noticed that both AE and AI can have faded borders, there are semi transparent pixels on the edge of the border so it is not a clean 3 pixel solid. I have also noticed that its difficult to create an extact width and height even while taking the border into account.
I can't calculate it to the pixel like I would in CSS. So is there any working method to create extact pixels for AE?
Pixels and points in illustrator = pixels in AE. Odd numbers of pixels will not line up unless the anchor point is set to a half pixel value and the position is at a whole pixel value. Illustrator has a snap to pixel option.
Most important, video moves and the precise positioning you demand in print design is not necessary in video. Don't obsess over a single frame. You can only judge video when it is played on the device you plan to use for delivery.
As Rick said, unless you want your video to look like a video game, there would be no point in not having antialaising. If you follow that route, your video will look all jumpy and jittery. Of course you can quantize output by setting layer quality to draft or applying e.g. a Mosaic effect, but again, it's not the common way to use for video. Also your whole effort would go to waste, anyway, if you output to a compressed format like H.264 that introduces artifacts...
As I re-read your qustion I thought you might be asking how to scale a shape layer with a stroke but keep the stroke the same size visually so that a shape layer with a stroke of 10 pixels would still have a stroke of ten pixels when scaled to 200%. If that is what you want then add this expression to the stroke with and scale the shape layer with the transform>scale property.
sf = transform.scale / 100; sv = value; sv / sf